diff --git a/specification/chats/GetChatRooms/GetChatRoomsParams.yaml b/specification/chats/GetChatRooms/GetChatRoomsParams.yaml index 4a21a04..f6f382a 100644 --- a/specification/chats/GetChatRooms/GetChatRoomsParams.yaml +++ b/specification/chats/GetChatRooms/GetChatRoomsParams.yaml @@ -1,3 +1,7 @@ +############################### +######## Path params ########## +############################### + - name: address in: path description: ADAMANT address @@ -5,3 +9,46 @@ schema: type: string example: U839357947177758191 + +############################### +####### Common filters ######## +############################### + +# senderId +- $ref: '../../common/params/filters/senderId/senderId.yaml' +- $ref: '../../common/params/filters/senderId/andSenderId.yaml' +- $ref: '../../common/params/filters/senderId/orSenderId.yaml' + +# recipientId +- $ref: '../../common/params/filters/recipientId/recipientId.yaml' +- $ref: '../../common/params/filters/recipientId/andRecipientId.yaml' +- $ref: '../../common/params/filters/recipientId/orRecipientId.yaml' + +############################### +######## Common params ######## +############################### + +# offset +- $ref: '../../common/params/offset.yaml' + +# orderBy +- $ref: '../../common/params/orderBy.yaml' + +############################### +## Endpoint specific filters ## +############################### + +# userId +- $ref: './params/filters/userId/userId.yaml' +- $ref: './params/filters/userId/andUserId.yaml' +- $ref: './params/filters/userId/orUserId.yaml' + +# withoutDirectTransfers +- $ref: './params/filters/withoutDirectTransfers/withoutDirectTransfers.yaml' + +############################### +### Endpoint specific params ## +############################### + +# limit +- $ref: './params/limit.yaml' diff --git a/specification/chats/GetChatRooms/params/filters/userId/andUserId.yaml b/specification/chats/GetChatRooms/params/filters/userId/andUserId.yaml new file mode 100644 index 0000000..768e73d --- /dev/null +++ b/specification/chats/GetChatRooms/params/filters/userId/andUserId.yaml @@ -0,0 +1,8 @@ +name: and:userId +in: query +description: | + Filter by senderId/recipientId (`and` operator). + The query will look like `tx.senderId = {userId} OR tx.recipientId = {userId}`. +schema: + type: string +required: false diff --git a/specification/chats/GetChatRooms/params/filters/userId/orUserId.yaml b/specification/chats/GetChatRooms/params/filters/userId/orUserId.yaml new file mode 100644 index 0000000..f4f1b6b --- /dev/null +++ b/specification/chats/GetChatRooms/params/filters/userId/orUserId.yaml @@ -0,0 +1,8 @@ +name: or:userId +in: query +description: | + Filter by senderId/recipientId (`or` operator). + The query will look like `tx.senderId = {userId} OR tx.recipientId = {userId}`. +schema: + type: string +required: false diff --git a/specification/chats/GetChatRooms/params/filters/userId/userId.yaml b/specification/chats/GetChatRooms/params/filters/userId/userId.yaml new file mode 100644 index 0000000..b85f940 --- /dev/null +++ b/specification/chats/GetChatRooms/params/filters/userId/userId.yaml @@ -0,0 +1,9 @@ +name: userId +in: query +description: | + Filter by senderId/recipientId. + The query will look like `tx.senderId = {userId} OR tx.recipientId = {userId}`. +schema: + type: string + example: U14236667426471084862 +required: false diff --git a/specification/chats/GetChatRooms/params/filters/withoutDirectTransfers/withoutDirectTransfers.yaml b/specification/chats/GetChatRooms/params/filters/withoutDirectTransfers/withoutDirectTransfers.yaml new file mode 100644 index 0000000..dff18b3 --- /dev/null +++ b/specification/chats/GetChatRooms/params/filters/withoutDirectTransfers/withoutDirectTransfers.yaml @@ -0,0 +1,7 @@ +name: withoutDirectTransfers +in: query +description: When set to `true`, excludes type `0` transactions (direct token transfers) from results. Default is `false`. +schema: + type: boolean + default: false +required: false diff --git a/specification/chats/GetChatRooms/params/limit.yaml b/specification/chats/GetChatRooms/params/limit.yaml new file mode 100644 index 0000000..51354de --- /dev/null +++ b/specification/chats/GetChatRooms/params/limit.yaml @@ -0,0 +1,8 @@ +name: limit +in: query +description: Limit number of transactions in the result +schema: + type: integer + example: 10 + default: 25 +required: false diff --git a/specification/common/params/filters/recipientId/recipientId.yaml b/specification/common/params/filters/recipientId/recipientId.yaml index 57244da..1f99806 100644 --- a/specification/common/params/filters/recipientId/recipientId.yaml +++ b/specification/common/params/filters/recipientId/recipientId.yaml @@ -3,5 +3,4 @@ in: query description: Filter by recipientId schema: type: string - example: U18132012621449491414 required: false diff --git a/specification/common/params/filters/senderId/senderId.yaml b/specification/common/params/filters/senderId/senderId.yaml index b75536e..866a364 100644 --- a/specification/common/params/filters/senderId/senderId.yaml +++ b/specification/common/params/filters/senderId/senderId.yaml @@ -3,5 +3,4 @@ in: query description: Filter by senderId schema: type: string - example: U14236667426471084862 required: false