diff --git a/waku/waku_api/rest/admin/openapi.yaml b/waku/waku_api/rest/admin/openapi.yaml deleted file mode 100644 index 2ce64e46c..000000000 --- a/waku/waku_api/rest/admin/openapi.yaml +++ /dev/null @@ -1,74 +0,0 @@ -openapi: 3.0.3 -info: - title: Waku V2 node REST API - version: 1.0.0 - contact: - name: VAC Team - url: https://forum.vac.dev/ - -tags: - - name: admin - description: Admin REST API for WakuV2 node - -paths: - /admin/v1/peers: - get: - summary: Get connected peers info - description: Retrieve information about connected peers. - operationId: getPeerInfo - tags: - - admin - responses: - '200': - description: Information about a Waku v2 node. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/WakuPeer' - '5XX': - description: Unexpected error. - post: - summary: Adds new peer(s) to connect with - description: Adds new peer(s) to connect with. - operationId: postPeerInfo - tags: - - admin - requestBody: - content: - application/json: - schema: - type: array - items: - type: string - responses: - '200': - description: Ok - '400': - description: Cannot connect to one or more peers. - '5XX': - description: Unexpected error. - -components: - schemas: - WakuPeer: - type: object - required: - - multiaddr - - protocols - properties: - multiaddr: - type: string - protocols: - type: array - items: - type: object - required: - - protocol - - connected - properties: - protocol: - type: string - connected: - type: boolean diff --git a/waku/waku_api/rest/debug/openapi.yaml b/waku/waku_api/rest/debug/openapi.yaml deleted file mode 100644 index af205a065..000000000 --- a/waku/waku_api/rest/debug/openapi.yaml +++ /dev/null @@ -1,64 +0,0 @@ -openapi: 3.0.3 -info: - title: Waku V2 node REST API - version: 1.0.0 - contact: - name: VAC Team - url: https://forum.vac.dev/ - -tags: - - name: debug - description: Debug REST API for WakuV2 node - -paths: - /debug/v1/info: - get: - summary: Get node info - description: Retrieve information about a Waku v2 node. - operationId: getNodeInfo - tags: - - debug - responses: - '200': - description: Information about a Waku v2 node. - content: - application/json: - schema: - $ref: '#/components/schemas/WakuInfo' - '4XX': - description: Bad request error. - '5XX': - description: Unexpected error. - - /debug/v1/version: - get: - summary: Get node version - description: Retrieve the Waku v2 node version. - operationId: getNodeVersion - tags: - - debug - responses: - '200': - description: The version of a Waku v2 node. - content: - text/plain: - schema: - type: string - '4XX': - description: Bad request error. - '5XX': - description: Unexpected error. - -components: - schemas: - WakuInfo: - type: object - properties: - listenAddresses: - type: array - items: - type: string - enrUri: - type: string - required: - - listenAddresses diff --git a/waku/waku_api/rest/doc/adminapi.yaml b/waku/waku_api/rest/doc/adminapi.yaml new file mode 100644 index 000000000..596b540f8 --- /dev/null +++ b/waku/waku_api/rest/doc/adminapi.yaml @@ -0,0 +1,37 @@ +get: + summary: Get connected peers info + description: Retrieve information about connected peers. + operationId: getPeerInfo + tags: + - admin + responses: + '200': + description: Information about a Waku v2 node. + content: + application/json: + schema: + type: array + items: + $ref: "./schemas/apitypes.yaml#/WakuPeer" + '5XX': + description: Unexpected error. +post: + summary: Adds new peer(s) to connect with + description: Adds new peer(s) to connect with. + operationId: postPeerInfo + tags: + - admin + requestBody: + content: + application/json: + schema: + type: array + items: + type: string + responses: + '200': + description: Ok + '400': + description: Cannot connect to one or more peers. + '5XX': + description: Unexpected error. diff --git a/waku/waku_api/rest/doc/debugapi_info.yaml b/waku/waku_api/rest/doc/debugapi_info.yaml new file mode 100644 index 000000000..56d7b2467 --- /dev/null +++ b/waku/waku_api/rest/doc/debugapi_info.yaml @@ -0,0 +1,17 @@ +get: + summary: Get node info + description: Retrieve information about a Waku v2 node. + operationId: getNodeInfo + tags: + - debug + responses: + '200': + description: Information about a Waku v2 node. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/WakuInfo' + '4XX': + description: Bad request error. + '5XX': + description: Unexpected error. diff --git a/waku/waku_api/rest/doc/debugapi_version.yaml b/waku/waku_api/rest/doc/debugapi_version.yaml new file mode 100644 index 000000000..85e06d520 --- /dev/null +++ b/waku/waku_api/rest/doc/debugapi_version.yaml @@ -0,0 +1,18 @@ +get: + summary: Get node version + description: Retrieve the Waku v2 node version. + operationId: getNodeVersion + tags: + - debug + responses: + '200': + description: The version of a Waku v2 node. + content: + text/plain: + schema: + type: string + '4XX': + description: Bad request error. + '5XX': + description: Unexpected error. + diff --git a/waku/waku_api/rest/doc/filterapi_v1_messages.yaml b/waku/waku_api/rest/doc/filterapi_v1_messages.yaml new file mode 100644 index 000000000..2af80d30c --- /dev/null +++ b/waku/waku_api/rest/doc/filterapi_v1_messages.yaml @@ -0,0 +1,41 @@ +# Legacy support for v1 waku filter +# /filter/v1/messages/{contentTopic}: +get: # get_waku_v2_filter_v1_messages + summary: Get the latest messages on the polled content topic + description: Get a list of messages that were received on a subscribed content topic after the last time this method was called. + operationId: getMessagesByTopic + tags: + - filter_legacy + parameters: + - in: path + name: contentTopic # Note the name is the same as in the path + required: true + schema: + type: string + description: Content topic of message + responses: + '200': + description: The latest messages on the polled topic. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterGetMessagesResponse' + # TODO: Review the possible errors of this endpoint + '400': + description: Bad request. + content: + text/plain: + schema: + type: string + '404': + description: Not found. + content: + text/plain: + schema: + type: string + '5XX': + description: Unexpected error. + content: + text/plain: + schema: + type: string diff --git a/waku/waku_api/rest/doc/filterapi_v1_subscriptions.yaml b/waku/waku_api/rest/doc/filterapi_v1_subscriptions.yaml new file mode 100644 index 000000000..4a946e2f5 --- /dev/null +++ b/waku/waku_api/rest/doc/filterapi_v1_subscriptions.yaml @@ -0,0 +1,71 @@ +# Legacy support for v1 waku filter +# /filter/v1/subscriptions: +post: # post_waku_v2_filter_v1_subscription + summary: Subscribe a node to an array of topics + description: Subscribe a node to an array of content topics. + operationId: postSubscriptions + tags: + - filter_legacy + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterLegacySubscribeRequest' + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + # TODO: Review the possible errors of this endpoint + '400': + description: Bad request. + content: + text/plain: + schema: + type: string + '5XX': + description: Unexpected error. + content: + text/plain: + schema: + type: string + +delete: # delete_waku_v2_filter_v1_subscription + summary: Unsubscribe a node from an array of topics + description: Unsubscribe a node from an array of content topics. + operationId: deleteSubscriptions + tags: + - filter + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterLegacySubscribeRequest' + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + # TODO: Review the possible errors of this endpoint + '400': + description: Bad request. + content: + text/plain: + schema: + type: string + '404': + description: Not found. + content: + text/plain: + schema: + type: string + '5XX': + description: Unexpected error. + content: + text/plain: + schema: + type: string diff --git a/waku/waku_api/rest/doc/filterapi_v2_messages.yaml b/waku/waku_api/rest/doc/filterapi_v2_messages.yaml new file mode 100644 index 000000000..59dea606e --- /dev/null +++ b/waku/waku_api/rest/doc/filterapi_v2_messages.yaml @@ -0,0 +1,40 @@ +# /filter/v2/messages/{contentTopic}: +get: # get_waku_v2_filter_v2_messages + summary: Get the latest messages on the polled content topic + description: Get a list of messages that were received on a subscribed content topic after the last time this method was called. + operationId: getMessagesByTopic + tags: + - filter + parameters: + - in: path + name: contentTopic # Note the name is the same as in the path + required: true + schema: + type: string + description: Content topic of message + responses: + '200': + description: The latest messages on the polled topic. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterGetMessagesResponse' + # TODO: Review the possible errors of this endpoint + '400': + description: Bad request. + content: + text/plain: + schema: + type: string + '404': + description: Not found. + content: + text/plain: + schema: + type: string + '5XX': + description: Unexpected error. + content: + text/plain: + schema: + type: string diff --git a/waku/waku_api/rest/doc/filterapi_v2_subscription_ping.yaml b/waku/waku_api/rest/doc/filterapi_v2_subscription_ping.yaml new file mode 100644 index 000000000..153de793d --- /dev/null +++ b/waku/waku_api/rest/doc/filterapi_v2_subscription_ping.yaml @@ -0,0 +1,42 @@ +# /filter/v2/subscriptions/{requestId}: +get: # get_waku_v2_filter_v2_subscription - ping + summary: Subscriber-ping - a peer can query if there is a registered subscription for it + description: | + Subscriber peer can query its subscription existence on service node. + Returns HTTP200 if exists and HTTP404 if not. + Client must not fill anything but requestId in the request body. + operationId: subscriberPing + tags: + - filter + parameters: + - in: path + name: requestId + required: true + schema: + type: string + description: Id of ping request + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '400': + description: Bad request. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '404': + description: Not found. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '5XX': + description: Unexpected error. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' diff --git a/waku/waku_api/rest/doc/filterapi_v2_subscriptions.yaml b/waku/waku_api/rest/doc/filterapi_v2_subscriptions.yaml new file mode 100644 index 000000000..500387cae --- /dev/null +++ b/waku/waku_api/rest/doc/filterapi_v2_subscriptions.yaml @@ -0,0 +1,126 @@ +# /filter/v2/subscriptions: +post: # post_waku_v2_filter_v2_subscription + summary: Subscribe a peer to an array of content topics under a pubsubTopic + description: | + Subscribe a peer to an array of content topics under a pubsubTopic. + + It is allowed to refresh or add new content topic to an existing subscription. + + Fields pubsubTopic and contentFilters must be filled. + operationId: postSubscriptions + tags: + - filter + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscribeRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + # TODO: Review the possible errors of this endpoint + '400': + description: Bad request. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '404': + description: Not found. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '5XX': + description: Unexpected error. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + +put: # put_waku_v2_filter_v2_subscription + summary: Modify existing subscription of a peer under a pubsubTopic + description: | + Modify existing subscription of a peer under a pubsubTopic. + + It is allowed to refresh or add new content topic to an existing subscription. + + Fields pubsubTopic and contentFilters must be filled. + operationId: putSubscriptions + tags: + - filter + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscribeRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + # TODO: Review the possible errors of this endpoint + '400': + description: Bad request. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '404': + description: Not found. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '5XX': + description: Unexpected error. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + + +delete: # delete_waku_v2_filter_v2_subscription + summary: Unsubscribe a peer from content topics + description: | + Unsubscribe a peer from content topics + Only that subscription will be removed which matches existing. + operationId: deleteSubscriptions + tags: + - filter + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterUnsubscribeRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '400': + description: Bad request. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '404': + description: Not found. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '5XX': + description: Unexpected error. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' diff --git a/waku/waku_api/rest/doc/filterapi_v2_subscriptions_all.yaml b/waku/waku_api/rest/doc/filterapi_v2_subscriptions_all.yaml new file mode 100644 index 000000000..6c5dc8986 --- /dev/null +++ b/waku/waku_api/rest/doc/filterapi_v2_subscriptions_all.yaml @@ -0,0 +1,38 @@ +# /filter/v2/subscriptions/all: +delete: # delete_waku_v2_filter_v2_subscription + summary: Unsubscribe a peer from all content topics + description: | + Unsubscribe a peer from all content topics + operationId: deleteAllSubscriptions + tags: + - filter + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterUnsubscribeAllRequest' + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '400': + description: Bad request. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '404': + description: Not found. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' + '5XX': + description: Unexpected error. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/FilterSubscriptionResponse' diff --git a/waku/waku_api/rest/doc/healthapi.yaml b/waku/waku_api/rest/doc/healthapi.yaml new file mode 100644 index 000000000..6bd54000b --- /dev/null +++ b/waku/waku_api/rest/doc/healthapi.yaml @@ -0,0 +1,27 @@ +get: + summary: Get node health status + description: Retrieve readiness of a Waku v2 node. + operationId: healthcheck + tags: + - health + responses: + '200': + description: Waku v2 node is up and running. + content: + text/plain: + schema: + type: string + example: Node is healty + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + '503': + description: Node not initialized or having issues + content: + text/plain: + schema: + type: string + example: Node is not initialized diff --git a/waku/waku_api/rest/doc/lightpushapi.yaml b/waku/waku_api/rest/doc/lightpushapi.yaml new file mode 100644 index 000000000..6fc35241a --- /dev/null +++ b/waku/waku_api/rest/doc/lightpushapi.yaml @@ -0,0 +1,36 @@ +post: + summary: Request a message relay from a LightPush service provider + description: Push a message to be relayed on a PubSub topic. + operationId: postMessagesToPubsubTopic + tags: + - lightpush + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/PushRequest' + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + '400': + description: Bad request. + content: + text/plain: + schema: + type: string + '500': + description: Internal server error + content: + text/plain: + schema: + type: string + '503': + description: Service not available + content: + text/plain: + schema: + type: string diff --git a/waku/waku_api/rest/doc/openapi.yaml b/waku/waku_api/rest/doc/openapi.yaml new file mode 100644 index 000000000..077462de1 --- /dev/null +++ b/waku/waku_api/rest/doc/openapi.yaml @@ -0,0 +1,66 @@ +openapi: 3.0.3 +info: + title: Waku V2 node REST API + version: 1.0.0 + description: + contact: + name: VAC Team + url: https://forum.vac.dev/ + servers: + - url: http://localhost:8545 + description: Accessing your wakunode via API is possible normally via localhost on defaul port 8545. +tags: + - name: admin + description: Control of the connected peers. + - name: debug + description: Information about a Waku v2 node. + - name: health + description: Health check of a Waku v2 node. + - name: lightpush + description: Interface to request a message relay. See [19/WAKU2-LIGHTPUSH](https://rfc.vac.dev/spec/19/) RFC + - name: relay + description: Control of the relaying of messages. See [11/WAKU2-RELAY](https://rfc.vac.dev/spec/11/) RFC + - name: store + description: Retrieve the message history. See [13/WAKU2-STORE](https://rfc.vac.dev/spec/13/) RFC + - name: filter + description: Control of the content filtering. See [12/WAKU2-FILTER](https://rfc.vac.dev/spec/12/) RFC + - name: filter_legacy + description: Obsolate Filter interface kept for compatibility reason. Will be removed in future. +paths: + /admin/v1/peers: + $ref: "./adminapi.yaml" + /debug/v1/info: + $ref: "./debugapi_info.yaml" + /debug/v1/version: + $ref: "./debugapi_version.yaml" + /health: + $ref: "./healthapi.yaml" + /lightpush/v1/message: + $ref: "./lightpushapi.yaml" + /relay/v1/messages/{pubsubTopic}: + $ref: "./relayapi_messages.yaml" + /relay/v1/subscriptions: + $ref: "./relayapi_subscriptions.yaml" + /relay/v1/auto/messages/{contentTopic}: + $ref: "./relayapi_auto_content_topic.yaml" + /relay/v1/auto/messages: + $ref: "./relayapi_auto_messages.yaml" + /relay/v1/auto/subscriptions: + $ref: "./relayapi_auto_subscriptions.yaml" + /store/v1/messages: + $ref: "./storeapi.yaml" + /filter/v1/subscriptions: + $ref: "./filterapi_v1_subscriptions.yaml" + /filter/v1/messages/{contentTopic}: + $ref: "./filterapi_v1_messages.yaml" + /filter/v2/subscriptions/{requestId}: + $ref: "./filterapi_v2_subscription_ping.yaml" + /filter/v2/subscriptions: + $ref: "./filterapi_v2_subscriptions.yaml" + /filter/v2/subscriptions/all: + $ref: "./filterapi_v2_subscriptions_all.yaml" + /filter/v2/messages/{contentTopic}: + $ref: "./filterapi_v2_messages.yaml" +components: + schemas: + $ref: "./schemas/apitypes.yaml" diff --git a/waku/waku_api/rest/doc/relayapi_auto_content_topic.yaml b/waku/waku_api/rest/doc/relayapi_auto_content_topic.yaml new file mode 100644 index 000000000..8cb06f02b --- /dev/null +++ b/waku/waku_api/rest/doc/relayapi_auto_content_topic.yaml @@ -0,0 +1,25 @@ +# /relay/v1/auto/messages/{contentTopic}: # Note the plural in messages +get: # get_waku_v2_relay_v1_auto_messages + summary: Get the latest messages on the polled topic + description: Get a list of messages that were received on a subscribed Content topic after the last time this method was called. + operationId: getMessagesByTopic + tags: + - relay + parameters: + - in: path + name: contentTopic # Note the name is the same as in the path + required: true + schema: + type: string + description: The user ID + responses: + '200': + description: The latest messages on the polled topic. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/RelayGetMessagesResponse' + '4XX': + description: Bad request. + '5XX': + description: Unexpected error. diff --git a/waku/waku_api/rest/doc/relayapi_auto_messages.yaml b/waku/waku_api/rest/doc/relayapi_auto_messages.yaml new file mode 100644 index 000000000..741009cd6 --- /dev/null +++ b/waku/waku_api/rest/doc/relayapi_auto_messages.yaml @@ -0,0 +1,19 @@ +# /relay/v1/auto/messages: # Note the plural in messages +post: # post_waku_v2_relay_v1_auto_message + summary: Publish a message to be relayed + description: Publishes a message to be relayed on a Content topic. + operationId: postMessagesToTopic + tags: + - relay + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/RelayPostMessagesRequest' + responses: + '200': + description: OK + '4XX': + description: Bad request. + '5XX': + description: Unexpected error. diff --git a/waku/waku_api/rest/doc/relayapi_auto_subscriptions.yaml b/waku/waku_api/rest/doc/relayapi_auto_subscriptions.yaml new file mode 100644 index 000000000..74504c6a0 --- /dev/null +++ b/waku/waku_api/rest/doc/relayapi_auto_subscriptions.yaml @@ -0,0 +1,50 @@ +# /relay/v1/auto/subscriptions: +post: # post_waku_v2_relay_v1_auto_subscriptions + summary: Subscribe a node to an array of topics + description: Subscribe a node to an array of Content topics. + operationId: postSubscriptions + tags: + - relay + requestBody: + content: + application/json: + schema: + type array: + items: + $ref: './schemas/apitypes.yaml#/ContentTopic' + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + '4XX': + description: Bad request. + '5XX': + description: Unexpected error. + +delete: # delete_waku_v2_relay_v1_auto_subscriptions + summary: Unsubscribe a node from an array of topics + description: Unsubscribe a node from an array of Content topics. + operationId: deleteSubscriptions + tags: + - relay + requestBody: + content: + application/json: + schema: + type array: + items: + $ref: './schemas/apitypes.yaml#/ContentTopic' + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + '4XX': + description: Bad request. + '5XX': + description: Unexpected error. diff --git a/waku/waku_api/rest/doc/relayapi_messages.yaml b/waku/waku_api/rest/doc/relayapi_messages.yaml new file mode 100644 index 000000000..898a1dacd --- /dev/null +++ b/waku/waku_api/rest/doc/relayapi_messages.yaml @@ -0,0 +1,51 @@ +# /relay/v1/messages/{pubsubTopic}: # Note the plural in messages +get: # get_waku_v2_relay_v1_messages + summary: Get the latest messages on the polled topic + description: Get a list of messages that were received on a subscribed PubSub topic after the last time this method was called. + operationId: getMessagesByTopic + tags: + - relay + parameters: + - in: path + name: pubsubTopic # Note the name is the same as in the path + required: true + schema: + type: string + description: The user ID + responses: + '200': + description: The latest messages on the polled topic. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/RelayGetMessagesResponse' + '4XX': + description: Bad request. + '5XX': + description: Unexpected error. + +post: # post_waku_v2_relay_v1_message + summary: Publish a message to be relayed + description: Publishes a message to be relayed on a PubSub topic. + operationId: postMessagesToTopic + tags: + - relay + parameters: + - in: path + name: pubsubTopic # Note the name is the same as in the path + description: The messages content topic + required: true + schema: + $ref: './schemas/apitypes.yaml#/RelayPostMessagesRequest' + requestBody: + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/RelayPostMessagesRequest' + responses: + '200': + description: OK + '4XX': + description: Bad request. + '5XX': + description: Unexpected error. diff --git a/waku/waku_api/rest/doc/relayapi_subscriptions.yaml b/waku/waku_api/rest/doc/relayapi_subscriptions.yaml new file mode 100644 index 000000000..40bc3d08e --- /dev/null +++ b/waku/waku_api/rest/doc/relayapi_subscriptions.yaml @@ -0,0 +1,50 @@ +# /relay/v1/subscriptions: +post: # post_waku_v2_relay_v1_subscriptions + summary: Subscribe a node to an array of topics + description: Subscribe a node to an array of PubSub topics. + operationId: postSubscriptions + tags: + - relay + requestBody: + content: + application/json: + schema: + type array: + items: + $ref: './schemas/apitypes.yaml#/PubsubTopic' + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + '4XX': + description: Bad request. + '5XX': + description: Unexpected error. + +delete: # delete_waku_v2_relay_v1_subscriptions + summary: Unsubscribe a node from an array of topics + description: Unsubscribe a node from an array of PubSub topics. + operationId: deleteSubscriptions + tags: + - relay + requestBody: + content: + application/json: + schema: + type array: + items: + $ref: './schemas/apitypes.yaml#/PubsubTopic' + responses: + '200': + description: OK + content: + text/plain: + schema: + type: string + '4XX': + description: Bad request. + '5XX': + description: Unexpected error. diff --git a/waku/waku_api/rest/doc/schemas/apitypes.yaml b/waku/waku_api/rest/doc/schemas/apitypes.yaml new file mode 100644 index 000000000..d5c0657a6 --- /dev/null +++ b/waku/waku_api/rest/doc/schemas/apitypes.yaml @@ -0,0 +1,189 @@ +WakuPeer: + type: object + required: + - multiaddr + - protocols + properties: + multiaddr: + type: string + protocols: + type: array + items: + type: object + required: + - protocol + - connected + properties: + protocol: + type: string + connected: + type: boolean + +WakuInfo: + type: object + properties: + listenAddresses: + type: array + items: + type: string + enrUri: + type: string + required: + - listenAddresses + +PubsubTopic: + type: string +ContentTopic: + type: string + +FilterLegacySubscribeRequest: + type: object + properties: + contentFilters: + type: array + items: + $ref: '#/ContentTopic' + pubsubTopic: + $ref: "#/PubsubTopic" + required: + - contentFilters + +FilterGetMessagesResponse: + type: array + items: + $ref: '#/WakuMessage' + +FilterSubscribeRequest: + type: object + properties: + requestId: + type: string + contentFilters: + type: array + items: + $ref: '#/ContentTopic' + pubsubTopic: + $ref: "#/PubsubTopic" + required: + - requestId + - contentFilters + - pubsubTopic + +FilterUnsubscribeRequest: + type: object + properties: + requestId: + type: string + contentFilters: + type: array + items: + $ref: '#/ContentTopic' + pubsubTopic: + $ref: "#/PubsubTopic" + required: + - requestId + - contentFilters + +FilterUnsubscribeAllRequest: + type: object + properties: + requestId: + type: string + required: + - requestId + +FilterSubscriptionResponse: + type: object + properties: + requestId: + type: string + statusDesc: + type: string + required: + - requestId + +WakuMessage: + type: object + properties: + payload: + type: string + format: byte + contentTopic: + $ref: '#/ContentTopic' + version: + type: integer + format: int32 + timestamp: + type: integer + format: int64 + ephemeral: + type: boolean + required: + - payload + - contentTopic + +PushRequest: + type: object + properties: + pusbsubTopic: + $ref: '#/PubsubTopic' + message: + $ref: '#/WakuMessage' + required: + - message + +## TODO: Check if it can be tunneled into the one WakuMessage structure +## mainly because of Relay post message request can break in client code +RelayWakuMessage: + type: object + properties: + payload: + type: string + format: byte + contentTopic: + $ref: '#/ContentTopic' + version: + type: number + timestamp: + type: number + required: + - payload + +RelayGetMessagesResponse: + type: array + items: + $ref: '#/RelayWakuMessage' + +RelayPostMessagesRequest: + $ref: '#/RelayWakuMessage' + +StoreResponse: + type: object + properties: + messages: + type: array + items: + $ref: '#/WakuMessage' + cursor: + $ref: '#/HistoryCursor' + error_message: + type: string + required: + - messages + +HistoryCursor: + type: object + properties: + pubsub_topic: + type: string + sender_time: + type: string + store_time: + type: string + digest: + type: string + required: + - pubsub_topic + - sender_time + - store_time + - digest diff --git a/waku/waku_api/rest/doc/storeapi.yaml b/waku/waku_api/rest/doc/storeapi.yaml new file mode 100644 index 000000000..42dd2276c --- /dev/null +++ b/waku/waku_api/rest/doc/storeapi.yaml @@ -0,0 +1,138 @@ +# /store/v1/messages: +get: + summary: Gets message history + description: > + Retrieves WakuV2 message history. The returned history + can be potentially filtered by optional request parameters. + operationId: getMessageHistory + tags: + - store + parameters: + - name: peerAddr + in: query + schema: + type: string + required: true + description: > + P2P fully qualified peer multiaddress + in the format `(ip4|ip6)/tcp/p2p/$peerId` and URL-encoded. + example: '%2Fip4%2F127.0.0.1%2Ftcp%2F60001%2Fp2p%2F16Uiu2HAmVFXtAfSj4EiR7mL2KvL4EE2wztuQgUSBoj2Jx2KeXFLN' + + - name: pubsubTopic + in: query + schema: + type: string + description: > + The pubsub topic on which a WakuMessage is published. + If left empty, no filtering is applied. + It is also intended for pagination purposes. + It should be a URL-encoded string. + example: 'my%20pubsub%20topic' + + - name: contentTopics + in: query + schema: string + description: > + Comma-separated list of content topics. When specified, + only WakuMessages that are linked to any of the given + content topics will be delivered in the get response. + It should be a URL-encoded-comma-separated string. + example: 'my%20first%20content%20topic%2Cmy%20second%20content%20topic%2Cmy%20third%20content%20topic' + + - name: startTime + in: query + schema: + type: string + description: > + The inclusive lower bound on the timestamp of + queried WakuMessages. This field holds the + Unix epoch time in nanoseconds as a 64-bits + integer value. + example: '1680590945000000000' + + - name: endTime + in: query + schema: + type: string + description: > + The inclusive upper bound on the timestamp of + queried WakuMessages. This field holds the + Unix epoch time in nanoseconds as a 64-bits + integer value. + example: '1680590945000000000' + + - name: senderTime + in: query + schema: + type: string + description: > + Cursor field intended for pagination purposes. + Represents the Unix time in nanoseconds at which a message was generated. + It could be empty for retrieving the first page, + and will be returned from the GET response so that + it can be part of the next page request. + example: '1680590947000000000' + + - name: storeTime + in: query + schema: + type: string + description: > + Cursor field intended for pagination purposes. + Represents the Unix time in nanoseconds at which a message was stored. + It could be empty for retrieving the first page, + and will be returned from the GET response so that + it can be part of the next page request. + example: '1680590945000000000' + + - name: digest + in: query + schema: + type: string + description: > + Cursor field intended for pagination purposes. + URL-base64-encoded string computed as a hash of the + a message content topic plus a message payload. + It could be empty for retrieving the first page, + and will be returned from the GET response so that + it can be part of the next page request. + example: 'Gc4ACThW5t2QQO82huq3WnDv%2FapPPJpD%2FwJfxDxAnR0%3D' + + - name: pageSize + in: query + schema: + type: string + description: > + Number of messages to retrieve per page + example: '5' + + - name: ascending + in: query + schema: + type: string + description: > + "true" for paging forward, "false" for paging backward + example: "true" + + responses: + '200': + description: WakuV2 message history. + content: + application/json: + schema: + $ref: './schemas/apitypes.yaml#/StoreResponse' + '400': + description: Bad request error. + content: + text/plain: + type: string + '412': + description: Precondition failed. + content: + text/plain: + type: string + '500': + description: Internal server error. + content: + text/plain: + type: string diff --git a/waku/waku_api/rest/filter/openapi.yaml b/waku/waku_api/rest/filter/openapi.yaml deleted file mode 100644 index 49ee6d967..000000000 --- a/waku/waku_api/rest/filter/openapi.yaml +++ /dev/null @@ -1,462 +0,0 @@ -openapi: 3.0.3 -info: - title: Waku V2 node REST API - version: 1.0.0 - contact: - name: VAC Team - url: https://forum.vac.dev/ -tags: - - name: filter - description: Filter REST API for WakuV2 node - -paths: - # Legacy support for v1 waku filter - # TODO: legacy endpoint, remove in the future - /filter/v1/subscriptions: - post: # post_waku_v2_filter_v1_subscription - summary: Subscribe a node to an array of topics - description: Subscribe a node to an array of content topics. - operationId: postSubscriptions - tags: - - filter - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FilterLegacySubscribeRequest' - responses: - '200': - description: OK - content: - text/plain: - schema: - type: string - # TODO: Review the possible errors of this endpoint - '400': - description: Bad request. - content: - text/plain: - schema: - type: string - '5XX': - description: Unexpected error. - content: - text/plain: - schema: - type: string - - delete: # delete_waku_v2_filter_v1_subscription - summary: Unsubscribe a node from an array of topics - description: Unsubscribe a node from an array of content topics. - operationId: deleteSubscriptions - tags: - - filter - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FilterLegacySubscribeRequest' - responses: - '200': - description: OK - content: - text/plain: - schema: - type: string - # TODO: Review the possible errors of this endpoint - '400': - description: Bad request. - content: - text/plain: - schema: - type: string - '404': - description: Not found. - content: - text/plain: - schema: - type: string - '5XX': - description: Unexpected error. - content: - text/plain: - schema: - type: string - - # TODO: legacy endpoint, remove in the future - /filter/v1/messages/{contentTopic}: - get: # get_waku_v2_filter_v1_messages - summary: Get the latest messages on the polled content topic - description: Get a list of messages that were received on a subscribed content topic after the last time this method was called. - operationId: getMessagesByTopic - tags: - - filter - parameters: - - in: path - name: contentTopic # Note the name is the same as in the path - required: true - schema: - type: string - description: Content topic of message - responses: - '200': - description: The latest messages on the polled topic. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterGetMessagesResponse' - # TODO: Review the possible errors of this endpoint - '400': - description: Bad request. - content: - text/plain: - schema: - type: string - '404': - description: Not found. - content: - text/plain: - schema: - type: string - '5XX': - description: Unexpected error. - content: - text/plain: - schema: - type: string - - /filter/v2/subscriptions/{requestId}: - get: # get_waku_v2_filter_v2_subscription - ping - summary: Subscriber-ping - a peer can query if there is a registered subscription for it - description: | - Subscriber peer can query its subscription existence on service node. - Returns HTTP200 if exists and HTTP404 if not. - Client must not fill anything but requestId in the request body. - operationId: subscriberPing - tags: - - filter - parameters: - - in: path - name: requestId - required: true - schema: - type: string - description: Id of ping request - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '400': - description: Bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '404': - description: Not found. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '5XX': - description: Unexpected error. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - - /filter/v2/subscriptions: - post: # post_waku_v2_filter_v2_subscription - summary: Subscribe a peer to an array of content topics under a pubsubTopic - description: | - Subscribe a peer to an array of content topics under a pubsubTopic. - - It is allowed to refresh or add new content topic to an existing subscription. - - Fields pubsubTopic and contentFilters must be filled. - operationId: postSubscriptions - tags: - - filter - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscribeRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - # TODO: Review the possible errors of this endpoint - '400': - description: Bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '404': - description: Not found. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '5XX': - description: Unexpected error. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - - put: # put_waku_v2_filter_v2_subscription - summary: Modify existing subscription of a peer under a pubsubTopic - description: | - Modify existing subscription of a peer under a pubsubTopic. - - It is allowed to refresh or add new content topic to an existing subscription. - - Fields pubsubTopic and contentFilters must be filled. - operationId: putSubscriptions - tags: - - filter - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscribeRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - # TODO: Review the possible errors of this endpoint - '400': - description: Bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '404': - description: Not found. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '5XX': - description: Unexpected error. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - - - delete: # delete_waku_v2_filter_v2_subscription - summary: Unsubscribe a peer from content topics - description: | - Unsubscribe a peer from content topics - Only that subscription will be removed which matches existing. - operationId: deleteSubscriptions - tags: - - filter - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FilterUnsubscribeRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '400': - description: Bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '404': - description: Not found. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '5XX': - description: Unexpected error. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - /filter/v2/subscriptions/all: - delete: # delete_waku_v2_filter_v2_subscription - summary: Unsubscribe a peer from all content topics - description: | - Unsubscribe a peer from all content topics - operationId: deleteAllSubscriptions - tags: - - filter - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FilterUnsubscribeAllRequest' - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '400': - description: Bad request. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '404': - description: Not found. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - '5XX': - description: Unexpected error. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterSubscriptionResponse' - /filter/v2/messages/{contentTopic}: - get: # get_waku_v2_filter_v2_messages - summary: Get the latest messages on the polled content topic - description: Get a list of messages that were received on a subscribed content topic after the last time this method was called. - operationId: getMessagesByTopic - tags: - - filter - parameters: - - in: path - name: contentTopic # Note the name is the same as in the path - required: true - schema: - type: string - description: Content topic of message - responses: - '200': - description: The latest messages on the polled topic. - content: - application/json: - schema: - $ref: '#/components/schemas/FilterGetMessagesResponse' - # TODO: Review the possible errors of this endpoint - '400': - description: Bad request. - content: - text/plain: - schema: - type: string - '404': - description: Not found. - content: - text/plain: - schema: - type: string - '5XX': - description: Unexpected error. - content: - text/plain: - schema: - type: string - -components: - schemas: - PubSubTopic: - type: string - ContentTopic: - type: string - - FilterWakuMessage: - type: object - properties: - payload: - type: string - format: byte - contentTopic: - $ref: '#/components/schemas/ContentTopic' - version: - type: number - timestamp: - type: number - required: - - payload - - FilterLegacySubscribeRequest: - type: object - properties: - contentFilters: - type: array - items: - $ref: '#/components/schemas/ContentTopic' - pubsubTopic: - $ref: "#/components/schemas/PubSubTopic" - required: - - contentFilters - - FilterGetMessagesResponse: - type: array - items: - $ref: '#/components/schemas/FilterWakuMessage' - - FilterSubscribeRequest: - type: object - properties: - requestId: - type: string - contentFilters: - type: array - items: - $ref: '#/components/schemas/ContentTopic' - pubsubTopic: - $ref: "#/components/schemas/PubSubTopic" - required: - - requestId - - contentFilters - - pubsubTopic - - FilterUnsubscribeRequest: - type: object - properties: - requestId: - type: string - contentFilters: - type: array - items: - $ref: '#/components/schemas/ContentTopic' - pubsubTopic: - $ref: "#/components/schemas/PubSubTopic" - required: - - requestId - - contentFilters - - FilterUnsubscribeAllRequest: - type: object - properties: - requestId: - type: string - required: - - requestId - - FilterSubscriptionResponse: - type: object - properties: - requestId: - type: string - statusDesc: - type: string - required: - - requestId diff --git a/waku/waku_api/rest/health/openapi.yaml b/waku/waku_api/rest/health/openapi.yaml deleted file mode 100644 index f433800c2..000000000 --- a/waku/waku_api/rest/health/openapi.yaml +++ /dev/null @@ -1,41 +0,0 @@ -openapi: 3.0.3 -info: - title: Waku V2 node REST API - version: 1.0.0 - contact: - name: VAC Team - url: https://forum.vac.dev/ - -tags: - - name: health - description: Healt check REST API for WakuV2 node - -paths: - /health: - get: - summary: Get node health status - description: Retrieve readiness of a Waku v2 node. - operationId: healthcheck - tags: - - health - responses: - '200': - description: Waku v2 node is up and running. - content: - text/plain: - schema: - type: string - example: Node is healty - '500': - description: Internal server error - content: - text/plain: - schema: - type: string - '503': - description: Node not initialized or having issues - content: - text/plain: - schema: - type: string - example: Node is not initialized diff --git a/waku/waku_api/rest/lightpush/openapi.yaml b/waku/waku_api/rest/lightpush/openapi.yaml deleted file mode 100644 index 2327936dd..000000000 --- a/waku/waku_api/rest/lightpush/openapi.yaml +++ /dev/null @@ -1,84 +0,0 @@ -openapi: 3.0.3 -info: - title: Waku V2 node REST API - version: 1.0.0 - contact: - name: VAC Team - url: https://forum.vac.dev/ - -tags: - - name: lightpush - description: Lightpush REST API for WakuV2 node - -paths: - /lightpush/v1/message: - post: - summary: Request a message relay from a LightPush service provider - description: Push a message to be relayed on a PubSub topic. - operationId: postMessagesToPubsubTopic - tags: - - lightpush - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PushRequest' - responses: - '200': - description: OK - content: - text/plain: - schema: - type: string - '400': - description: Bad request. - content: - text/plain: - schema: - type: string - '500': - description: Internal server error - content: - text/plain: - schema: - type: string - '503': - description: Service not available - content: - text/plain: - schema: - type: string - -components: - schemas: - PubsubTopic: - type: string - - ContentTopic: - type: string - - WakuMessage: - type: object - properties: - payload: - type: string - format: byte - contentTopic: - $ref: '#/components/schemas/ContentTopic' - version: - type: number - timestamp: - type: number - required: - - payload - - contentTopic - - PushRequest: - type: object - properties: - pusbsubTopic: - $ref: '#/components/schemas/PubsubTopic' - message: - $ref: '#/components/schemas/WakuMessage' - required: - - message diff --git a/waku/waku_api/rest/relay/openapi.yaml b/waku/waku_api/rest/relay/openapi.yaml deleted file mode 100644 index 9e20653ad..000000000 --- a/waku/waku_api/rest/relay/openapi.yaml +++ /dev/null @@ -1,244 +0,0 @@ -openapi: 3.0.3 -info: - title: Waku V2 node REST API - version: 1.0.0 - contact: - name: VAC Team - url: https://forum.vac.dev/ - -tags: - - name: relay - description: Relay REST API for WakuV2 node - -paths: - /relay/v1/messages/{pubsubTopic}: # Note the plural in messages - get: # get_waku_v2_relay_v1_messages - summary: Get the latest messages on the polled topic - description: Get a list of messages that were received on a subscribed PubSub topic after the last time this method was called. - operationId: getMessagesByTopic - tags: - - relay - parameters: - - in: path - name: pubsubTopic # Note the name is the same as in the path - required: true - schema: - type: string - description: The user ID - responses: - '200': - description: The latest messages on the polled topic. - content: - application/json: - schema: - $ref: '#/components/schemas/RelayGetMessagesResponse' - '4XX': - description: Bad request. - '5XX': - description: Unexpected error. - - post: # post_waku_v2_relay_v1_message - summary: Publish a message to be relayed - description: Publishes a message to be relayed on a PubSub topic. - operationId: postMessagesToTopic - tags: - - relay - parameters: - - in: path - name: pubsubTopic # Note the name is the same as in the path - description: The messages content topic - required: true - schema: - $ref: '#/components/schemas/RelayPostMessagesRequest' - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RelayPostMessagesRequest' - responses: - '200': - description: OK - '4XX': - description: Bad request. - '5XX': - description: Unexpected error. - - /relay/v1/subscriptions: - post: # post_waku_v2_relay_v1_subscriptions - summary: Subscribe a node to an array of topics - description: Subscribe a node to an array of PubSub topics. - operationId: postSubscriptions - tags: - - relay - requestBody: - content: - application/json: - schema: - type array: - items: - $ref: '#/components/schemas/PubsubTopic' - responses: - '200': - description: OK - content: - text/plain: - schema: - type: string - '4XX': - description: Bad request. - '5XX': - description: Unexpected error. - - delete: # delete_waku_v2_relay_v1_subscriptions - summary: Unsubscribe a node from an array of topics - description: Unsubscribe a node from an array of PubSub topics. - operationId: deleteSubscriptions - tags: - - relay - requestBody: - content: - application/json: - schema: - type array: - items: - $ref: '#/components/schemas/PubsubTopic' - responses: - '200': - description: OK - content: - text/plain: - schema: - type: string - '4XX': - description: Bad request. - '5XX': - description: Unexpected error. - - /relay/v1/auto/messages/{contentTopic}: # Note the plural in messages - get: # get_waku_v2_relay_v1_auto_messages - summary: Get the latest messages on the polled topic - description: Get a list of messages that were received on a subscribed Content topic after the last time this method was called. - operationId: getMessagesByTopic - tags: - - relay - parameters: - - in: path - name: contentTopic # Note the name is the same as in the path - required: true - schema: - type: string - description: The user ID - responses: - '200': - description: The latest messages on the polled topic. - content: - application/json: - schema: - $ref: '#/components/schemas/RelayGetMessagesResponse' - '4XX': - description: Bad request. - '5XX': - description: Unexpected error. - - /relay/v1/auto/messages: # Note the plural in messages - post: # post_waku_v2_relay_v1_auto_message - summary: Publish a message to be relayed - description: Publishes a message to be relayed on a Content topic. - operationId: postMessagesToTopic - tags: - - relay - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/RelayPostMessagesRequest' - responses: - '200': - description: OK - '4XX': - description: Bad request. - '5XX': - description: Unexpected error. - - /relay/v1/auto/subscriptions: - post: # post_waku_v2_relay_v1_auto_subscriptions - summary: Subscribe a node to an array of topics - description: Subscribe a node to an array of Content topics. - operationId: postSubscriptions - tags: - - relay - requestBody: - content: - application/json: - schema: - type array: - items: - $ref: '#/components/schemas/ContentTopic' - responses: - '200': - description: OK - content: - text/plain: - schema: - type: string - '4XX': - description: Bad request. - '5XX': - description: Unexpected error. - - delete: # delete_waku_v2_relay_v1_auto_subscriptions - summary: Unsubscribe a node from an array of topics - description: Unsubscribe a node from an array of Content topics. - operationId: deleteSubscriptions - tags: - - relay - requestBody: - content: - application/json: - schema: - type array: - items: - $ref: '#/components/schemas/ContentTopic' - responses: - '200': - description: OK - content: - text/plain: - schema: - type: string - '4XX': - description: Bad request. - '5XX': - description: Unexpected error. - - -components: - schemas: - PubSubTopic: - type: string - ContentTopic: - type: string - - RelayWakuMessage: - type: object - properties: - payload: - type: string - format: byte - contentTopic: - $ref: '#/components/schemas/ContentTopic' - version: - type: number - timestamp: - type: number - required: - - payload - - RelayGetMessagesResponse: - type: array - items: - $ref: '#/components/schemas/RelayWakuMessage' - - RelayPostMessagesRequest: - $ref: '#/components/schemas/RelayWakuMessage' - \ No newline at end of file diff --git a/waku/waku_api/rest/store/openapi.yaml b/waku/waku_api/rest/store/openapi.yaml deleted file mode 100644 index cbd653ca3..000000000 --- a/waku/waku_api/rest/store/openapi.yaml +++ /dev/null @@ -1,203 +0,0 @@ -openapi: 3.0.3 -info: - title: Waku V2 node REST API - version: 1.0.0 - contact: - name: VAC Team - url: https://forum.vac.dev/ - -tags: - - name: store - description: Store REST API for WakuV2 node - -paths: - /store/v1/messages: - get: - summary: Gets message history - description: > - Retrieves WakuV2 message history. The returned history - can be potentially filtered by optional request parameters. - operationId: getMessageHistory - tags: - - store - parameters: - - name: peerAddr - in: query - schema: - type: string - required: true - description: > - P2P fully qualified peer multiaddress - in the format `(ip4|ip6)/tcp/p2p/$peerId` and URL-encoded. - example: '%2Fip4%2F127.0.0.1%2Ftcp%2F60001%2Fp2p%2F16Uiu2HAmVFXtAfSj4EiR7mL2KvL4EE2wztuQgUSBoj2Jx2KeXFLN' - - - name: pubsubTopic - in: query - schema: - type: string - description: > - The pubsub topic on which a WakuMessage is published. - If left empty, no filtering is applied. - It is also intended for pagination purposes. - It should be a URL-encoded string. - example: 'my%20pubsub%20topic' - - - name: contentTopics - in: query - schema: string - description: > - Comma-separated list of content topics. When specified, - only WakuMessages that are linked to any of the given - content topics will be delivered in the get response. - It should be a URL-encoded-comma-separated string. - example: 'my%20first%20content%20topic%2Cmy%20second%20content%20topic%2Cmy%20third%20content%20topic' - - - name: startTime - in: query - schema: - type: string - description: > - The inclusive lower bound on the timestamp of - queried WakuMessages. This field holds the - Unix epoch time in nanoseconds as a 64-bits - integer value. - example: '1680590945000000000' - - - name: endTime - in: query - schema: - type: string - description: > - The inclusive upper bound on the timestamp of - queried WakuMessages. This field holds the - Unix epoch time in nanoseconds as a 64-bits - integer value. - example: '1680590945000000000' - - - name: senderTime - in: query - schema: - type: string - description: > - Cursor field intended for pagination purposes. - Represents the Unix time in nanoseconds at which a message was generated. - It could be empty for retrieving the first page, - and will be returned from the GET response so that - it can be part of the next page request. - example: '1680590947000000000' - - - name: storeTime - in: query - schema: - type: string - description: > - Cursor field intended for pagination purposes. - Represents the Unix time in nanoseconds at which a message was stored. - It could be empty for retrieving the first page, - and will be returned from the GET response so that - it can be part of the next page request. - example: '1680590945000000000' - - - name: digest - in: query - schema: - type: string - description: > - Cursor field intended for pagination purposes. - URL-base64-encoded string computed as a hash of the - a message content topic plus a message payload. - It could be empty for retrieving the first page, - and will be returned from the GET response so that - it can be part of the next page request. - example: 'Gc4ACThW5t2QQO82huq3WnDv%2FapPPJpD%2FwJfxDxAnR0%3D' - - - name: pageSize - in: query - schema: - type: string - description: > - Number of messages to retrieve per page - example: '5' - - - name: ascending - in: query - schema: - type: string - description: > - "true" for paging forward, "false" for paging backward - example: "true" - - responses: - '200': - description: WakuV2 message history. - content: - application/json: - schema: - $ref: '#/components/schemas/StoreResponse' - '400': - description: Bad request error. - content: - text/plain: - type: string - '412': - description: Precondition failed. - content: - text/plain: - type: string - '500': - description: Internal server error. - content: - text/plain: - type: string - -components: - schemas: - StoreResponse: - type: object - properties: - messages: - type: array - items: - $ref: '#/components/schemas/WakuMessage' - cursor: - $ref: '#/components/schemas/HistoryCursor' - error_message: - type: string - required: - - messages - - HistoryCursor: - type: object - properties: - pubsub_topic: - type: string - sender_time: - type: string - store_time: - type: string - digest: - type: string - required: - - pubsub_topic - - sender_time - - store_time - - digest - - WakuMessage: - type: object - properties: - payload: - type: string - content_topic: - type: string - version: - type: integer - format: int32 - timestamp: - type: integer - format: int64 - ephemeral: - type: boolean - required: - - payload - - content_topic