Merge pull request #16 from waku-org/feat-lightpush-v3-rest-api

feat: Define lightpush v3 api
fix: store api field names
This commit is contained in:
NagyZoltanPeter 2025-03-10 09:07:47 +01:00 committed by GitHub
commit 0c3615f330
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 94 additions and 10 deletions

View File

@ -1,6 +1,6 @@
post:
summary: Request a message relay from a LightPush service provider
description: Push a message to be relayed on a PubSub topic.
summary: Request a message relay from a `Legacy` LightPush service provider
description: Push a message to be relayed on a PubSub topic. Notice this version of the /lightpush endpoint will be depricated.
operationId: postMessagesToPubsubTopic
tags:
- lightpush

View File

@ -0,0 +1,72 @@
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:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'400':
description: Bad request.
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'413':
description: Payload too large.
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'420':
description: Invalid message.
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'421':
description: Unsupported pubsub topic.
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'500':
description: Internal server error
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'429':
description: Too many requests
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'503':
description: Service not available
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'504':
description: Out of RLN proof
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'
'505':
description: No peers to relay
content:
application/json:
schema:
$ref: './schemas/apitypes.yaml#/PushResponse'

View File

@ -40,7 +40,9 @@ paths:
/health:
$ref: "./healthapi.yaml"
/lightpush/v1/message:
$ref: "./lightpushapi.yaml"
$ref: "./lightpushapi_legacy.yaml"
/lightpush/v3/message:
$ref: "./lightpushapi_v3.yaml"
/relay/v1/messages/{pubsubTopic}:
$ref: "./relayapi_messages.yaml"
/relay/v1/subscriptions:

View File

@ -145,23 +145,23 @@ WakuMessageKeyValue:
StoreQueryResponse:
type: object
properties:
request_id:
requestId:
type: string
status_code:
statusCode:
type: integer
format: uint32
status_desc:
statusDesc:
type: string
messages:
type: array
items:
$ref: '#/components/schemas/WakuMessageKeyValue'
pagination_cursor:
paginationCursor:
type: string
required:
- request_id
- status_code
- status_desc
- requestId
- statusCode
- statusDesc
- messages
PushRequest:
@ -174,6 +174,16 @@ PushRequest:
required:
- message
PushResponse:
type: object
properties:
statusDesc:
type: string
relayPeerCount:
type: integer
format: uint32
## 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: