Skip to content

Commit

Permalink
Add eventType to QueryListEventDelivery (#1843)
Browse files Browse the repository at this point in the history
* fix: add eventType to QueryListEventDelivery

* fix: add sort to Pageable
  • Loading branch information
danvixent authored Nov 23, 2023
1 parent 2e7f873 commit 038e4ff
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 3 deletions.
1 change: 1 addition & 0 deletions api/models/event_delivery.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ type QueryListEventDelivery struct {
EventID string `json:"eventId"`
SubscriptionID string `json:"subscriptionId"`
IdempotencyKey string `json:"idempotencyKey"`
EventType string `json:"event_type"`
// A list of event delivery statuses to filter by
Status []string `json:"status"`
SearchParams
Expand Down
6 changes: 4 additions & 2 deletions api/models/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package models
import (
"errors"
"fmt"
"net/http"
"strings"

"github.com/frain-dev/convoy/datastore"
m "github.com/frain-dev/convoy/internal/pkg/middleware"
"github.com/frain-dev/convoy/util"
"net/http"
"strings"
)

type CreateSource struct {
Expand Down Expand Up @@ -142,6 +143,7 @@ type QueryListSource struct {
}

type Pageable struct {
Sort string `json:"sort" example:"ASC | DESC"` // sort order
// The number of items to return per page
PerPage int `json:"perPage" example:"20"`
Direction datastore.PageDirection `json:"direction"`
Expand Down
52 changes: 51 additions & 1 deletion docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2023-10-30 13:16:41.281988 +0000 GMT m=+1.906100168
// 2023-11-23 16:51:06.902161 +0000 GMT m=+1.805159751
package docs

import "github.com/swaggo/swag"
Expand Down Expand Up @@ -622,6 +622,13 @@ const docTemplate = `{
"description": "The name of the endpoint",
"name": "q",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -1546,6 +1553,11 @@ const docTemplate = `{
"name": "eventId",
"in": "query"
},
{
"type": "string",
"name": "event_type",
"in": "query"
},
{
"type": "string",
"name": "idempotencyKey",
Expand All @@ -1572,6 +1584,13 @@ const docTemplate = `{
"name": "prev_page_cursor",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
},
{
"type": "string",
"example": "2006-01-02T15:04:05",
Expand Down Expand Up @@ -2464,6 +2483,13 @@ const docTemplate = `{
"name": "query",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
},
{
"type": "string",
"name": "sourceId",
Expand Down Expand Up @@ -3327,6 +3353,13 @@ const docTemplate = `{
"name": "prev_page_cursor",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
},
{
"type": "string",
"example": "2006-01-02T15:04:05",
Expand Down Expand Up @@ -4283,6 +4316,13 @@ const docTemplate = `{
"name": "provider",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
},
{
"type": "string",
"example": "http",
Expand Down Expand Up @@ -4882,6 +4922,13 @@ const docTemplate = `{
"description": "A pagination cursor to fetch the previous page of a list",
"name": "prev_page_cursor",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -7176,6 +7223,9 @@ const docTemplate = `{
"idempotency_key": {
"type": "string"
},
"latency": {
"type": "string"
},
"metadata": {
"$ref": "#/definitions/datastore.Metadata"
},
Expand Down
50 changes: 50 additions & 0 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,13 @@
"description": "The name of the endpoint",
"name": "q",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -1541,6 +1548,11 @@
"name": "eventId",
"in": "query"
},
{
"type": "string",
"name": "event_type",
"in": "query"
},
{
"type": "string",
"name": "idempotencyKey",
Expand All @@ -1567,6 +1579,13 @@
"name": "prev_page_cursor",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
},
{
"type": "string",
"example": "2006-01-02T15:04:05",
Expand Down Expand Up @@ -2459,6 +2478,13 @@
"name": "query",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
},
{
"type": "string",
"name": "sourceId",
Expand Down Expand Up @@ -3322,6 +3348,13 @@
"name": "prev_page_cursor",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
},
{
"type": "string",
"example": "2006-01-02T15:04:05",
Expand Down Expand Up @@ -4278,6 +4311,13 @@
"name": "provider",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
},
{
"type": "string",
"example": "http",
Expand Down Expand Up @@ -4877,6 +4917,13 @@
"description": "A pagination cursor to fetch the previous page of a list",
"name": "prev_page_cursor",
"in": "query"
},
{
"type": "string",
"example": "ASC | DESC",
"description": "sort order",
"name": "sort",
"in": "query"
}
],
"responses": {
Expand Down Expand Up @@ -7171,6 +7218,9 @@
"idempotency_key": {
"type": "string"
},
"latency": {
"type": "string"
},
"metadata": {
"$ref": "#/definitions/datastore.Metadata"
},
Expand Down
35 changes: 35 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,8 @@ definitions:
$ref: '#/definitions/httpheader.HTTPHeader'
idempotency_key:
type: string
latency:
type: string
metadata:
$ref: '#/definitions/datastore.Metadata'
project_id:
Expand Down Expand Up @@ -1985,6 +1987,11 @@ paths:
in: query
name: q
type: string
- description: sort order
example: ASC | DESC
in: query
name: sort
type: string
produces:
- application/json
responses:
Expand Down Expand Up @@ -2493,6 +2500,9 @@ paths:
- in: query
name: eventId
type: string
- in: query
name: event_type
type: string
- in: query
name: idempotencyKey
type: string
Expand All @@ -2511,6 +2521,11 @@ paths:
in: query
name: prev_page_cursor
type: string
- description: sort order
example: ASC | DESC
in: query
name: sort
type: string
- description: The start date
example: 2006-01-02T15:04:05
in: query
Expand Down Expand Up @@ -3006,6 +3021,11 @@ paths:
in: query
name: query
type: string
- description: sort order
example: ASC | DESC
in: query
name: sort
type: string
- in: query
name: sourceId
type: string
Expand Down Expand Up @@ -3485,6 +3505,11 @@ paths:
in: query
name: prev_page_cursor
type: string
- description: sort order
example: ASC | DESC
in: query
name: sort
type: string
- description: The start date
example: 2006-01-02T15:04:05
in: query
Expand Down Expand Up @@ -4011,6 +4036,11 @@ paths:
in: query
name: provider
type: string
- description: sort order
example: ASC | DESC
in: query
name: sort
type: string
- description: The source type e.g. http, pub_sub
example: http
in: query
Expand Down Expand Up @@ -4343,6 +4373,11 @@ paths:
in: query
name: prev_page_cursor
type: string
- description: sort order
example: ASC | DESC
in: query
name: sort
type: string
produces:
- application/json
responses:
Expand Down
Loading

0 comments on commit 038e4ff

Please sign in to comment.