diff --git a/api/models/event_delivery.go b/api/models/event_delivery.go index a26f2c2268..5d50ea1982 100644 --- a/api/models/event_delivery.go +++ b/api/models/event_delivery.go @@ -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 diff --git a/api/models/source.go b/api/models/source.go index 3bd846c51c..f348fb915d 100644 --- a/api/models/source.go +++ b/api/models/source.go @@ -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 { @@ -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"` diff --git a/docs/docs.go b/docs/docs.go index f70e3c2cea..3c4f5910cc 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -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" @@ -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": { @@ -1546,6 +1553,11 @@ const docTemplate = `{ "name": "eventId", "in": "query" }, + { + "type": "string", + "name": "event_type", + "in": "query" + }, { "type": "string", "name": "idempotencyKey", @@ -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", @@ -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", @@ -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", @@ -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", @@ -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": { @@ -7176,6 +7223,9 @@ const docTemplate = `{ "idempotency_key": { "type": "string" }, + "latency": { + "type": "string" + }, "metadata": { "$ref": "#/definitions/datastore.Metadata" }, diff --git a/docs/swagger.json b/docs/swagger.json index 3439ebec3c..3b699c0adf 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -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": { @@ -1541,6 +1548,11 @@ "name": "eventId", "in": "query" }, + { + "type": "string", + "name": "event_type", + "in": "query" + }, { "type": "string", "name": "idempotencyKey", @@ -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", @@ -2459,6 +2478,13 @@ "name": "query", "in": "query" }, + { + "type": "string", + "example": "ASC | DESC", + "description": "sort order", + "name": "sort", + "in": "query" + }, { "type": "string", "name": "sourceId", @@ -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", @@ -4278,6 +4311,13 @@ "name": "provider", "in": "query" }, + { + "type": "string", + "example": "ASC | DESC", + "description": "sort order", + "name": "sort", + "in": "query" + }, { "type": "string", "example": "http", @@ -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": { @@ -7171,6 +7218,9 @@ "idempotency_key": { "type": "string" }, + "latency": { + "type": "string" + }, "metadata": { "$ref": "#/definitions/datastore.Metadata" }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 0ac5a1f431..9046b2018c 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -1030,6 +1030,8 @@ definitions: $ref: '#/definitions/httpheader.HTTPHeader' idempotency_key: type: string + latency: + type: string metadata: $ref: '#/definitions/datastore.Metadata' project_id: @@ -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: @@ -2493,6 +2500,9 @@ paths: - in: query name: eventId type: string + - in: query + name: event_type + type: string - in: query name: idempotencyKey type: string @@ -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 @@ -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 @@ -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 @@ -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 @@ -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: diff --git a/docs/v3/openapi3.json b/docs/v3/openapi3.json index a5a6d4a014..a29d86d0e8 100644 --- a/docs/v3/openapi3.json +++ b/docs/v3/openapi3.json @@ -1530,6 +1530,9 @@ "idempotency_key": { "type": "string" }, + "latency": { + "type": "string" + }, "metadata": { "$ref": "#/components/schemas/datastore.Metadata" }, @@ -3146,6 +3149,14 @@ "schema": { "type": "string" } + }, + { + "description": "sort order", + "in": "query", + "name": "sort", + "schema": { + "type": "string" + } } ], "responses": { @@ -4192,6 +4203,13 @@ "type": "string" } }, + { + "in": "query", + "name": "event_type", + "schema": { + "type": "string" + } + }, { "in": "query", "name": "idempotencyKey", @@ -4223,6 +4241,14 @@ "type": "string" } }, + { + "description": "sort order", + "in": "query", + "name": "sort", + "schema": { + "type": "string" + } + }, { "description": "The start date", "in": "query", @@ -5235,6 +5261,14 @@ "type": "string" } }, + { + "description": "sort order", + "in": "query", + "name": "sort", + "schema": { + "type": "string" + } + }, { "in": "query", "name": "sourceId", @@ -6220,6 +6254,14 @@ "type": "string" } }, + { + "description": "sort order", + "in": "query", + "name": "sort", + "schema": { + "type": "string" + } + }, { "description": "The start date", "in": "query", @@ -7299,6 +7341,14 @@ "type": "string" } }, + { + "description": "sort order", + "in": "query", + "name": "sort", + "schema": { + "type": "string" + } + }, { "description": "The source type e.g. http, pub_sub", "in": "query", @@ -7976,6 +8026,14 @@ "schema": { "type": "string" } + }, + { + "description": "sort order", + "in": "query", + "name": "sort", + "schema": { + "type": "string" + } } ], "responses": { diff --git a/docs/v3/openapi3.yaml b/docs/v3/openapi3.yaml index cfda578e1b..f9c91d4a5d 100644 --- a/docs/v3/openapi3.yaml +++ b/docs/v3/openapi3.yaml @@ -1030,6 +1030,8 @@ components: $ref: '#/components/schemas/httpheader.HTTPHeader' idempotency_key: type: string + latency: + type: string metadata: $ref: '#/components/schemas/datastore.Metadata' project_id: @@ -2019,6 +2021,11 @@ paths: name: q schema: type: string + - description: sort order + in: query + name: sort + schema: + type: string responses: "200": content: @@ -2581,6 +2588,10 @@ paths: name: eventId schema: type: string + - in: query + name: event_type + schema: + type: string - in: query name: idempotencyKey schema: @@ -2600,6 +2611,11 @@ paths: name: prev_page_cursor schema: type: string + - description: sort order + in: query + name: sort + schema: + type: string - description: The start date in: query name: startDate @@ -3146,6 +3162,11 @@ paths: name: query schema: type: string + - description: sort order + in: query + name: sort + schema: + type: string - in: query name: sourceId schema: @@ -3678,6 +3699,11 @@ paths: name: prev_page_cursor schema: type: string + - description: sort order + in: query + name: sort + schema: + type: string - description: The start date in: query name: startDate @@ -4256,6 +4282,11 @@ paths: name: provider schema: type: string + - description: sort order + in: query + name: sort + schema: + type: string - description: The source type e.g. http, pub_sub in: query name: type @@ -4621,6 +4652,11 @@ paths: name: prev_page_cursor schema: type: string + - description: sort order + in: query + name: sort + schema: + type: string responses: "200": content: