Remove endpoint on webhook events
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @generated SignedSource<<70389123cd52ffd010e2b8f0109aedcd>>
|
* @generated SignedSource<<e16673382ec7f9083ba5df0b67d76583>>
|
||||||
* @lightSyntaxTransform
|
* @lightSyntaxTransform
|
||||||
* @nogrep
|
* @nogrep
|
||||||
*/
|
*/
|
||||||
@@ -21,7 +21,6 @@ export type WebhooksSettingsPage_eventsQuery$data = {
|
|||||||
readonly edges: ReadonlyArray<{
|
readonly edges: ReadonlyArray<{
|
||||||
readonly node: {
|
readonly node: {
|
||||||
readonly createdAt: string;
|
readonly createdAt: string;
|
||||||
readonly endpointUrl: string;
|
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
readonly response: string | null | undefined;
|
readonly response: string | null | undefined;
|
||||||
readonly status: WebhookEventStatus;
|
readonly status: WebhookEventStatus;
|
||||||
@@ -148,13 +147,6 @@ v5 = {
|
|||||||
"name": "status",
|
"name": "status",
|
||||||
"storageKey": null
|
"storageKey": null
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"alias": null,
|
|
||||||
"args": null,
|
|
||||||
"kind": "ScalarField",
|
|
||||||
"name": "endpointUrl",
|
|
||||||
"storageKey": null
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"alias": null,
|
"alias": null,
|
||||||
"args": null,
|
"args": null,
|
||||||
@@ -242,16 +234,16 @@ return {
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"params": {
|
"params": {
|
||||||
"cacheID": "507b568e987ce78e58b171810a60bce8",
|
"cacheID": "4593e2ef5dabf3cef70959eb8d2e4b01",
|
||||||
"id": null,
|
"id": null,
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"name": "WebhooksSettingsPage_eventsQuery",
|
"name": "WebhooksSettingsPage_eventsQuery",
|
||||||
"operationKind": "query",
|
"operationKind": "query",
|
||||||
"text": "query WebhooksSettingsPage_eventsQuery(\n $webhookConfigurationId: ID!\n $first: Int\n $after: CursorKey\n) {\n node(id: $webhookConfigurationId) {\n __typename\n ... on WebhookConfiguration {\n events(first: $first, after: $after) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n id\n status\n endpointUrl\n createdAt\n response\n }\n }\n }\n }\n id\n }\n}\n"
|
"text": "query WebhooksSettingsPage_eventsQuery(\n $webhookConfigurationId: ID!\n $first: Int\n $after: CursorKey\n) {\n node(id: $webhookConfigurationId) {\n __typename\n ... on WebhookConfiguration {\n events(first: $first, after: $after) {\n totalCount\n pageInfo {\n hasNextPage\n endCursor\n }\n edges {\n node {\n id\n status\n createdAt\n response\n }\n }\n }\n }\n id\n }\n}\n"
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
||||||
(node as any).hash = "2e528e16c34c33138858f92215af2ab4";
|
(node as any).hash = "16da5d0681f767c57e3f352d4956eefe";
|
||||||
|
|
||||||
export default node;
|
export default node;
|
||||||
|
|||||||
@@ -116,7 +116,6 @@ const webhookEventsQuery = graphql`
|
|||||||
node {
|
node {
|
||||||
id
|
id
|
||||||
status
|
status
|
||||||
endpointUrl
|
|
||||||
createdAt
|
createdAt
|
||||||
response
|
response
|
||||||
}
|
}
|
||||||
@@ -394,9 +393,6 @@ function WebhookEventsDialog({
|
|||||||
{formatDate(event.createdAt)}
|
{formatDate(event.createdAt)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-xs font-mono text-txt-secondary truncate">
|
|
||||||
{event.endpointUrl}
|
|
||||||
</p>
|
|
||||||
{event.response && (
|
{event.response && (
|
||||||
<details className="text-xs">
|
<details className="text-xs">
|
||||||
<summary className="cursor-pointer text-txt-link hover:underline">
|
<summary className="cursor-pointer text-txt-link hover:underline">
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ CREATE TABLE webhook_events (
|
|||||||
tenant_id TEXT NOT NULL,
|
tenant_id TEXT NOT NULL,
|
||||||
webhook_data_id TEXT NOT NULL REFERENCES webhook_data(id) ON UPDATE CASCADE ON DELETE CASCADE,
|
webhook_data_id TEXT NOT NULL REFERENCES webhook_data(id) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||||
webhook_configuration_id TEXT NOT NULL REFERENCES webhook_configurations(id) ON UPDATE CASCADE ON DELETE CASCADE,
|
webhook_configuration_id TEXT NOT NULL REFERENCES webhook_configurations(id) ON UPDATE CASCADE ON DELETE CASCADE,
|
||||||
endpoint_url TEXT NOT NULL,
|
|
||||||
status webhook_event_status NOT NULL,
|
status webhook_event_status NOT NULL,
|
||||||
response JSONB,
|
response JSONB,
|
||||||
created_at TIMESTAMP WITH TIME ZONE NOT NULL
|
created_at TIMESTAMP WITH TIME ZONE NOT NULL
|
||||||
|
|||||||
@@ -32,7 +32,6 @@ type (
|
|||||||
ID gid.GID `db:"id"`
|
ID gid.GID `db:"id"`
|
||||||
WebhookDataID gid.GID `db:"webhook_data_id"`
|
WebhookDataID gid.GID `db:"webhook_data_id"`
|
||||||
WebhookConfigurationID gid.GID `db:"webhook_configuration_id"`
|
WebhookConfigurationID gid.GID `db:"webhook_configuration_id"`
|
||||||
EndpointURL string `db:"endpoint_url"`
|
|
||||||
Status WebhookEventStatus `db:"status"`
|
Status WebhookEventStatus `db:"status"`
|
||||||
Response json.RawMessage `db:"response"`
|
Response json.RawMessage `db:"response"`
|
||||||
CreatedAt time.Time `db:"created_at"`
|
CreatedAt time.Time `db:"created_at"`
|
||||||
@@ -62,7 +61,6 @@ SELECT
|
|||||||
id,
|
id,
|
||||||
webhook_data_id,
|
webhook_data_id,
|
||||||
webhook_configuration_id,
|
webhook_configuration_id,
|
||||||
endpoint_url,
|
|
||||||
status,
|
status,
|
||||||
response,
|
response,
|
||||||
created_at
|
created_at
|
||||||
@@ -129,7 +127,6 @@ INSERT INTO webhook_events (
|
|||||||
tenant_id,
|
tenant_id,
|
||||||
webhook_data_id,
|
webhook_data_id,
|
||||||
webhook_configuration_id,
|
webhook_configuration_id,
|
||||||
endpoint_url,
|
|
||||||
status,
|
status,
|
||||||
response,
|
response,
|
||||||
created_at
|
created_at
|
||||||
@@ -139,7 +136,6 @@ VALUES (
|
|||||||
@tenant_id,
|
@tenant_id,
|
||||||
@webhook_data_id,
|
@webhook_data_id,
|
||||||
@webhook_configuration_id,
|
@webhook_configuration_id,
|
||||||
@endpoint_url,
|
|
||||||
@status,
|
@status,
|
||||||
@response,
|
@response,
|
||||||
@created_at
|
@created_at
|
||||||
@@ -151,7 +147,6 @@ VALUES (
|
|||||||
"tenant_id": scope.GetTenantID(),
|
"tenant_id": scope.GetTenantID(),
|
||||||
"webhook_data_id": w.WebhookDataID,
|
"webhook_data_id": w.WebhookDataID,
|
||||||
"webhook_configuration_id": w.WebhookConfigurationID,
|
"webhook_configuration_id": w.WebhookConfigurationID,
|
||||||
"endpoint_url": w.EndpointURL,
|
|
||||||
"status": w.Status,
|
"status": w.Status,
|
||||||
"response": w.Response,
|
"response": w.Response,
|
||||||
"created_at": w.CreatedAt,
|
"created_at": w.CreatedAt,
|
||||||
|
|||||||
@@ -2347,7 +2347,6 @@ input WebhookEventOrder
|
|||||||
type WebhookEvent implements Node {
|
type WebhookEvent implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
webhookConfigurationId: ID!
|
webhookConfigurationId: ID!
|
||||||
endpointUrl: String!
|
|
||||||
status: WebhookEventStatus!
|
status: WebhookEventStatus!
|
||||||
response: String
|
response: String
|
||||||
createdAt: Datetime!
|
createdAt: Datetime!
|
||||||
|
|||||||
@@ -1955,7 +1955,6 @@ type ComplexityRoot struct {
|
|||||||
|
|
||||||
WebhookEvent struct {
|
WebhookEvent struct {
|
||||||
CreatedAt func(childComplexity int) int
|
CreatedAt func(childComplexity int) int
|
||||||
EndpointURL func(childComplexity int) int
|
|
||||||
ID func(childComplexity int) int
|
ID func(childComplexity int) int
|
||||||
Response func(childComplexity int) int
|
Response func(childComplexity int) int
|
||||||
Status func(childComplexity int) int
|
Status func(childComplexity int) int
|
||||||
@@ -10229,12 +10228,6 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
return e.complexity.WebhookEvent.CreatedAt(childComplexity), true
|
return e.complexity.WebhookEvent.CreatedAt(childComplexity), true
|
||||||
case "WebhookEvent.endpointUrl":
|
|
||||||
if e.complexity.WebhookEvent.EndpointURL == nil {
|
|
||||||
break
|
|
||||||
}
|
|
||||||
|
|
||||||
return e.complexity.WebhookEvent.EndpointURL(childComplexity), true
|
|
||||||
case "WebhookEvent.id":
|
case "WebhookEvent.id":
|
||||||
if e.complexity.WebhookEvent.ID == nil {
|
if e.complexity.WebhookEvent.ID == nil {
|
||||||
break
|
break
|
||||||
@@ -12941,7 +12934,6 @@ input WebhookEventOrder
|
|||||||
type WebhookEvent implements Node {
|
type WebhookEvent implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
webhookConfigurationId: ID!
|
webhookConfigurationId: ID!
|
||||||
endpointUrl: String!
|
|
||||||
status: WebhookEventStatus!
|
status: WebhookEventStatus!
|
||||||
response: String
|
response: String
|
||||||
createdAt: Datetime!
|
createdAt: Datetime!
|
||||||
@@ -60528,35 +60520,6 @@ func (ec *executionContext) fieldContext_WebhookEvent_webhookConfigurationId(_ c
|
|||||||
return fc, nil
|
return fc, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ec *executionContext) _WebhookEvent_endpointUrl(ctx context.Context, field graphql.CollectedField, obj *types.WebhookEvent) (ret graphql.Marshaler) {
|
|
||||||
return graphql.ResolveField(
|
|
||||||
ctx,
|
|
||||||
ec.OperationContext,
|
|
||||||
field,
|
|
||||||
ec.fieldContext_WebhookEvent_endpointUrl,
|
|
||||||
func(ctx context.Context) (any, error) {
|
|
||||||
return obj.EndpointURL, nil
|
|
||||||
},
|
|
||||||
nil,
|
|
||||||
ec.marshalNString2string,
|
|
||||||
true,
|
|
||||||
true,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ec *executionContext) fieldContext_WebhookEvent_endpointUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) {
|
|
||||||
fc = &graphql.FieldContext{
|
|
||||||
Object: "WebhookEvent",
|
|
||||||
Field: field,
|
|
||||||
IsMethod: false,
|
|
||||||
IsResolver: false,
|
|
||||||
Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) {
|
|
||||||
return nil, errors.New("field of type String does not have child fields")
|
|
||||||
},
|
|
||||||
}
|
|
||||||
return fc, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (ec *executionContext) _WebhookEvent_status(ctx context.Context, field graphql.CollectedField, obj *types.WebhookEvent) (ret graphql.Marshaler) {
|
func (ec *executionContext) _WebhookEvent_status(ctx context.Context, field graphql.CollectedField, obj *types.WebhookEvent) (ret graphql.Marshaler) {
|
||||||
return graphql.ResolveField(
|
return graphql.ResolveField(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -60804,8 +60767,6 @@ func (ec *executionContext) fieldContext_WebhookEventEdge_node(_ context.Context
|
|||||||
return ec.fieldContext_WebhookEvent_id(ctx, field)
|
return ec.fieldContext_WebhookEvent_id(ctx, field)
|
||||||
case "webhookConfigurationId":
|
case "webhookConfigurationId":
|
||||||
return ec.fieldContext_WebhookEvent_webhookConfigurationId(ctx, field)
|
return ec.fieldContext_WebhookEvent_webhookConfigurationId(ctx, field)
|
||||||
case "endpointUrl":
|
|
||||||
return ec.fieldContext_WebhookEvent_endpointUrl(ctx, field)
|
|
||||||
case "status":
|
case "status":
|
||||||
return ec.fieldContext_WebhookEvent_status(ctx, field)
|
return ec.fieldContext_WebhookEvent_status(ctx, field)
|
||||||
case "response":
|
case "response":
|
||||||
@@ -91668,11 +91629,6 @@ func (ec *executionContext) _WebhookEvent(ctx context.Context, sel ast.Selection
|
|||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
out.Invalids++
|
out.Invalids++
|
||||||
}
|
}
|
||||||
case "endpointUrl":
|
|
||||||
out.Values[i] = ec._WebhookEvent_endpointUrl(ctx, field, obj)
|
|
||||||
if out.Values[i] == graphql.Null {
|
|
||||||
out.Invalids++
|
|
||||||
}
|
|
||||||
case "status":
|
case "status":
|
||||||
out.Values[i] = ec._WebhookEvent_status(ctx, field, obj)
|
out.Values[i] = ec._WebhookEvent_status(ctx, field, obj)
|
||||||
if out.Values[i] == graphql.Null {
|
if out.Values[i] == graphql.Null {
|
||||||
|
|||||||
@@ -2646,7 +2646,6 @@ type WebhookConfigurationEdge struct {
|
|||||||
type WebhookEvent struct {
|
type WebhookEvent struct {
|
||||||
ID gid.GID `json:"id"`
|
ID gid.GID `json:"id"`
|
||||||
WebhookConfigurationID gid.GID `json:"webhookConfigurationId"`
|
WebhookConfigurationID gid.GID `json:"webhookConfigurationId"`
|
||||||
EndpointURL string `json:"endpointUrl"`
|
|
||||||
Status coredata.WebhookEventStatus `json:"status"`
|
Status coredata.WebhookEventStatus `json:"status"`
|
||||||
Response *string `json:"response,omitempty"`
|
Response *string `json:"response,omitempty"`
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ func NewWebhookEvent(we *coredata.WebhookEvent) *WebhookEvent {
|
|||||||
return &WebhookEvent{
|
return &WebhookEvent{
|
||||||
ID: we.ID,
|
ID: we.ID,
|
||||||
WebhookConfigurationID: we.WebhookConfigurationID,
|
WebhookConfigurationID: we.WebhookConfigurationID,
|
||||||
EndpointURL: we.EndpointURL,
|
|
||||||
Status: we.Status,
|
Status: we.Status,
|
||||||
Response: response,
|
Response: response,
|
||||||
CreatedAt: we.CreatedAt,
|
CreatedAt: we.CreatedAt,
|
||||||
|
|||||||
@@ -317,7 +317,6 @@ func (s *Sender) recordEvent(
|
|||||||
ID: eventID,
|
ID: eventID,
|
||||||
WebhookDataID: webhookData.ID,
|
WebhookDataID: webhookData.ID,
|
||||||
WebhookConfigurationID: config.ID,
|
WebhookConfigurationID: config.ID,
|
||||||
EndpointURL: config.EndpointURL,
|
|
||||||
Status: status,
|
Status: status,
|
||||||
Response: response,
|
Response: response,
|
||||||
CreatedAt: time.Now(),
|
CreatedAt: time.Now(),
|
||||||
|
|||||||
Reference in New Issue
Block a user