From 60538ef2bb15d8bf8c62ebe3d1dbc12cb560d5ba Mon Sep 17 00:00:00 2001 From: Sacha Al Himdani Date: Fri, 13 Feb 2026 16:54:46 +0100 Subject: [PATCH] Change webhook configuration to subscription Signed-off-by: Sacha Al Himdani --- .../core/WebhooksSettingsPageQuery.graphql.ts | 32 +- ...ooksSettingsPage_createMutation.graphql.ts | 59 +- ...ooksSettingsPage_deleteMutation.graphql.ts | 30 +- ...ebhooksSettingsPage_eventsQuery.graphql.ts | 16 +- ...SettingsPage_signingSecretQuery.graphql.ts | 16 +- ...ooksSettingsPage_updateMutation.graphql.ts | 24 +- .../settings/WebhooksSettingsPage.tsx | 95 +- pkg/coredata/entity_type_reg.go | 6 +- pkg/coredata/migrations/20260210T135740Z.sql | 4 +- pkg/coredata/webhook_event.go | 26 +- ...nfiguration.go => webhook_subscription.go} | 120 +-- ...go => webhook_subscription_order_field.go} | 20 +- pkg/probo/actions.go | 12 +- pkg/probo/policies.go | 2 +- pkg/probo/service.go | 4 +- ...ice.go => webhook_subscription_service.go} | 114 +-- pkg/server/api/console/v1/schema.graphql | 72 +- pkg/server/api/console/v1/schema/schema.go | 918 +++++++++--------- pkg/server/api/console/v1/types/types.go | 36 +- .../api/console/v1/types/webhook_event.go | 2 +- ...nfiguration.go => webhook_subscription.go} | 28 +- pkg/server/api/console/v1/v1_resolver.go | 122 +-- pkg/webhook/data.go | 4 +- pkg/webhook/sender.go | 38 +- 24 files changed, 915 insertions(+), 885 deletions(-) rename pkg/coredata/{webhook_configuration.go => webhook_subscription.go} (68%) rename pkg/coredata/{webhook_configuration_order_field.go => webhook_subscription_order_field.go} (61%) rename pkg/probo/{webhook_configuration_service.go => webhook_subscription_service.go} (60%) rename pkg/server/api/console/v1/types/{webhook_configuration.go => webhook_subscription.go} (62%) diff --git a/apps/console/src/__generated__/core/WebhooksSettingsPageQuery.graphql.ts b/apps/console/src/__generated__/core/WebhooksSettingsPageQuery.graphql.ts index 19b5343fc..c56ea5b3c 100644 --- a/apps/console/src/__generated__/core/WebhooksSettingsPageQuery.graphql.ts +++ b/apps/console/src/__generated__/core/WebhooksSettingsPageQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<18c0948adc229a75b1d980e64730b423>> + * @generated SignedSource<<164efe490915ac140a48e42cbd17e915>> * @lightSyntaxTransform * @nogrep */ @@ -17,7 +17,7 @@ export type WebhooksSettingsPageQuery$data = { readonly organization: { readonly __typename: "Organization"; readonly id: string; - readonly webhookConfigurations: { + readonly webhookSubscriptions: { readonly edges: ReadonlyArray<{ readonly node: { readonly endpointUrl: string; @@ -73,7 +73,7 @@ v4 = [ { "alias": null, "args": null, - "concreteType": "WebhookConfigurationEdge", + "concreteType": "WebhookSubscriptionEdge", "kind": "LinkedField", "name": "edges", "plural": true, @@ -81,7 +81,7 @@ v4 = [ { "alias": null, "args": null, - "concreteType": "WebhookConfiguration", + "concreteType": "WebhookSubscription", "kind": "LinkedField", "name": "node", "plural": false, @@ -195,11 +195,11 @@ return { "selections": [ (v3/*: any*/), { - "alias": "webhookConfigurations", + "alias": "webhookSubscriptions", "args": null, - "concreteType": "WebhookConfigurationConnection", + "concreteType": "WebhookSubscriptionConnection", "kind": "LinkedField", - "name": "__WebhooksSettingsPage_webhookConfigurations_connection", + "name": "__WebhooksSettingsPage_webhookSubscriptions_connection", "plural": false, "selections": (v4/*: any*/), "storageKey": null @@ -239,21 +239,21 @@ return { { "alias": null, "args": (v5/*: any*/), - "concreteType": "WebhookConfigurationConnection", + "concreteType": "WebhookSubscriptionConnection", "kind": "LinkedField", - "name": "webhookConfigurations", + "name": "webhookSubscriptions", "plural": false, "selections": (v4/*: any*/), - "storageKey": "webhookConfigurations(first:50)" + "storageKey": "webhookSubscriptions(first:50)" }, { "alias": null, "args": (v5/*: any*/), "filters": null, "handle": "connection", - "key": "WebhooksSettingsPage_webhookConfigurations", + "key": "WebhooksSettingsPage_webhookSubscriptions", "kind": "LinkedHandle", - "name": "webhookConfigurations" + "name": "webhookSubscriptions" } ], "type": "Organization", @@ -265,7 +265,7 @@ return { ] }, "params": { - "cacheID": "b5ca3cf4d05d2cb81c744e760433cb94", + "cacheID": "eeb9eda2a1b1d205fadba357fc20077c", "id": null, "metadata": { "connection": [ @@ -275,18 +275,18 @@ return { "direction": "forward", "path": [ "organization", - "webhookConfigurations" + "webhookSubscriptions" ] } ] }, "name": "WebhooksSettingsPageQuery", "operationKind": "query", - "text": "query WebhooksSettingsPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n webhookConfigurations(first: 50) {\n edges {\n node {\n id\n endpointUrl\n selectedEvents\n events(first: 0) {\n totalCount\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n" + "text": "query WebhooksSettingsPageQuery(\n $organizationId: ID!\n) {\n organization: node(id: $organizationId) {\n __typename\n ... on Organization {\n id\n webhookSubscriptions(first: 50) {\n edges {\n node {\n id\n endpointUrl\n selectedEvents\n events(first: 0) {\n totalCount\n }\n __typename\n }\n cursor\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n }\n id\n }\n}\n" } }; })(); -(node as any).hash = "bac1812903d6f495d15bb0e70ce5ed48"; +(node as any).hash = "2d08ddd621d3e5880367b83a70d2f168"; export default node; diff --git a/apps/console/src/__generated__/core/WebhooksSettingsPage_createMutation.graphql.ts b/apps/console/src/__generated__/core/WebhooksSettingsPage_createMutation.graphql.ts index 3ba73a15f..c4ee5e1dc 100644 --- a/apps/console/src/__generated__/core/WebhooksSettingsPage_createMutation.graphql.ts +++ b/apps/console/src/__generated__/core/WebhooksSettingsPage_createMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<56bfc2d1746edae72b0da44526fab12f>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -10,20 +10,23 @@ import { ConcreteRequest } from 'relay-runtime'; export type WebhookEventType = "MEETING_CREATED" | "MEETING_DELETED" | "MEETING_UPDATED" | "VENDOR_CREATED" | "VENDOR_DELETED" | "VENDOR_UPDATED"; -export type CreateWebhookConfigurationInput = { +export type CreateWebhookSubscriptionInput = { endpointUrl: string; organizationId: string; selectedEvents: ReadonlyArray; }; export type WebhooksSettingsPage_createMutation$variables = { connections: ReadonlyArray; - input: CreateWebhookConfigurationInput; + input: CreateWebhookSubscriptionInput; }; export type WebhooksSettingsPage_createMutation$data = { - readonly createWebhookConfiguration: { - readonly webhookConfigurationEdge: { + readonly createWebhookSubscription: { + readonly webhookSubscriptionEdge: { readonly node: { readonly endpointUrl: string; + readonly events: { + readonly totalCount: number; + }; readonly id: string; readonly selectedEvents: ReadonlyArray; }; @@ -56,15 +59,15 @@ v2 = [ v3 = { "alias": null, "args": null, - "concreteType": "WebhookConfigurationEdge", + "concreteType": "WebhookSubscriptionEdge", "kind": "LinkedField", - "name": "webhookConfigurationEdge", + "name": "webhookSubscriptionEdge", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "WebhookConfiguration", + "concreteType": "WebhookSubscription", "kind": "LinkedField", "name": "node", "plural": false, @@ -89,6 +92,30 @@ v3 = { "kind": "ScalarField", "name": "selectedEvents", "storageKey": null + }, + { + "alias": null, + "args": [ + { + "kind": "Literal", + "name": "first", + "value": 0 + } + ], + "concreteType": "WebhookEventConnection", + "kind": "LinkedField", + "name": "events", + "plural": false, + "selections": [ + { + "alias": null, + "args": null, + "kind": "ScalarField", + "name": "totalCount", + "storageKey": null + } + ], + "storageKey": "events(first:0)" } ], "storageKey": null @@ -109,9 +136,9 @@ return { { "alias": null, "args": (v2/*: any*/), - "concreteType": "CreateWebhookConfigurationPayload", + "concreteType": "CreateWebhookSubscriptionPayload", "kind": "LinkedField", - "name": "createWebhookConfiguration", + "name": "createWebhookSubscription", "plural": false, "selections": [ (v3/*: any*/) @@ -134,9 +161,9 @@ return { { "alias": null, "args": (v2/*: any*/), - "concreteType": "CreateWebhookConfigurationPayload", + "concreteType": "CreateWebhookSubscriptionPayload", "kind": "LinkedField", - "name": "createWebhookConfiguration", + "name": "createWebhookSubscription", "plural": false, "selections": [ (v3/*: any*/), @@ -147,7 +174,7 @@ return { "handle": "prependEdge", "key": "", "kind": "LinkedHandle", - "name": "webhookConfigurationEdge", + "name": "webhookSubscriptionEdge", "handleArgs": [ { "kind": "Variable", @@ -162,16 +189,16 @@ return { ] }, "params": { - "cacheID": "0e88932f635b8f16e41f730abf9e05ff", + "cacheID": "478c002a1f98dd87f23c6af0269ea2c6", "id": null, "metadata": {}, "name": "WebhooksSettingsPage_createMutation", "operationKind": "mutation", - "text": "mutation WebhooksSettingsPage_createMutation(\n $input: CreateWebhookConfigurationInput!\n) {\n createWebhookConfiguration(input: $input) {\n webhookConfigurationEdge {\n node {\n id\n endpointUrl\n selectedEvents\n }\n }\n }\n}\n" + "text": "mutation WebhooksSettingsPage_createMutation(\n $input: CreateWebhookSubscriptionInput!\n) {\n createWebhookSubscription(input: $input) {\n webhookSubscriptionEdge {\n node {\n id\n endpointUrl\n selectedEvents\n events(first: 0) {\n totalCount\n }\n }\n }\n }\n}\n" } }; })(); -(node as any).hash = "4e1a7692c83c4dda0c2fc557f15d669d"; +(node as any).hash = "f47b849f8cad710922bf62eb6aebdd93"; export default node; diff --git a/apps/console/src/__generated__/core/WebhooksSettingsPage_deleteMutation.graphql.ts b/apps/console/src/__generated__/core/WebhooksSettingsPage_deleteMutation.graphql.ts index e16a8c38b..0d550a062 100644 --- a/apps/console/src/__generated__/core/WebhooksSettingsPage_deleteMutation.graphql.ts +++ b/apps/console/src/__generated__/core/WebhooksSettingsPage_deleteMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<86d94ecf595a0048971276541e185905>> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -9,16 +9,16 @@ // @ts-nocheck import { ConcreteRequest } from 'relay-runtime'; -export type DeleteWebhookConfigurationInput = { - webhookConfigurationId: string; +export type DeleteWebhookSubscriptionInput = { + webhookSubscriptionId: string; }; export type WebhooksSettingsPage_deleteMutation$variables = { connections: ReadonlyArray; - input: DeleteWebhookConfigurationInput; + input: DeleteWebhookSubscriptionInput; }; export type WebhooksSettingsPage_deleteMutation$data = { - readonly deleteWebhookConfiguration: { - readonly deletedWebhookConfigurationId: string; + readonly deleteWebhookSubscription: { + readonly deletedWebhookSubscriptionId: string; }; }; export type WebhooksSettingsPage_deleteMutation = { @@ -48,7 +48,7 @@ v3 = { "alias": null, "args": null, "kind": "ScalarField", - "name": "deletedWebhookConfigurationId", + "name": "deletedWebhookSubscriptionId", "storageKey": null }; return { @@ -64,9 +64,9 @@ return { { "alias": null, "args": (v2/*: any*/), - "concreteType": "DeleteWebhookConfigurationPayload", + "concreteType": "DeleteWebhookSubscriptionPayload", "kind": "LinkedField", - "name": "deleteWebhookConfiguration", + "name": "deleteWebhookSubscription", "plural": false, "selections": [ (v3/*: any*/) @@ -89,9 +89,9 @@ return { { "alias": null, "args": (v2/*: any*/), - "concreteType": "DeleteWebhookConfigurationPayload", + "concreteType": "DeleteWebhookSubscriptionPayload", "kind": "LinkedField", - "name": "deleteWebhookConfiguration", + "name": "deleteWebhookSubscription", "plural": false, "selections": [ (v3/*: any*/), @@ -102,7 +102,7 @@ return { "handle": "deleteEdge", "key": "", "kind": "ScalarHandle", - "name": "deletedWebhookConfigurationId", + "name": "deletedWebhookSubscriptionId", "handleArgs": [ { "kind": "Variable", @@ -117,16 +117,16 @@ return { ] }, "params": { - "cacheID": "ae53fa4e16e4491720c1fdfc52301c09", + "cacheID": "c1bab418b14488e982f2c444b8693919", "id": null, "metadata": {}, "name": "WebhooksSettingsPage_deleteMutation", "operationKind": "mutation", - "text": "mutation WebhooksSettingsPage_deleteMutation(\n $input: DeleteWebhookConfigurationInput!\n) {\n deleteWebhookConfiguration(input: $input) {\n deletedWebhookConfigurationId\n }\n}\n" + "text": "mutation WebhooksSettingsPage_deleteMutation(\n $input: DeleteWebhookSubscriptionInput!\n) {\n deleteWebhookSubscription(input: $input) {\n deletedWebhookSubscriptionId\n }\n}\n" } }; })(); -(node as any).hash = "632fce2d89360bed2d857dd3feb90b9d"; +(node as any).hash = "794d73fc91d4332f5e65a070ea11d27d"; export default node; diff --git a/apps/console/src/__generated__/core/WebhooksSettingsPage_eventsQuery.graphql.ts b/apps/console/src/__generated__/core/WebhooksSettingsPage_eventsQuery.graphql.ts index fc9c59632..428fa7d3d 100644 --- a/apps/console/src/__generated__/core/WebhooksSettingsPage_eventsQuery.graphql.ts +++ b/apps/console/src/__generated__/core/WebhooksSettingsPage_eventsQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<7427d67b4f9b27376c782cbe0601a5ec>> + * @generated SignedSource<<6973a312c85bf6bed33ceda2600b989d>> * @lightSyntaxTransform * @nogrep */ @@ -13,7 +13,7 @@ export type WebhookEventStatus = "FAILED" | "PENDING" | "SUCCEEDED"; export type WebhooksSettingsPage_eventsQuery$variables = { after?: string | null | undefined; first?: number | null | undefined; - webhookConfigurationId: string; + webhookSubscriptionId: string; }; export type WebhooksSettingsPage_eventsQuery$data = { readonly node: { @@ -53,13 +53,13 @@ v1 = { v2 = { "defaultValue": null, "kind": "LocalArgument", - "name": "webhookConfigurationId" + "name": "webhookSubscriptionId" }, v3 = [ { "kind": "Variable", "name": "id", - "variableName": "webhookConfigurationId" + "variableName": "webhookSubscriptionId" } ], v4 = { @@ -171,7 +171,7 @@ v5 = { "storageKey": null } ], - "type": "WebhookConfiguration", + "type": "WebhookSubscription", "abstractKey": null }; return { @@ -234,16 +234,16 @@ return { ] }, "params": { - "cacheID": "4593e2ef5dabf3cef70959eb8d2e4b01", + "cacheID": "e74fa0d64dfc6bb54856386970bf4b68", "id": null, "metadata": {}, "name": "WebhooksSettingsPage_eventsQuery", "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 createdAt\n response\n }\n }\n }\n }\n id\n }\n}\n" + "text": "query WebhooksSettingsPage_eventsQuery(\n $webhookSubscriptionId: ID!\n $first: Int\n $after: CursorKey\n) {\n node(id: $webhookSubscriptionId) {\n __typename\n ... on WebhookSubscription {\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 = "16da5d0681f767c57e3f352d4956eefe"; +(node as any).hash = "75d3f1df0526526656b065b6d9be8b65"; export default node; diff --git a/apps/console/src/__generated__/core/WebhooksSettingsPage_signingSecretQuery.graphql.ts b/apps/console/src/__generated__/core/WebhooksSettingsPage_signingSecretQuery.graphql.ts index eac4448aa..87053c5be 100644 --- a/apps/console/src/__generated__/core/WebhooksSettingsPage_signingSecretQuery.graphql.ts +++ b/apps/console/src/__generated__/core/WebhooksSettingsPage_signingSecretQuery.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<> + * @generated SignedSource<> * @lightSyntaxTransform * @nogrep */ @@ -10,7 +10,7 @@ import { ConcreteRequest } from 'relay-runtime'; export type WebhooksSettingsPage_signingSecretQuery$variables = { - webhookConfigurationId: string; + webhookSubscriptionId: string; }; export type WebhooksSettingsPage_signingSecretQuery$data = { readonly node: { @@ -27,14 +27,14 @@ var v0 = [ { "defaultValue": null, "kind": "LocalArgument", - "name": "webhookConfigurationId" + "name": "webhookSubscriptionId" } ], v1 = [ { "kind": "Variable", "name": "id", - "variableName": "webhookConfigurationId" + "variableName": "webhookSubscriptionId" } ], v2 = { @@ -48,7 +48,7 @@ v2 = { "storageKey": null } ], - "type": "WebhookConfiguration", + "type": "WebhookSubscription", "abstractKey": null }; return { @@ -109,16 +109,16 @@ return { ] }, "params": { - "cacheID": "266c1519da14eb09ed28e26cc6394f23", + "cacheID": "df35742c680c055e5b820401cfb05271", "id": null, "metadata": {}, "name": "WebhooksSettingsPage_signingSecretQuery", "operationKind": "query", - "text": "query WebhooksSettingsPage_signingSecretQuery(\n $webhookConfigurationId: ID!\n) {\n node(id: $webhookConfigurationId) {\n __typename\n ... on WebhookConfiguration {\n signingSecret\n }\n id\n }\n}\n" + "text": "query WebhooksSettingsPage_signingSecretQuery(\n $webhookSubscriptionId: ID!\n) {\n node(id: $webhookSubscriptionId) {\n __typename\n ... on WebhookSubscription {\n signingSecret\n }\n id\n }\n}\n" } }; })(); -(node as any).hash = "9d981d1a353a82f234e7ce79edb6d5d9"; +(node as any).hash = "2d895bf4be96e0ef2c767af8149c8533"; export default node; diff --git a/apps/console/src/__generated__/core/WebhooksSettingsPage_updateMutation.graphql.ts b/apps/console/src/__generated__/core/WebhooksSettingsPage_updateMutation.graphql.ts index a0f149ebe..a0bb4eb8a 100644 --- a/apps/console/src/__generated__/core/WebhooksSettingsPage_updateMutation.graphql.ts +++ b/apps/console/src/__generated__/core/WebhooksSettingsPage_updateMutation.graphql.ts @@ -1,5 +1,5 @@ /** - * @generated SignedSource<<3331839e2cc81d14ac1b2fcfe3fd84f1>> + * @generated SignedSource<<864603efd6135475b827a1234b128b7c>> * @lightSyntaxTransform * @nogrep */ @@ -10,17 +10,17 @@ import { ConcreteRequest } from 'relay-runtime'; export type WebhookEventType = "MEETING_CREATED" | "MEETING_DELETED" | "MEETING_UPDATED" | "VENDOR_CREATED" | "VENDOR_DELETED" | "VENDOR_UPDATED"; -export type UpdateWebhookConfigurationInput = { +export type UpdateWebhookSubscriptionInput = { endpointUrl?: string | null | undefined; id: string; selectedEvents?: ReadonlyArray | null | undefined; }; export type WebhooksSettingsPage_updateMutation$variables = { - input: UpdateWebhookConfigurationInput; + input: UpdateWebhookSubscriptionInput; }; export type WebhooksSettingsPage_updateMutation$data = { - readonly updateWebhookConfiguration: { - readonly webhookConfiguration: { + readonly updateWebhookSubscription: { + readonly webhookSubscription: { readonly endpointUrl: string; readonly id: string; readonly selectedEvents: ReadonlyArray; @@ -51,17 +51,17 @@ v1 = [ "variableName": "input" } ], - "concreteType": "UpdateWebhookConfigurationPayload", + "concreteType": "UpdateWebhookSubscriptionPayload", "kind": "LinkedField", - "name": "updateWebhookConfiguration", + "name": "updateWebhookSubscription", "plural": false, "selections": [ { "alias": null, "args": null, - "concreteType": "WebhookConfiguration", + "concreteType": "WebhookSubscription", "kind": "LinkedField", - "name": "webhookConfiguration", + "name": "webhookSubscription", "plural": false, "selections": [ { @@ -117,16 +117,16 @@ return { "selections": (v1/*: any*/) }, "params": { - "cacheID": "399a35c005f10dd321784a7533fb4f80", + "cacheID": "e12790e2de3f89c6606b50a597acb244", "id": null, "metadata": {}, "name": "WebhooksSettingsPage_updateMutation", "operationKind": "mutation", - "text": "mutation WebhooksSettingsPage_updateMutation(\n $input: UpdateWebhookConfigurationInput!\n) {\n updateWebhookConfiguration(input: $input) {\n webhookConfiguration {\n id\n endpointUrl\n selectedEvents\n updatedAt\n }\n }\n}\n" + "text": "mutation WebhooksSettingsPage_updateMutation(\n $input: UpdateWebhookSubscriptionInput!\n) {\n updateWebhookSubscription(input: $input) {\n webhookSubscription {\n id\n endpointUrl\n selectedEvents\n updatedAt\n }\n }\n}\n" } }; })(); -(node as any).hash = "f974aae43d0ad8b5fe3cab60bd07a3ff"; +(node as any).hash = "f4c0f7667d77b64c41e436a7b5df6df5"; export default node; diff --git a/apps/console/src/pages/organizations/settings/WebhooksSettingsPage.tsx b/apps/console/src/pages/organizations/settings/WebhooksSettingsPage.tsx index 4c202e515..4d390fe20 100644 --- a/apps/console/src/pages/organizations/settings/WebhooksSettingsPage.tsx +++ b/apps/console/src/pages/organizations/settings/WebhooksSettingsPage.tsx @@ -38,8 +38,8 @@ export const webhooksSettingsPageQuery = graphql` __typename ... on Organization { id - webhookConfigurations(first: 50) - @connection(key: "WebhooksSettingsPage_webhookConfigurations") { + webhookSubscriptions(first: 50) + @connection(key: "WebhooksSettingsPage_webhookSubscriptions") { edges { node { id @@ -56,29 +56,32 @@ export const webhooksSettingsPageQuery = graphql` } `; -const createWebhookConfigurationMutation = graphql` +const createWebhookSubscriptionMutation = graphql` mutation WebhooksSettingsPage_createMutation( - $input: CreateWebhookConfigurationInput! + $input: CreateWebhookSubscriptionInput! $connections: [ID!]! ) { - createWebhookConfiguration(input: $input) { - webhookConfigurationEdge @prependEdge(connections: $connections) { + createWebhookSubscription(input: $input) { + webhookSubscriptionEdge @prependEdge(connections: $connections) { node { id endpointUrl selectedEvents + events(first: 0) { + totalCount + } } } } } `; -const updateWebhookConfigurationMutation = graphql` +const updateWebhookSubscriptionMutation = graphql` mutation WebhooksSettingsPage_updateMutation( - $input: UpdateWebhookConfigurationInput! + $input: UpdateWebhookSubscriptionInput! ) { - updateWebhookConfiguration(input: $input) { - webhookConfiguration { + updateWebhookSubscription(input: $input) { + webhookSubscription { id endpointUrl selectedEvents @@ -89,9 +92,9 @@ const updateWebhookConfigurationMutation = graphql` `; const signingSecretQuery = graphql` - query WebhooksSettingsPage_signingSecretQuery($webhookConfigurationId: ID!) { - node(id: $webhookConfigurationId) { - ... on WebhookConfiguration { + query WebhooksSettingsPage_signingSecretQuery($webhookSubscriptionId: ID!) { + node(id: $webhookSubscriptionId) { + ... on WebhookSubscription { signingSecret } } @@ -100,12 +103,12 @@ const signingSecretQuery = graphql` const webhookEventsQuery = graphql` query WebhooksSettingsPage_eventsQuery( - $webhookConfigurationId: ID! + $webhookSubscriptionId: ID! $first: Int $after: CursorKey ) { - node(id: $webhookConfigurationId) { - ... on WebhookConfiguration { + node(id: $webhookSubscriptionId) { + ... on WebhookSubscription { events(first: $first, after: $after) { totalCount pageInfo { @@ -126,13 +129,13 @@ const webhookEventsQuery = graphql` } `; -const deleteWebhookConfigurationMutation = graphql` +const deleteWebhookSubscriptionMutation = graphql` mutation WebhooksSettingsPage_deleteMutation( - $input: DeleteWebhookConfigurationInput! + $input: DeleteWebhookSubscriptionInput! $connections: [ID!]! ) { - deleteWebhookConfiguration(input: $input) { - deletedWebhookConfigurationId @deleteEdge(connections: $connections) + deleteWebhookSubscription(input: $input) { + deletedWebhookSubscriptionId @deleteEdge(connections: $connections) } } `; @@ -221,8 +224,8 @@ function WebhookFormDialog({ trigger={trigger} title={ mode === "create" - ? __("Add Webhook Configuration") - : __("Edit Webhook Configuration") + ? __("Add Webhook Subscription") + : __("Edit Webhook Subscription") } className="max-w-lg" > @@ -300,11 +303,11 @@ function formatDate(iso: string) { } function WebhookEventsDialog({ - webhookConfigurationId, + webhookSubscriptionId, endpointUrl, onClose, }: { - webhookConfigurationId: string; + webhookSubscriptionId: string; endpointUrl: string; onClose: () => void; }) { @@ -329,7 +332,7 @@ function WebhookEventsDialog({ environment, webhookEventsQuery, { - webhookConfigurationId, + webhookSubscriptionId, first: PAGE_SIZE, after: after ?? null, }, @@ -353,7 +356,7 @@ function WebhookEventsDialog({ setLoading(false); } }, - [environment, webhookConfigurationId, toast, __], + [environment, webhookSubscriptionId, toast, __], ); useEffect(() => { @@ -450,24 +453,24 @@ export function WebhooksSettingsPage(props: { const [viewingEventsId, setViewingEventsId] = useState(null); const fetchSigningSecret = useCallback( - async (webhookConfigurationId: string): Promise => { + async (webhookSubscriptionId: string): Promise => { // Return cached secret if already fetched - if (revealedSecrets[webhookConfigurationId]) { - return revealedSecrets[webhookConfigurationId]; + if (revealedSecrets[webhookSubscriptionId]) { + return revealedSecrets[webhookSubscriptionId]; } - setLoadingSecrets(prev => new Set(prev).add(webhookConfigurationId)); + setLoadingSecrets(prev => new Set(prev).add(webhookSubscriptionId)); try { const data = await fetchQuery( environment, signingSecretQuery, - { webhookConfigurationId }, + { webhookSubscriptionId }, ).toPromise(); const secret = data?.node?.signingSecret; if (secret) { - setRevealedSecrets(prev => ({ ...prev, [webhookConfigurationId]: secret })); + setRevealedSecrets(prev => ({ ...prev, [webhookSubscriptionId]: secret })); return secret; } return null; @@ -481,7 +484,7 @@ export function WebhooksSettingsPage(props: { } finally { setLoadingSecrets((prev) => { const next = new Set(prev); - next.delete(webhookConfigurationId); + next.delete(webhookSubscriptionId); return next; }); } @@ -501,8 +504,8 @@ export function WebhooksSettingsPage(props: { } }; - const copyToClipboard = async (webhookConfigurationId: string, label: string) => { - const secret = await fetchSigningSecret(webhookConfigurationId); + const copyToClipboard = async (webhookSubscriptionId: string, label: string) => { + const secret = await fetchSigningSecret(webhookSubscriptionId); if (secret) { void navigator.clipboard.writeText(secret); toast({ @@ -523,7 +526,7 @@ export function WebhooksSettingsPage(props: { const [createWebhook, isCreating] = useMutationWithToasts( - createWebhookConfigurationMutation, + createWebhookSubscriptionMutation, { successMessage: __("Webhook created successfully"), errorMessage: __("Failed to create webhook"), @@ -532,7 +535,7 @@ export function WebhooksSettingsPage(props: { const [updateWebhook, isUpdating] = useMutationWithToasts( - updateWebhookConfigurationMutation, + updateWebhookSubscriptionMutation, { successMessage: __("Webhook updated successfully"), errorMessage: __("Failed to update webhook"), @@ -541,21 +544,21 @@ export function WebhooksSettingsPage(props: { const [deleteWebhook, isDeleting] = useMutationWithToasts( - deleteWebhookConfigurationMutation, + deleteWebhookSubscriptionMutation, { successMessage: __("Webhook deleted successfully"), errorMessage: __("Failed to delete webhook"), }, ); - const webhooks = organization.webhookConfigurations?.edges ?? []; + const webhooks = organization.webhookSubscriptions?.edges ?? []; const viewingEventsWebhook = viewingEventsId ? webhooks.find(e => e.node.id === viewingEventsId)?.node ?? null : null; const connectionId = ConnectionHandler.getConnectionID( organization.id, - "WebhooksSettingsPage_webhookConfigurations", + "WebhooksSettingsPage_webhookSubscriptions", ); const handleCreate = (values: WebhookFormData) => { @@ -587,7 +590,7 @@ export function WebhooksSettingsPage(props: { void deleteWebhook({ variables: { input: { - webhookConfigurationId: id, + webhookSubscriptionId: id, }, connections: [connectionId], }, @@ -602,7 +605,7 @@ export function WebhooksSettingsPage(props: {
-

{__("Webhook Configurations")}

+

{__("Webhook Subscriptions")}

{__( "Configure webhooks to receive notifications when events occur in your organization.", @@ -615,7 +618,7 @@ export function WebhooksSettingsPage(props: { isSubmitting={isCreating} trigger={( )} /> @@ -626,7 +629,7 @@ export function WebhooksSettingsPage(props: {

- {__("No webhook configurations yet. Add one to get started.")} + {__("No webhook subscriptions yet. Add one to get started.")}

@@ -737,7 +740,7 @@ export function WebhooksSettingsPage(props: {

{__( - "Are you sure you want to delete this webhook configuration?", + "Are you sure you want to delete this webhook subscription?", )}

@@ -766,7 +769,7 @@ export function WebhooksSettingsPage(props: { {viewingEventsWebhook && viewingEventsId && ( setViewingEventsId(null)} /> diff --git a/pkg/coredata/entity_type_reg.go b/pkg/coredata/entity_type_reg.go index 9cc752060..2125eb907 100644 --- a/pkg/coredata/entity_type_reg.go +++ b/pkg/coredata/entity_type_reg.go @@ -79,7 +79,7 @@ const ( SCIMEventEntityType uint16 = 53 TokenEntityType uint16 = 54 SCIMBridgeEntityType uint16 = 55 - WebhookConfigurationEntityType uint16 = 56 + WebhookSubscriptionEntityType uint16 = 56 WebhookDataEntityType uint16 = 57 WebhookEventEntityType uint16 = 58 ) @@ -194,8 +194,8 @@ func NewEntityFromID(id gid.GID) (any, bool) { return &Token{ID: id}, true case SCIMBridgeEntityType: return &SCIMBridge{ID: id}, true - case WebhookConfigurationEntityType: - return &WebhookConfiguration{ID: id}, true + case WebhookSubscriptionEntityType: + return &WebhookSubscription{ID: id}, true case WebhookDataEntityType: return &WebhookData{ID: id}, true case WebhookEventEntityType: diff --git a/pkg/coredata/migrations/20260210T135740Z.sql b/pkg/coredata/migrations/20260210T135740Z.sql index 961f0e68f..6b8b12710 100644 --- a/pkg/coredata/migrations/20260210T135740Z.sql +++ b/pkg/coredata/migrations/20260210T135740Z.sql @@ -7,7 +7,7 @@ CREATE TYPE webhook_event_type AS ENUM ( 'vendor:deleted' ); -CREATE TABLE webhook_configurations ( +CREATE TABLE webhook_subscriptions ( id TEXT PRIMARY KEY, tenant_id TEXT NOT NULL, organization_id TEXT NOT NULL REFERENCES organizations(id) ON UPDATE CASCADE ON DELETE CASCADE, @@ -38,7 +38,7 @@ CREATE TABLE webhook_events ( id TEXT PRIMARY KEY, tenant_id TEXT NOT NULL, 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_subscription_id TEXT NOT NULL REFERENCES webhook_subscriptions(id) ON UPDATE CASCADE ON DELETE CASCADE, status webhook_event_status NOT NULL, response JSONB, created_at TIMESTAMP WITH TIME ZONE NOT NULL diff --git a/pkg/coredata/webhook_event.go b/pkg/coredata/webhook_event.go index a5fcc84c1..23a80b4aa 100644 --- a/pkg/coredata/webhook_event.go +++ b/pkg/coredata/webhook_event.go @@ -31,7 +31,7 @@ type ( WebhookEvent struct { ID gid.GID `db:"id"` WebhookDataID gid.GID `db:"webhook_data_id"` - WebhookConfigurationID gid.GID `db:"webhook_configuration_id"` + WebhookSubscriptionID gid.GID `db:"webhook_subscription_id"` Status WebhookEventStatus `db:"status"` Response json.RawMessage `db:"response"` CreatedAt time.Time `db:"created_at"` @@ -49,18 +49,18 @@ func (w WebhookEvent) CursorKey(orderBy WebhookEventOrderField) page.CursorKey { panic(fmt.Sprintf("unsupported order by: %s", orderBy)) } -func (w *WebhookEvents) LoadByConfigurationID( +func (w *WebhookEvents) LoadBySubscriptionID( ctx context.Context, conn pg.Conn, scope Scoper, - webhookConfigurationID gid.GID, + webhookSubscriptionID gid.GID, cursor *page.Cursor[WebhookEventOrderField], ) error { q := ` SELECT id, webhook_data_id, - webhook_configuration_id, + webhook_subscription_id, status, response, created_at @@ -68,12 +68,12 @@ FROM webhook_events WHERE %s - AND webhook_configuration_id = @webhook_configuration_id + AND webhook_subscription_id = @webhook_subscription_id AND %s ` q = fmt.Sprintf(q, scope.SQLFragment(), cursor.SQLFragment()) - args := pgx.NamedArgs{"webhook_configuration_id": webhookConfigurationID} + args := pgx.NamedArgs{"webhook_subscription_id": webhookSubscriptionID} maps.Copy(args, scope.SQLArguments()) maps.Copy(args, cursor.SQLArguments()) @@ -91,21 +91,21 @@ WHERE return nil } -func (w *WebhookEvents) CountByConfigurationID( +func (w *WebhookEvents) CountBySubscriptionID( ctx context.Context, conn pg.Conn, scope Scoper, - webhookConfigurationID gid.GID, + webhookSubscriptionID gid.GID, ) (int, error) { q := ` SELECT COUNT(*) FROM webhook_events WHERE %s - AND webhook_configuration_id = @webhook_configuration_id + AND webhook_subscription_id = @webhook_subscription_id ` q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{"webhook_configuration_id": webhookConfigurationID} + args := pgx.StrictNamedArgs{"webhook_subscription_id": webhookSubscriptionID} maps.Copy(args, scope.SQLArguments()) var count int @@ -126,7 +126,7 @@ INSERT INTO webhook_events ( id, tenant_id, webhook_data_id, - webhook_configuration_id, + webhook_subscription_id, status, response, created_at @@ -135,7 +135,7 @@ VALUES ( @id, @tenant_id, @webhook_data_id, - @webhook_configuration_id, + @webhook_subscription_id, @status, @response, @created_at @@ -146,7 +146,7 @@ VALUES ( "id": w.ID, "tenant_id": scope.GetTenantID(), "webhook_data_id": w.WebhookDataID, - "webhook_configuration_id": w.WebhookConfigurationID, + "webhook_subscription_id": w.WebhookSubscriptionID, "status": w.Status, "response": w.Response, "created_at": w.CreatedAt, diff --git a/pkg/coredata/webhook_configuration.go b/pkg/coredata/webhook_subscription.go similarity index 68% rename from pkg/coredata/webhook_configuration.go rename to pkg/coredata/webhook_subscription.go index c8ea7bccf..d91f20501 100644 --- a/pkg/coredata/webhook_configuration.go +++ b/pkg/coredata/webhook_subscription.go @@ -31,7 +31,7 @@ import ( ) type ( - WebhookConfiguration struct { + WebhookSubscription struct { ID gid.GID `db:"id"` OrganizationID gid.GID `db:"organization_id"` EndpointURL string `db:"endpoint_url"` @@ -41,10 +41,10 @@ type ( UpdatedAt time.Time `db:"updated_at"` } - WebhookConfigurations []*WebhookConfiguration + WebhookSubscriptions []*WebhookSubscription ) -func (w *WebhookConfiguration) GenerateSigningSecret(encryptionKey cipher.EncryptionKey) (string, error) { +func (w *WebhookSubscription) GenerateSigningSecret(encryptionKey cipher.EncryptionKey) (string, error) { secret := make([]byte, 32) if _, err := rand.Read(secret); err != nil { return "", fmt.Errorf("cannot generate signing secret: %w", err) @@ -62,7 +62,7 @@ func (w *WebhookConfiguration) GenerateSigningSecret(encryptionKey cipher.Encryp return signingSecret, nil } -func (w *WebhookConfiguration) DecryptSigningSecret(encryptionKey cipher.EncryptionKey) (string, error) { +func (w *WebhookSubscription) DecryptSigningSecret(encryptionKey cipher.EncryptionKey) (string, error) { if len(w.EncryptedSigningSecret) == 0 { return "", fmt.Errorf("no encrypted signing secret") } @@ -75,9 +75,9 @@ func (w *WebhookConfiguration) DecryptSigningSecret(encryptionKey cipher.Encrypt return string(plaintext), nil } -func (w WebhookConfiguration) CursorKey(orderBy WebhookConfigurationOrderField) page.CursorKey { +func (w WebhookSubscription) CursorKey(orderBy WebhookSubscriptionOrderField) page.CursorKey { switch orderBy { - case WebhookConfigurationOrderFieldCreatedAt: + case WebhookSubscriptionOrderFieldCreatedAt: return page.NewCursorKey(w.ID, w.CreatedAt) } @@ -85,25 +85,25 @@ func (w WebhookConfiguration) CursorKey(orderBy WebhookConfigurationOrderField) } // AuthorizationAttributes returns the authorization attributes for policy evaluation. -func (w *WebhookConfiguration) AuthorizationAttributes(ctx context.Context, conn pg.Conn) (map[string]string, error) { - q := `SELECT organization_id FROM webhook_configurations WHERE id = $1 LIMIT 1;` +func (w *WebhookSubscription) AuthorizationAttributes(ctx context.Context, conn pg.Conn) (map[string]string, error) { + q := `SELECT organization_id FROM webhook_subscriptions WHERE id = $1 LIMIT 1;` var organizationID gid.GID if err := conn.QueryRow(ctx, q, w.ID).Scan(&organizationID); err != nil { if errors.Is(err, pgx.ErrNoRows) { return nil, ErrResourceNotFound } - return nil, fmt.Errorf("cannot query webhook configuration authorization attributes: %w", err) + return nil, fmt.Errorf("cannot query webhook subscription authorization attributes: %w", err) } return map[string]string{"organization_id": organizationID.String()}, nil } -func (w *WebhookConfiguration) LoadByID( +func (w *WebhookSubscription) LoadByID( ctx context.Context, conn pg.Conn, scope Scoper, - webhookConfigurationID gid.GID, + webhookSubscriptionID gid.GID, ) error { q := ` SELECT @@ -115,42 +115,42 @@ SELECT created_at, updated_at FROM - webhook_configurations + webhook_subscriptions WHERE %s - AND id = @webhook_configuration_id + AND id = @webhook_subscription_id LIMIT 1; ` q = fmt.Sprintf(q, scope.SQLFragment()) - args := pgx.StrictNamedArgs{"webhook_configuration_id": webhookConfigurationID} + args := pgx.StrictNamedArgs{"webhook_subscription_id": webhookSubscriptionID} maps.Copy(args, scope.SQLArguments()) rows, err := conn.Query(ctx, q, args) if err != nil { - return fmt.Errorf("cannot query webhook configurations: %w", err) + return fmt.Errorf("cannot query webhook subscriptions: %w", err) } - wc, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[WebhookConfiguration]) + wc, err := pgx.CollectExactlyOneRow(rows, pgx.RowToStructByName[WebhookSubscription]) if err != nil { if errors.Is(err, pgx.ErrNoRows) { return ErrResourceNotFound } - return fmt.Errorf("cannot collect webhook configuration: %w", err) + return fmt.Errorf("cannot collect webhook subscription: %w", err) } *w = wc return nil } -func (w *WebhookConfigurations) LoadByOrganizationID( +func (w *WebhookSubscriptions) LoadByOrganizationID( ctx context.Context, conn pg.Conn, scope Scoper, organizationID gid.GID, - cursor *page.Cursor[WebhookConfigurationOrderField], + cursor *page.Cursor[WebhookSubscriptionOrderField], ) error { q := ` SELECT @@ -162,7 +162,7 @@ SELECT created_at, updated_at FROM - webhook_configurations + webhook_subscriptions WHERE %s AND organization_id = @organization_id @@ -176,19 +176,19 @@ WHERE rows, err := conn.Query(ctx, q, args) if err != nil { - return fmt.Errorf("cannot query webhook configurations: %w", err) + return fmt.Errorf("cannot query webhook subscriptions: %w", err) } - configurations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[WebhookConfiguration]) + subscriptions, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[WebhookSubscription]) if err != nil { - return fmt.Errorf("cannot collect webhook configurations: %w", err) + return fmt.Errorf("cannot collect webhook subscriptions: %w", err) } - *w = configurations + *w = subscriptions return nil } -func (w *WebhookConfigurations) CountByOrganizationID( +func (w *WebhookSubscriptions) CountByOrganizationID( ctx context.Context, conn pg.Conn, scope Scoper, @@ -198,7 +198,7 @@ func (w *WebhookConfigurations) CountByOrganizationID( SELECT COUNT(*) FROM - webhook_configurations + webhook_subscriptions WHERE %s AND organization_id = @organization_id @@ -213,13 +213,13 @@ WHERE row := conn.QueryRow(ctx, q, args) var count int if err := row.Scan(&count); err != nil { - return 0, fmt.Errorf("cannot count webhook configurations: %w", err) + return 0, fmt.Errorf("cannot count webhook subscriptions: %w", err) } return count, nil } -func (w *WebhookConfigurations) ExistsByOrganizationIDAndEventType( +func (w *WebhookSubscriptions) ExistsByOrganizationIDAndEventType( ctx context.Context, conn pg.Conn, scope Scoper, @@ -229,7 +229,7 @@ func (w *WebhookConfigurations) ExistsByOrganizationIDAndEventType( q := ` SELECT EXISTS ( SELECT 1 - FROM webhook_configurations + FROM webhook_subscriptions WHERE %s AND organization_id = @organization_id AND @event_type = ANY(selected_events) @@ -245,20 +245,20 @@ SELECT EXISTS ( var exists bool if err := conn.QueryRow(ctx, q, args).Scan(&exists); err != nil { - return false, fmt.Errorf("cannot check webhook configuration existence: %w", err) + return false, fmt.Errorf("cannot check webhook subscription existence: %w", err) } return exists, nil } -func (w *WebhookConfiguration) Insert( +func (w *WebhookSubscription) Insert( ctx context.Context, conn pg.Conn, scope Scoper, ) error { q := ` INSERT INTO - webhook_configurations ( + webhook_subscriptions ( tenant_id, id, organization_id, @@ -270,7 +270,7 @@ INSERT INTO ) VALUES ( @tenant_id, - @webhook_configuration_id, + @webhook_subscription_id, @organization_id, @endpoint_url, @selected_events, @@ -281,52 +281,52 @@ VALUES ( ` args := pgx.StrictNamedArgs{ - "tenant_id": scope.GetTenantID(), - "webhook_configuration_id": w.ID, - "organization_id": w.OrganizationID, - "endpoint_url": w.EndpointURL, - "selected_events": w.SelectedEvents, + "tenant_id": scope.GetTenantID(), + "webhook_subscription_id": w.ID, + "organization_id": w.OrganizationID, + "endpoint_url": w.EndpointURL, + "selected_events": w.SelectedEvents, "encrypted_signing_secret": w.EncryptedSigningSecret, - "created_at": w.CreatedAt, - "updated_at": w.UpdatedAt, + "created_at": w.CreatedAt, + "updated_at": w.UpdatedAt, } _, err := conn.Exec(ctx, q, args) if err != nil { - return fmt.Errorf("cannot insert webhook configuration: %w", err) + return fmt.Errorf("cannot insert webhook subscription: %w", err) } return nil } -func (w *WebhookConfiguration) Update( +func (w *WebhookSubscription) Update( ctx context.Context, conn pg.Conn, scope Scoper, ) error { q := ` -UPDATE webhook_configurations +UPDATE webhook_subscriptions SET endpoint_url = @endpoint_url, selected_events = @selected_events, updated_at = @updated_at WHERE %s - AND id = @webhook_configuration_id + AND id = @webhook_subscription_id ` q = fmt.Sprintf(q, scope.SQLFragment()) args := pgx.StrictNamedArgs{ - "webhook_configuration_id": w.ID, - "endpoint_url": w.EndpointURL, - "selected_events": w.SelectedEvents, - "updated_at": w.UpdatedAt, + "webhook_subscription_id": w.ID, + "endpoint_url": w.EndpointURL, + "selected_events": w.SelectedEvents, + "updated_at": w.UpdatedAt, } maps.Copy(args, scope.SQLArguments()) result, err := conn.Exec(ctx, q, args) if err != nil { - return fmt.Errorf("cannot update webhook configuration: %w", err) + return fmt.Errorf("cannot update webhook subscription: %w", err) } if result.RowsAffected() == 0 { @@ -336,7 +336,7 @@ WHERE %s return nil } -func (w *WebhookConfigurations) LoadMatchingByOrganizationIDAndEventType( +func (w *WebhookSubscriptions) LoadMatchingByOrganizationIDAndEventType( ctx context.Context, conn pg.Conn, scope Scoper, @@ -353,7 +353,7 @@ SELECT created_at, updated_at FROM - webhook_configurations + webhook_subscriptions WHERE %s AND organization_id = @organization_id @@ -369,38 +369,38 @@ WHERE rows, err := conn.Query(ctx, q, args) if err != nil { - return fmt.Errorf("cannot query matching webhook configurations: %w", err) + return fmt.Errorf("cannot query matching webhook subscriptions: %w", err) } - configurations, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[WebhookConfiguration]) + subscriptions, err := pgx.CollectRows(rows, pgx.RowToAddrOfStructByName[WebhookSubscription]) if err != nil { - return fmt.Errorf("cannot collect matching webhook configurations: %w", err) + return fmt.Errorf("cannot collect matching webhook subscriptions: %w", err) } - *w = configurations + *w = subscriptions return nil } -func (w *WebhookConfiguration) Delete( +func (w *WebhookSubscription) Delete( ctx context.Context, conn pg.Conn, scope Scoper, ) error { q := ` -DELETE FROM webhook_configurations +DELETE FROM webhook_subscriptions WHERE %s - AND id = @webhook_configuration_id + AND id = @webhook_subscription_id ` q = fmt.Sprintf(q, scope.SQLFragment()) args := pgx.StrictNamedArgs{ - "webhook_configuration_id": w.ID, + "webhook_subscription_id": w.ID, } maps.Copy(args, scope.SQLArguments()) result, err := conn.Exec(ctx, q, args) if err != nil { - return fmt.Errorf("cannot delete webhook configuration: %w", err) + return fmt.Errorf("cannot delete webhook subscription: %w", err) } if result.RowsAffected() == 0 { diff --git a/pkg/coredata/webhook_configuration_order_field.go b/pkg/coredata/webhook_subscription_order_field.go similarity index 61% rename from pkg/coredata/webhook_configuration_order_field.go rename to pkg/coredata/webhook_subscription_order_field.go index edf0adc63..223ed9cb1 100644 --- a/pkg/coredata/webhook_configuration_order_field.go +++ b/pkg/coredata/webhook_subscription_order_field.go @@ -19,37 +19,37 @@ import ( ) type ( - WebhookConfigurationOrderField string + WebhookSubscriptionOrderField string ) const ( - WebhookConfigurationOrderFieldCreatedAt WebhookConfigurationOrderField = "CREATED_AT" + WebhookSubscriptionOrderFieldCreatedAt WebhookSubscriptionOrderField = "CREATED_AT" ) -func (p WebhookConfigurationOrderField) Column() string { +func (p WebhookSubscriptionOrderField) Column() string { return string(p) } -func (p WebhookConfigurationOrderField) String() string { +func (p WebhookSubscriptionOrderField) String() string { return string(p) } -func (p WebhookConfigurationOrderField) IsValid() bool { +func (p WebhookSubscriptionOrderField) IsValid() bool { switch p { - case WebhookConfigurationOrderFieldCreatedAt: + case WebhookSubscriptionOrderFieldCreatedAt: return true } return false } -func (p WebhookConfigurationOrderField) MarshalText() ([]byte, error) { +func (p WebhookSubscriptionOrderField) MarshalText() ([]byte, error) { return []byte(p.String()), nil } -func (p *WebhookConfigurationOrderField) UnmarshalText(text []byte) error { - *p = WebhookConfigurationOrderField(text) +func (p *WebhookSubscriptionOrderField) UnmarshalText(text []byte) error { + *p = WebhookSubscriptionOrderField(text) if !p.IsValid() { - return fmt.Errorf("%s is not a valid WebhookConfigurationOrderField", string(text)) + return fmt.Errorf("%s is not a valid WebhookSubscriptionOrderField", string(text)) } return nil } diff --git a/pkg/probo/actions.go b/pkg/probo/actions.go index 9b0e0c50b..a5f433ab2 100644 --- a/pkg/probo/actions.go +++ b/pkg/probo/actions.go @@ -317,10 +317,10 @@ const ( ActionApplicabilityStatementUpdate = "core:applicability-statement:update" ActionApplicabilityStatementDelete = "core:applicability-statement:delete" - // WebhookConfiguration actions - ActionWebhookConfigurationList = "core:webhook-configuration:list" - ActionWebhookConfigurationGet = "core:webhook-configuration:get" - ActionWebhookConfigurationCreate = "core:webhook-configuration:create" - ActionWebhookConfigurationUpdate = "core:webhook-configuration:update" - ActionWebhookConfigurationDelete = "core:webhook-configuration:delete" + // WebhookSubscription actions + ActionWebhookSubscriptionList = "core:webhook-subscription:list" + ActionWebhookSubscriptionGet = "core:webhook-subscription:get" + ActionWebhookSubscriptionCreate = "core:webhook-subscription:create" + ActionWebhookSubscriptionUpdate = "core:webhook-subscription:update" + ActionWebhookSubscriptionDelete = "core:webhook-subscription:delete" ) diff --git a/pkg/probo/policies.go b/pkg/probo/policies.go index 8ac03f78b..30bdd4b06 100644 --- a/pkg/probo/policies.go +++ b/pkg/probo/policies.go @@ -79,7 +79,7 @@ var ViewerPolicy = policy.NewPolicy( ActionRightsRequestGet, ActionRightsRequestList, ActionStateOfApplicabilityGet, ActionStateOfApplicabilityList, ActionApplicabilityStatementGet, ActionApplicabilityStatementList, - ActionWebhookConfigurationGet, ActionWebhookConfigurationList, + ActionWebhookSubscriptionGet, ActionWebhookSubscriptionList, ).WithSID("entity-read-access").When(organizationCondition), policy.Allow( diff --git a/pkg/probo/service.go b/pkg/probo/service.go index 772ad48d1..ae117f5bf 100644 --- a/pkg/probo/service.go +++ b/pkg/probo/service.go @@ -92,7 +92,7 @@ type ( Data *DatumService Audits *AuditService Meetings *MeetingService - WebhookConfigurations *WebhookConfigurationService + WebhookSubscriptions *WebhookSubscriptionService Reports *ReportService TrustCenters *TrustCenterService TrustCenterAccesses *TrustCenterAccessService @@ -214,7 +214,7 @@ func (s *Service) WithTenant(tenantID gid.TenantID) *TenantService { tenantService.Data = &DatumService{svc: tenantService} tenantService.Audits = &AuditService{svc: tenantService} tenantService.Meetings = &MeetingService{svc: tenantService} - tenantService.WebhookConfigurations = &WebhookConfigurationService{svc: tenantService} + tenantService.WebhookSubscriptions = &WebhookSubscriptionService{svc: tenantService} tenantService.Reports = &ReportService{svc: tenantService} tenantService.TrustCenters = &TrustCenterService{svc: tenantService} tenantService.TrustCenterAccesses = &TrustCenterAccessService{svc: tenantService} diff --git a/pkg/probo/webhook_configuration_service.go b/pkg/probo/webhook_subscription_service.go similarity index 60% rename from pkg/probo/webhook_configuration_service.go rename to pkg/probo/webhook_subscription_service.go index 0a86d922d..050a380a0 100644 --- a/pkg/probo/webhook_configuration_service.go +++ b/pkg/probo/webhook_subscription_service.go @@ -26,25 +26,25 @@ import ( "go.probo.inc/probo/pkg/validator" ) -type WebhookConfigurationService struct { +type WebhookSubscriptionService struct { svc *TenantService } type ( - CreateWebhookConfigurationRequest struct { + CreateWebhookSubscriptionRequest struct { OrganizationID gid.GID EndpointURL string SelectedEvents []coredata.WebhookEventType } - UpdateWebhookConfigurationRequest struct { - WebhookConfigurationID gid.GID - EndpointURL *string - SelectedEvents []coredata.WebhookEventType + UpdateWebhookSubscriptionRequest struct { + WebhookSubscriptionID gid.GID + EndpointURL *string + SelectedEvents []coredata.WebhookEventType } ) -func (r *CreateWebhookConfigurationRequest) Validate() error { +func (r *CreateWebhookSubscriptionRequest) Validate() error { v := validator.New() v.Check(r.OrganizationID, "organization_id", validator.Required(), validator.GID(coredata.OrganizationEntityType)) @@ -53,21 +53,21 @@ func (r *CreateWebhookConfigurationRequest) Validate() error { return v.Error() } -func (r *UpdateWebhookConfigurationRequest) Validate() error { +func (r *UpdateWebhookSubscriptionRequest) Validate() error { v := validator.New() - v.Check(r.WebhookConfigurationID, "webhook_configuration_id", validator.Required(), validator.GID(coredata.WebhookConfigurationEntityType)) + v.Check(r.WebhookSubscriptionID, "webhook_subscription_id", validator.Required(), validator.GID(coredata.WebhookSubscriptionEntityType)) v.Check(r.EndpointURL, "endpoint_url", validator.NotEmpty(), validator.HTTPSUrl()) return v.Error() } -func (s WebhookConfigurationService) ListForOrganizationID( +func (s WebhookSubscriptionService) ListForOrganizationID( ctx context.Context, organizationID gid.GID, - cursor *page.Cursor[coredata.WebhookConfigurationOrderField], -) (*page.Page[*coredata.WebhookConfiguration, coredata.WebhookConfigurationOrderField], error) { - var configurations coredata.WebhookConfigurations + cursor *page.Cursor[coredata.WebhookSubscriptionOrderField], +) (*page.Page[*coredata.WebhookSubscription, coredata.WebhookSubscriptionOrderField], error) { + var subscriptions coredata.WebhookSubscriptions organization := &coredata.Organization{} err := s.svc.pg.WithConn( @@ -77,7 +77,7 @@ func (s WebhookConfigurationService) ListForOrganizationID( return fmt.Errorf("cannot load organization: %w", err) } - err := configurations.LoadByOrganizationID( + err := subscriptions.LoadByOrganizationID( ctx, conn, s.svc.scope, @@ -85,7 +85,7 @@ func (s WebhookConfigurationService) ListForOrganizationID( cursor, ) if err != nil { - return fmt.Errorf("cannot load webhook configurations: %w", err) + return fmt.Errorf("cannot load webhook subscriptions: %w", err) } return nil @@ -96,10 +96,10 @@ func (s WebhookConfigurationService) ListForOrganizationID( return nil, err } - return page.NewPage(configurations, cursor), nil + return page.NewPage(subscriptions, cursor), nil } -func (s WebhookConfigurationService) CountForOrganizationID( +func (s WebhookSubscriptionService) CountForOrganizationID( ctx context.Context, organizationID gid.GID, ) (int, error) { @@ -108,10 +108,10 @@ func (s WebhookConfigurationService) CountForOrganizationID( err := s.svc.pg.WithConn( ctx, func(conn pg.Conn) (err error) { - configurations := &coredata.WebhookConfigurations{} - count, err = configurations.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID) + subscriptions := &coredata.WebhookSubscriptions{} + count, err = subscriptions.CountByOrganizationID(ctx, conn, s.svc.scope, organizationID) if err != nil { - return fmt.Errorf("cannot count webhook configurations: %w", err) + return fmt.Errorf("cannot count webhook subscriptions: %w", err) } return nil @@ -125,17 +125,17 @@ func (s WebhookConfigurationService) CountForOrganizationID( return count, nil } -func (s WebhookConfigurationService) Get( +func (s WebhookSubscriptionService) Get( ctx context.Context, - webhookConfigurationID gid.GID, -) (*coredata.WebhookConfiguration, error) { - wc := &coredata.WebhookConfiguration{} + webhookSubscriptionID gid.GID, +) (*coredata.WebhookSubscription, error) { + wc := &coredata.WebhookSubscription{} err := s.svc.pg.WithConn( ctx, func(conn pg.Conn) error { - if err := wc.LoadByID(ctx, conn, s.svc.scope, webhookConfigurationID); err != nil { - return fmt.Errorf("cannot load webhook configuration: %w", err) + if err := wc.LoadByID(ctx, conn, s.svc.scope, webhookSubscriptionID); err != nil { + return fmt.Errorf("cannot load webhook subscription: %w", err) } return nil @@ -149,16 +149,16 @@ func (s WebhookConfigurationService) Get( return wc, nil } -func (s WebhookConfigurationService) Create( +func (s WebhookSubscriptionService) Create( ctx context.Context, - req CreateWebhookConfigurationRequest, -) (*coredata.WebhookConfiguration, error) { + req CreateWebhookSubscriptionRequest, +) (*coredata.WebhookSubscription, error) { if err := req.Validate(); err != nil { return nil, err } now := time.Now() - var wc *coredata.WebhookConfiguration + var wc *coredata.WebhookSubscription organization := &coredata.Organization{} err := s.svc.pg.WithTx( @@ -168,8 +168,8 @@ func (s WebhookConfigurationService) Create( return fmt.Errorf("cannot load organization: %w", err) } - wc = &coredata.WebhookConfiguration{ - ID: gid.New(organization.ID.TenantID(), coredata.WebhookConfigurationEntityType), + wc = &coredata.WebhookSubscription{ + ID: gid.New(organization.ID.TenantID(), coredata.WebhookSubscriptionEntityType), OrganizationID: organization.ID, EndpointURL: req.EndpointURL, SelectedEvents: req.SelectedEvents, @@ -182,7 +182,7 @@ func (s WebhookConfigurationService) Create( } if err := wc.Insert(ctx, conn, s.svc.scope); err != nil { - return fmt.Errorf("cannot insert webhook configuration: %w", err) + return fmt.Errorf("cannot insert webhook subscription: %w", err) } return nil @@ -196,21 +196,21 @@ func (s WebhookConfigurationService) Create( return wc, nil } -func (s WebhookConfigurationService) Update( +func (s WebhookSubscriptionService) Update( ctx context.Context, - req UpdateWebhookConfigurationRequest, -) (*coredata.WebhookConfiguration, error) { + req UpdateWebhookSubscriptionRequest, +) (*coredata.WebhookSubscription, error) { if err := req.Validate(); err != nil { return nil, err } - wc := &coredata.WebhookConfiguration{} + wc := &coredata.WebhookSubscription{} err := s.svc.pg.WithTx( ctx, func(conn pg.Conn) error { - if err := wc.LoadByID(ctx, conn, s.svc.scope, req.WebhookConfigurationID); err != nil { - return fmt.Errorf("cannot load webhook configuration: %w", err) + if err := wc.LoadByID(ctx, conn, s.svc.scope, req.WebhookSubscriptionID); err != nil { + return fmt.Errorf("cannot load webhook subscription: %w", err) } if req.EndpointURL != nil { @@ -223,7 +223,7 @@ func (s WebhookConfigurationService) Update( wc.UpdatedAt = time.Now() if err := wc.Update(ctx, conn, s.svc.scope); err != nil { - return fmt.Errorf("cannot update webhook configuration: %w", err) + return fmt.Errorf("cannot update webhook subscription: %w", err) } return nil @@ -237,17 +237,17 @@ func (s WebhookConfigurationService) Update( return wc, nil } -func (s WebhookConfigurationService) GetSigningSecret( +func (s WebhookSubscriptionService) GetSigningSecret( ctx context.Context, - webhookConfigurationID gid.GID, + webhookSubscriptionID gid.GID, ) (string, error) { - wc := &coredata.WebhookConfiguration{} + wc := &coredata.WebhookSubscription{} err := s.svc.pg.WithConn( ctx, func(conn pg.Conn) error { - if err := wc.LoadByID(ctx, conn, s.svc.scope, webhookConfigurationID); err != nil { - return fmt.Errorf("cannot load webhook configuration: %w", err) + if err := wc.LoadByID(ctx, conn, s.svc.scope, webhookSubscriptionID); err != nil { + return fmt.Errorf("cannot load webhook subscription: %w", err) } return nil @@ -261,9 +261,9 @@ func (s WebhookConfigurationService) GetSigningSecret( return wc.DecryptSigningSecret(s.svc.encryptionKey) } -func (s WebhookConfigurationService) ListEventsForConfigurationID( +func (s WebhookSubscriptionService) ListEventsForSubscriptionID( ctx context.Context, - webhookConfigurationID gid.GID, + webhookSubscriptionID gid.GID, cursor *page.Cursor[coredata.WebhookEventOrderField], ) (*page.Page[*coredata.WebhookEvent, coredata.WebhookEventOrderField], error) { var events coredata.WebhookEvents @@ -271,7 +271,7 @@ func (s WebhookConfigurationService) ListEventsForConfigurationID( err := s.svc.pg.WithConn( ctx, func(conn pg.Conn) error { - if err := events.LoadByConfigurationID(ctx, conn, s.svc.scope, webhookConfigurationID, cursor); err != nil { + if err := events.LoadBySubscriptionID(ctx, conn, s.svc.scope, webhookSubscriptionID, cursor); err != nil { return fmt.Errorf("cannot load webhook events: %w", err) } @@ -286,9 +286,9 @@ func (s WebhookConfigurationService) ListEventsForConfigurationID( return page.NewPage(events, cursor), nil } -func (s WebhookConfigurationService) CountEventsForConfigurationID( +func (s WebhookSubscriptionService) CountEventsForSubscriptionID( ctx context.Context, - webhookConfigurationID gid.GID, + webhookSubscriptionID gid.GID, ) (int, error) { var count int @@ -296,7 +296,7 @@ func (s WebhookConfigurationService) CountEventsForConfigurationID( ctx, func(conn pg.Conn) (err error) { events := &coredata.WebhookEvents{} - count, err = events.CountByConfigurationID(ctx, conn, s.svc.scope, webhookConfigurationID) + count, err = events.CountBySubscriptionID(ctx, conn, s.svc.scope, webhookSubscriptionID) if err != nil { return fmt.Errorf("cannot count webhook events: %w", err) @@ -313,21 +313,21 @@ func (s WebhookConfigurationService) CountEventsForConfigurationID( return count, nil } -func (s WebhookConfigurationService) Delete( +func (s WebhookSubscriptionService) Delete( ctx context.Context, - webhookConfigurationID gid.GID, + webhookSubscriptionID gid.GID, ) error { - wc := &coredata.WebhookConfiguration{ID: webhookConfigurationID} + wc := &coredata.WebhookSubscription{ID: webhookSubscriptionID} err := s.svc.pg.WithTx( ctx, func(conn pg.Conn) error { - if err := wc.LoadByID(ctx, conn, s.svc.scope, webhookConfigurationID); err != nil { - return fmt.Errorf("cannot load webhook configuration: %w", err) + if err := wc.LoadByID(ctx, conn, s.svc.scope, webhookSubscriptionID); err != nil { + return fmt.Errorf("cannot load webhook subscription: %w", err) } if err := wc.Delete(ctx, conn, s.svc.scope); err != nil { - return fmt.Errorf("cannot delete webhook configuration: %w", err) + return fmt.Errorf("cannot delete webhook subscription: %w", err) } return nil diff --git a/pkg/server/api/console/v1/schema.graphql b/pkg/server/api/console/v1/schema.graphql index 6042afeb7..06c68483a 100644 --- a/pkg/server/api/console/v1/schema.graphql +++ b/pkg/server/api/console/v1/schema.graphql @@ -488,13 +488,13 @@ enum MeetingOrderField ) } -enum WebhookConfigurationOrderField +enum WebhookSubscriptionOrderField @goModel( - model: "go.probo.inc/probo/pkg/coredata.WebhookConfigurationOrderField" + model: "go.probo.inc/probo/pkg/coredata.WebhookSubscriptionOrderField" ) { CREATED_AT @goEnum( - value: "go.probo.inc/probo/pkg/coredata.WebhookConfigurationOrderFieldCreatedAt" + value: "go.probo.inc/probo/pkg/coredata.WebhookSubscriptionOrderFieldCreatedAt" ) } @@ -1355,12 +1355,12 @@ input MeetingOrder field: MeetingOrderField! } -input WebhookConfigurationOrder +input WebhookSubscriptionOrder @goModel( - model: "go.probo.inc/probo/pkg/server/api/console/v1/types.WebhookConfigurationOrderBy" + model: "go.probo.inc/probo/pkg/server/api/console/v1/types.WebhookSubscriptionOrderBy" ) { direction: OrderDirection! - field: WebhookConfigurationOrderField! + field: WebhookSubscriptionOrderField! } input RiskOrder @@ -1835,13 +1835,13 @@ type Organization implements Node { customDomain: CustomDomain @goField(forceResolver: true) - webhookConfigurations( + webhookSubscriptions( first: Int after: CursorKey last: Int before: CursorKey - orderBy: WebhookConfigurationOrder - ): WebhookConfigurationConnection! @goField(forceResolver: true) + orderBy: WebhookSubscriptionOrder + ): WebhookSubscriptionConnection! @goField(forceResolver: true) createdAt: Datetime! updatedAt: Datetime! @@ -2284,7 +2284,7 @@ enum WebhookEventType @goEnum(value: "go.probo.inc/probo/pkg/coredata.WebhookEventTypeVendorDeleted") } -type WebhookConfiguration implements Node { +type WebhookSubscription implements Node { id: ID! organization: Organization @goField(forceResolver: true) endpointUrl: String! @@ -2304,18 +2304,18 @@ type WebhookConfiguration implements Node { permission(action: String!): Boolean! @goField(forceResolver: true) } -type WebhookConfigurationConnection +type WebhookSubscriptionConnection @goModel( - model: "go.probo.inc/probo/pkg/server/api/console/v1/types.WebhookConfigurationConnection" + model: "go.probo.inc/probo/pkg/server/api/console/v1/types.WebhookSubscriptionConnection" ) { - edges: [WebhookConfigurationEdge!]! + edges: [WebhookSubscriptionEdge!]! pageInfo: PageInfo! totalCount: Int! @goField(forceResolver: true) } -type WebhookConfigurationEdge { +type WebhookSubscriptionEdge { cursor: CursorKey! - node: WebhookConfiguration! + node: WebhookSubscription! } enum WebhookEventStatus @@ -2348,7 +2348,7 @@ input WebhookEventOrder type WebhookEvent implements Node { id: ID! - webhookConfigurationId: ID! + webhookSubscriptionId: ID! status: WebhookEventStatus! response: String createdAt: Datetime! @@ -3396,16 +3396,16 @@ type Mutation { createMeeting(input: CreateMeetingInput!): CreateMeetingPayload! updateMeeting(input: UpdateMeetingInput!): UpdateMeetingPayload! deleteMeeting(input: DeleteMeetingInput!): DeleteMeetingPayload! - # WebhookConfiguration mutations - createWebhookConfiguration( - input: CreateWebhookConfigurationInput! - ): CreateWebhookConfigurationPayload! - updateWebhookConfiguration( - input: UpdateWebhookConfigurationInput! - ): UpdateWebhookConfigurationPayload! - deleteWebhookConfiguration( - input: DeleteWebhookConfigurationInput! - ): DeleteWebhookConfigurationPayload! + # WebhookSubscription mutations + createWebhookSubscription( + input: CreateWebhookSubscriptionInput! + ): CreateWebhookSubscriptionPayload! + updateWebhookSubscription( + input: UpdateWebhookSubscriptionInput! + ): UpdateWebhookSubscriptionPayload! + deleteWebhookSubscription( + input: DeleteWebhookSubscriptionInput! + ): DeleteWebhookSubscriptionPayload! # StateOfApplicability mutations createStateOfApplicability( input: CreateStateOfApplicabilityInput! @@ -4757,32 +4757,32 @@ type DeleteMeetingPayload { deletedMeetingId: ID! } -input CreateWebhookConfigurationInput { +input CreateWebhookSubscriptionInput { organizationId: ID! endpointUrl: String! selectedEvents: [WebhookEventType!]! } -input UpdateWebhookConfigurationInput { +input UpdateWebhookSubscriptionInput { id: ID! endpointUrl: String selectedEvents: [WebhookEventType!] } -input DeleteWebhookConfigurationInput { - webhookConfigurationId: ID! +input DeleteWebhookSubscriptionInput { + webhookSubscriptionId: ID! } -type CreateWebhookConfigurationPayload { - webhookConfigurationEdge: WebhookConfigurationEdge! +type CreateWebhookSubscriptionPayload { + webhookSubscriptionEdge: WebhookSubscriptionEdge! } -type UpdateWebhookConfigurationPayload { - webhookConfiguration: WebhookConfiguration! +type UpdateWebhookSubscriptionPayload { + webhookSubscription: WebhookSubscription! } -type DeleteWebhookConfigurationPayload { - deletedWebhookConfigurationId: ID! +type DeleteWebhookSubscriptionPayload { + deletedWebhookSubscriptionId: ID! } type CreateStateOfApplicabilityPayload { diff --git a/pkg/server/api/console/v1/schema/schema.go b/pkg/server/api/console/v1/schema/schema.go index 4d0bb22d0..14e18a6cf 100644 --- a/pkg/server/api/console/v1/schema/schema.go +++ b/pkg/server/api/console/v1/schema/schema.go @@ -119,8 +119,8 @@ type ResolverRoot interface { VendorRiskAssessment() VendorRiskAssessmentResolver VendorService() VendorServiceResolver Viewer() ViewerResolver - WebhookConfiguration() WebhookConfigurationResolver - WebhookConfigurationConnection() WebhookConfigurationConnectionResolver + WebhookSubscription() WebhookSubscriptionResolver + WebhookSubscriptionConnection() WebhookSubscriptionConnectionResolver WebhookEventConnection() WebhookEventConnectionResolver } @@ -448,8 +448,8 @@ type ComplexityRoot struct { VendorServiceEdge func(childComplexity int) int } - CreateWebhookConfigurationPayload struct { - WebhookConfigurationEdge func(childComplexity int) int + CreateWebhookSubscriptionPayload struct { + WebhookSubscriptionEdge func(childComplexity int) int } CustomDomain struct { @@ -697,8 +697,8 @@ type ComplexityRoot struct { DeletedVendorServiceID func(childComplexity int) int } - DeleteWebhookConfigurationPayload struct { - DeletedWebhookConfigurationID func(childComplexity int) int + DeleteWebhookSubscriptionPayload struct { + DeletedWebhookSubscriptionID func(childComplexity int) int } Document struct { @@ -982,7 +982,7 @@ type ComplexityRoot struct { CreateVendorContact func(childComplexity int, input types.CreateVendorContactInput) int CreateVendorRiskAssessment func(childComplexity int, input types.CreateVendorRiskAssessmentInput) int CreateVendorService func(childComplexity int, input types.CreateVendorServiceInput) int - CreateWebhookConfiguration func(childComplexity int, input types.CreateWebhookConfigurationInput) int + CreateWebhookSubscription func(childComplexity int, input types.CreateWebhookSubscriptionInput) int DeleteApplicabilityStatement func(childComplexity int, input types.DeleteApplicabilityStatementInput) int DeleteAsset func(childComplexity int, input types.DeleteAssetInput) int DeleteAudit func(childComplexity int, input types.DeleteAuditInput) int @@ -1025,7 +1025,7 @@ type ComplexityRoot struct { DeleteVendorContact func(childComplexity int, input types.DeleteVendorContactInput) int DeleteVendorDataPrivacyAgreement func(childComplexity int, input types.DeleteVendorDataPrivacyAgreementInput) int DeleteVendorService func(childComplexity int, input types.DeleteVendorServiceInput) int - DeleteWebhookConfiguration func(childComplexity int, input types.DeleteWebhookConfigurationInput) int + DeleteWebhookSubscription func(childComplexity int, input types.DeleteWebhookSubscriptionInput) int ExportDataProtectionImpactAssessmentsPDF func(childComplexity int, input types.ExportDataProtectionImpactAssessmentsPDFInput) int ExportDocumentVersionPDF func(childComplexity int, input types.ExportDocumentVersionPDFInput) int ExportFramework func(childComplexity int, input types.ExportFrameworkInput) int @@ -1073,7 +1073,7 @@ type ComplexityRoot struct { UpdateVendorContact func(childComplexity int, input types.UpdateVendorContactInput) int UpdateVendorDataPrivacyAgreement func(childComplexity int, input types.UpdateVendorDataPrivacyAgreementInput) int UpdateVendorService func(childComplexity int, input types.UpdateVendorServiceInput) int - UpdateWebhookConfiguration func(childComplexity int, input types.UpdateWebhookConfigurationInput) int + UpdateWebhookSubscription func(childComplexity int, input types.UpdateWebhookSubscriptionInput) int UploadAuditReport func(childComplexity int, input types.UploadAuditReportInput) int UploadMeasureEvidence func(childComplexity int, input types.UploadMeasureEvidenceInput) int UploadTrustCenterNda func(childComplexity int, input types.UploadTrustCenterNDAInput) int @@ -1180,7 +1180,7 @@ type ComplexityRoot struct { TrustCenterFiles func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterFileOrderField]) int UpdatedAt func(childComplexity int) int Vendors func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.VendorOrderBy, filter *types.VendorFilter) int - WebhookConfigurations func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookConfigurationOrderBy) int + WebhookSubscriptions func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookSubscriptionOrderBy) int WebsiteURL func(childComplexity int) int } @@ -1738,8 +1738,8 @@ type ComplexityRoot struct { VendorService func(childComplexity int) int } - UpdateWebhookConfigurationPayload struct { - WebhookConfiguration func(childComplexity int) int + UpdateWebhookSubscriptionPayload struct { + WebhookSubscription func(childComplexity int) int } UploadAuditReportPayload struct { @@ -1930,7 +1930,7 @@ type ComplexityRoot struct { SignableDocuments func(childComplexity int, organizationID gid.GID, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.DocumentOrderBy) int } - WebhookConfiguration struct { + WebhookSubscription struct { CreatedAt func(childComplexity int) int EndpointURL func(childComplexity int) int Events func(childComplexity int, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookEventOrderBy) int @@ -1942,23 +1942,23 @@ type ComplexityRoot struct { UpdatedAt func(childComplexity int) int } - WebhookConfigurationConnection struct { + WebhookSubscriptionConnection struct { Edges func(childComplexity int) int PageInfo func(childComplexity int) int TotalCount func(childComplexity int) int } - WebhookConfigurationEdge struct { + WebhookSubscriptionEdge struct { Cursor func(childComplexity int) int Node func(childComplexity int) int } WebhookEvent struct { - CreatedAt func(childComplexity int) int - ID func(childComplexity int) int - Response func(childComplexity int) int - Status func(childComplexity int) int - WebhookConfigurationID func(childComplexity int) int + CreatedAt func(childComplexity int) int + ID func(childComplexity int) int + Response func(childComplexity int) int + Status func(childComplexity int) int + WebhookSubscriptionID func(childComplexity int) int } WebhookEventConnection struct { @@ -2214,9 +2214,9 @@ type MutationResolver interface { CreateMeeting(ctx context.Context, input types.CreateMeetingInput) (*types.CreateMeetingPayload, error) UpdateMeeting(ctx context.Context, input types.UpdateMeetingInput) (*types.UpdateMeetingPayload, error) DeleteMeeting(ctx context.Context, input types.DeleteMeetingInput) (*types.DeleteMeetingPayload, error) - CreateWebhookConfiguration(ctx context.Context, input types.CreateWebhookConfigurationInput) (*types.CreateWebhookConfigurationPayload, error) - UpdateWebhookConfiguration(ctx context.Context, input types.UpdateWebhookConfigurationInput) (*types.UpdateWebhookConfigurationPayload, error) - DeleteWebhookConfiguration(ctx context.Context, input types.DeleteWebhookConfigurationInput) (*types.DeleteWebhookConfigurationPayload, error) + CreateWebhookSubscription(ctx context.Context, input types.CreateWebhookSubscriptionInput) (*types.CreateWebhookSubscriptionPayload, error) + UpdateWebhookSubscription(ctx context.Context, input types.UpdateWebhookSubscriptionInput) (*types.UpdateWebhookSubscriptionPayload, error) + DeleteWebhookSubscription(ctx context.Context, input types.DeleteWebhookSubscriptionInput) (*types.DeleteWebhookSubscriptionPayload, error) CreateStateOfApplicability(ctx context.Context, input types.CreateStateOfApplicabilityInput) (*types.CreateStateOfApplicabilityPayload, error) UpdateStateOfApplicability(ctx context.Context, input types.UpdateStateOfApplicabilityInput) (*types.UpdateStateOfApplicabilityPayload, error) DeleteStateOfApplicability(ctx context.Context, input types.DeleteStateOfApplicabilityInput) (*types.DeleteStateOfApplicabilityPayload, error) @@ -2330,7 +2330,7 @@ type OrganizationResolver interface { TrustCenterFiles(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterFileOrderField]) (*types.TrustCenterFileConnection, error) TrustCenter(ctx context.Context, obj *types.Organization) (*types.TrustCenter, error) CustomDomain(ctx context.Context, obj *types.Organization) (*types.CustomDomain, error) - WebhookConfigurations(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookConfigurationOrderBy) (*types.WebhookConfigurationConnection, error) + WebhookSubscriptions(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookSubscriptionOrderBy) (*types.WebhookSubscriptionConnection, error) Permission(ctx context.Context, obj *types.Organization, action string) (bool, error) } @@ -2526,16 +2526,16 @@ type ViewerResolver interface { SignableDocuments(ctx context.Context, obj *types.Viewer, organizationID gid.GID, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.DocumentOrderBy) (*types.SignableDocumentConnection, error) SignableDocument(ctx context.Context, obj *types.Viewer, id gid.GID) (*types.SignableDocument, error) } -type WebhookConfigurationResolver interface { - Organization(ctx context.Context, obj *types.WebhookConfiguration) (*types.Organization, error) +type WebhookSubscriptionResolver interface { + Organization(ctx context.Context, obj *types.WebhookSubscription) (*types.Organization, error) - SigningSecret(ctx context.Context, obj *types.WebhookConfiguration) (string, error) + SigningSecret(ctx context.Context, obj *types.WebhookSubscription) (string, error) - Events(ctx context.Context, obj *types.WebhookConfiguration, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookEventOrderBy) (*types.WebhookEventConnection, error) - Permission(ctx context.Context, obj *types.WebhookConfiguration, action string) (bool, error) + Events(ctx context.Context, obj *types.WebhookSubscription, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookEventOrderBy) (*types.WebhookEventConnection, error) + Permission(ctx context.Context, obj *types.WebhookSubscription, action string) (bool, error) } -type WebhookConfigurationConnectionResolver interface { - TotalCount(ctx context.Context, obj *types.WebhookConfigurationConnection) (int, error) +type WebhookSubscriptionConnectionResolver interface { + TotalCount(ctx context.Context, obj *types.WebhookSubscriptionConnection) (int, error) } type WebhookEventConnectionResolver interface { TotalCount(ctx context.Context, obj *types.WebhookEventConnection) (int, error) @@ -3554,12 +3554,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.CreateVendorServicePayload.VendorServiceEdge(childComplexity), true - case "CreateWebhookConfigurationPayload.webhookConfigurationEdge": - if e.complexity.CreateWebhookConfigurationPayload.WebhookConfigurationEdge == nil { + case "CreateWebhookSubscriptionPayload.webhookSubscriptionEdge": + if e.complexity.CreateWebhookSubscriptionPayload.WebhookSubscriptionEdge == nil { break } - return e.complexity.CreateWebhookConfigurationPayload.WebhookConfigurationEdge(childComplexity), true + return e.complexity.CreateWebhookSubscriptionPayload.WebhookSubscriptionEdge(childComplexity), true case "CustomDomain.createdAt": if e.complexity.CustomDomain.CreatedAt == nil { @@ -4201,12 +4201,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.DeleteVendorServicePayload.DeletedVendorServiceID(childComplexity), true - case "DeleteWebhookConfigurationPayload.deletedWebhookConfigurationId": - if e.complexity.DeleteWebhookConfigurationPayload.DeletedWebhookConfigurationID == nil { + case "DeleteWebhookSubscriptionPayload.deletedWebhookSubscriptionId": + if e.complexity.DeleteWebhookSubscriptionPayload.DeletedWebhookSubscriptionID == nil { break } - return e.complexity.DeleteWebhookConfigurationPayload.DeletedWebhookConfigurationID(childComplexity), true + return e.complexity.DeleteWebhookSubscriptionPayload.DeletedWebhookSubscriptionID(childComplexity), true case "Document.classification": if e.complexity.Document.Classification == nil { @@ -5600,17 +5600,17 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Mutation.CreateVendorService(childComplexity, args["input"].(types.CreateVendorServiceInput)), true - case "Mutation.createWebhookConfiguration": - if e.complexity.Mutation.CreateWebhookConfiguration == nil { + case "Mutation.createWebhookSubscription": + if e.complexity.Mutation.CreateWebhookSubscription == nil { break } - args, err := ec.field_Mutation_createWebhookConfiguration_args(ctx, rawArgs) + args, err := ec.field_Mutation_createWebhookSubscription_args(ctx, rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.CreateWebhookConfiguration(childComplexity, args["input"].(types.CreateWebhookConfigurationInput)), true + return e.complexity.Mutation.CreateWebhookSubscription(childComplexity, args["input"].(types.CreateWebhookSubscriptionInput)), true case "Mutation.deleteApplicabilityStatement": if e.complexity.Mutation.DeleteApplicabilityStatement == nil { break @@ -6073,17 +6073,17 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Mutation.DeleteVendorService(childComplexity, args["input"].(types.DeleteVendorServiceInput)), true - case "Mutation.deleteWebhookConfiguration": - if e.complexity.Mutation.DeleteWebhookConfiguration == nil { + case "Mutation.deleteWebhookSubscription": + if e.complexity.Mutation.DeleteWebhookSubscription == nil { break } - args, err := ec.field_Mutation_deleteWebhookConfiguration_args(ctx, rawArgs) + args, err := ec.field_Mutation_deleteWebhookSubscription_args(ctx, rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.DeleteWebhookConfiguration(childComplexity, args["input"].(types.DeleteWebhookConfigurationInput)), true + return e.complexity.Mutation.DeleteWebhookSubscription(childComplexity, args["input"].(types.DeleteWebhookSubscriptionInput)), true case "Mutation.exportDataProtectionImpactAssessmentsPDF": if e.complexity.Mutation.ExportDataProtectionImpactAssessmentsPDF == nil { break @@ -6601,17 +6601,17 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Mutation.UpdateVendorService(childComplexity, args["input"].(types.UpdateVendorServiceInput)), true - case "Mutation.updateWebhookConfiguration": - if e.complexity.Mutation.UpdateWebhookConfiguration == nil { + case "Mutation.updateWebhookSubscription": + if e.complexity.Mutation.UpdateWebhookSubscription == nil { break } - args, err := ec.field_Mutation_updateWebhookConfiguration_args(ctx, rawArgs) + args, err := ec.field_Mutation_updateWebhookSubscription_args(ctx, rawArgs) if err != nil { return 0, false } - return e.complexity.Mutation.UpdateWebhookConfiguration(childComplexity, args["input"].(types.UpdateWebhookConfigurationInput)), true + return e.complexity.Mutation.UpdateWebhookSubscription(childComplexity, args["input"].(types.UpdateWebhookSubscriptionInput)), true case "Mutation.uploadAuditReport": if e.complexity.Mutation.UploadAuditReport == nil { break @@ -7289,17 +7289,17 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.Organization.Vendors(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.VendorOrderBy), args["filter"].(*types.VendorFilter)), true - case "Organization.webhookConfigurations": - if e.complexity.Organization.WebhookConfigurations == nil { + case "Organization.webhookSubscriptions": + if e.complexity.Organization.WebhookSubscriptions == nil { break } - args, err := ec.field_Organization_webhookConfigurations_args(ctx, rawArgs) + args, err := ec.field_Organization_webhookSubscriptions_args(ctx, rawArgs) if err != nil { return 0, false } - return e.complexity.Organization.WebhookConfigurations(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.WebhookConfigurationOrderBy)), true + return e.complexity.Organization.WebhookSubscriptions(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.WebhookSubscriptionOrderBy)), true case "Organization.websiteUrl": if e.complexity.Organization.WebsiteURL == nil { break @@ -9333,12 +9333,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.UpdateVendorServicePayload.VendorService(childComplexity), true - case "UpdateWebhookConfigurationPayload.webhookConfiguration": - if e.complexity.UpdateWebhookConfigurationPayload.WebhookConfiguration == nil { + case "UpdateWebhookSubscriptionPayload.webhookSubscription": + if e.complexity.UpdateWebhookSubscriptionPayload.WebhookSubscription == nil { break } - return e.complexity.UpdateWebhookConfigurationPayload.WebhookConfiguration(childComplexity), true + return e.complexity.UpdateWebhookSubscriptionPayload.WebhookSubscription(childComplexity), true case "UploadAuditReportPayload.audit": if e.complexity.UploadAuditReportPayload.Audit == nil { @@ -10125,102 +10125,102 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin return e.complexity.Viewer.SignableDocuments(childComplexity, args["organizationId"].(gid.GID), args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.DocumentOrderBy)), true - case "WebhookConfiguration.createdAt": - if e.complexity.WebhookConfiguration.CreatedAt == nil { + case "WebhookSubscription.createdAt": + if e.complexity.WebhookSubscription.CreatedAt == nil { break } - return e.complexity.WebhookConfiguration.CreatedAt(childComplexity), true - case "WebhookConfiguration.endpointUrl": - if e.complexity.WebhookConfiguration.EndpointURL == nil { + return e.complexity.WebhookSubscription.CreatedAt(childComplexity), true + case "WebhookSubscription.endpointUrl": + if e.complexity.WebhookSubscription.EndpointURL == nil { break } - return e.complexity.WebhookConfiguration.EndpointURL(childComplexity), true - case "WebhookConfiguration.events": - if e.complexity.WebhookConfiguration.Events == nil { + return e.complexity.WebhookSubscription.EndpointURL(childComplexity), true + case "WebhookSubscription.events": + if e.complexity.WebhookSubscription.Events == nil { break } - args, err := ec.field_WebhookConfiguration_events_args(ctx, rawArgs) + args, err := ec.field_WebhookSubscription_events_args(ctx, rawArgs) if err != nil { return 0, false } - return e.complexity.WebhookConfiguration.Events(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.WebhookEventOrderBy)), true - case "WebhookConfiguration.id": - if e.complexity.WebhookConfiguration.ID == nil { + return e.complexity.WebhookSubscription.Events(childComplexity, args["first"].(*int), args["after"].(*page.CursorKey), args["last"].(*int), args["before"].(*page.CursorKey), args["orderBy"].(*types.WebhookEventOrderBy)), true + case "WebhookSubscription.id": + if e.complexity.WebhookSubscription.ID == nil { break } - return e.complexity.WebhookConfiguration.ID(childComplexity), true - case "WebhookConfiguration.organization": - if e.complexity.WebhookConfiguration.Organization == nil { + return e.complexity.WebhookSubscription.ID(childComplexity), true + case "WebhookSubscription.organization": + if e.complexity.WebhookSubscription.Organization == nil { break } - return e.complexity.WebhookConfiguration.Organization(childComplexity), true - case "WebhookConfiguration.permission": - if e.complexity.WebhookConfiguration.Permission == nil { + return e.complexity.WebhookSubscription.Organization(childComplexity), true + case "WebhookSubscription.permission": + if e.complexity.WebhookSubscription.Permission == nil { break } - args, err := ec.field_WebhookConfiguration_permission_args(ctx, rawArgs) + args, err := ec.field_WebhookSubscription_permission_args(ctx, rawArgs) if err != nil { return 0, false } - return e.complexity.WebhookConfiguration.Permission(childComplexity, args["action"].(string)), true - case "WebhookConfiguration.selectedEvents": - if e.complexity.WebhookConfiguration.SelectedEvents == nil { + return e.complexity.WebhookSubscription.Permission(childComplexity, args["action"].(string)), true + case "WebhookSubscription.selectedEvents": + if e.complexity.WebhookSubscription.SelectedEvents == nil { break } - return e.complexity.WebhookConfiguration.SelectedEvents(childComplexity), true - case "WebhookConfiguration.signingSecret": - if e.complexity.WebhookConfiguration.SigningSecret == nil { + return e.complexity.WebhookSubscription.SelectedEvents(childComplexity), true + case "WebhookSubscription.signingSecret": + if e.complexity.WebhookSubscription.SigningSecret == nil { break } - return e.complexity.WebhookConfiguration.SigningSecret(childComplexity), true - case "WebhookConfiguration.updatedAt": - if e.complexity.WebhookConfiguration.UpdatedAt == nil { + return e.complexity.WebhookSubscription.SigningSecret(childComplexity), true + case "WebhookSubscription.updatedAt": + if e.complexity.WebhookSubscription.UpdatedAt == nil { break } - return e.complexity.WebhookConfiguration.UpdatedAt(childComplexity), true + return e.complexity.WebhookSubscription.UpdatedAt(childComplexity), true - case "WebhookConfigurationConnection.edges": - if e.complexity.WebhookConfigurationConnection.Edges == nil { + case "WebhookSubscriptionConnection.edges": + if e.complexity.WebhookSubscriptionConnection.Edges == nil { break } - return e.complexity.WebhookConfigurationConnection.Edges(childComplexity), true - case "WebhookConfigurationConnection.pageInfo": - if e.complexity.WebhookConfigurationConnection.PageInfo == nil { + return e.complexity.WebhookSubscriptionConnection.Edges(childComplexity), true + case "WebhookSubscriptionConnection.pageInfo": + if e.complexity.WebhookSubscriptionConnection.PageInfo == nil { break } - return e.complexity.WebhookConfigurationConnection.PageInfo(childComplexity), true - case "WebhookConfigurationConnection.totalCount": - if e.complexity.WebhookConfigurationConnection.TotalCount == nil { + return e.complexity.WebhookSubscriptionConnection.PageInfo(childComplexity), true + case "WebhookSubscriptionConnection.totalCount": + if e.complexity.WebhookSubscriptionConnection.TotalCount == nil { break } - return e.complexity.WebhookConfigurationConnection.TotalCount(childComplexity), true + return e.complexity.WebhookSubscriptionConnection.TotalCount(childComplexity), true - case "WebhookConfigurationEdge.cursor": - if e.complexity.WebhookConfigurationEdge.Cursor == nil { + case "WebhookSubscriptionEdge.cursor": + if e.complexity.WebhookSubscriptionEdge.Cursor == nil { break } - return e.complexity.WebhookConfigurationEdge.Cursor(childComplexity), true - case "WebhookConfigurationEdge.node": - if e.complexity.WebhookConfigurationEdge.Node == nil { + return e.complexity.WebhookSubscriptionEdge.Cursor(childComplexity), true + case "WebhookSubscriptionEdge.node": + if e.complexity.WebhookSubscriptionEdge.Node == nil { break } - return e.complexity.WebhookConfigurationEdge.Node(childComplexity), true + return e.complexity.WebhookSubscriptionEdge.Node(childComplexity), true case "WebhookEvent.createdAt": if e.complexity.WebhookEvent.CreatedAt == nil { @@ -10246,12 +10246,12 @@ func (e *executableSchema) Complexity(ctx context.Context, typeName, field strin } return e.complexity.WebhookEvent.Status(childComplexity), true - case "WebhookEvent.webhookConfigurationId": - if e.complexity.WebhookEvent.WebhookConfigurationID == nil { + case "WebhookEvent.webhookSubscriptionId": + if e.complexity.WebhookEvent.WebhookSubscriptionID == nil { break } - return e.complexity.WebhookEvent.WebhookConfigurationID(childComplexity), true + return e.complexity.WebhookEvent.WebhookSubscriptionID(childComplexity), true case "WebhookEventConnection.edges": if e.complexity.WebhookEventConnection.Edges == nil { @@ -10345,7 +10345,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputCreateVendorInput, ec.unmarshalInputCreateVendorRiskAssessmentInput, ec.unmarshalInputCreateVendorServiceInput, - ec.unmarshalInputCreateWebhookConfigurationInput, + ec.unmarshalInputCreateWebhookSubscriptionInput, ec.unmarshalInputDataProtectionImpactAssessmentFilter, ec.unmarshalInputDataProtectionImpactAssessmentOrder, ec.unmarshalInputDatumFilter, @@ -10392,7 +10392,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputDeleteVendorDataPrivacyAgreementInput, ec.unmarshalInputDeleteVendorInput, ec.unmarshalInputDeleteVendorServiceInput, - ec.unmarshalInputDeleteWebhookConfigurationInput, + ec.unmarshalInputDeleteWebhookSubscriptionInput, ec.unmarshalInputDocumentFilter, ec.unmarshalInputDocumentOrder, ec.unmarshalInputDocumentVersionFilter, @@ -10473,7 +10473,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputUpdateVendorDataPrivacyAgreementInput, ec.unmarshalInputUpdateVendorInput, ec.unmarshalInputUpdateVendorServiceInput, - ec.unmarshalInputUpdateWebhookConfigurationInput, + ec.unmarshalInputUpdateWebhookSubscriptionInput, ec.unmarshalInputUploadAuditReportInput, ec.unmarshalInputUploadMeasureEvidenceInput, ec.unmarshalInputUploadTrustCenterNDAInput, @@ -10486,7 +10486,7 @@ func (e *executableSchema) Exec(ctx context.Context) graphql.ResponseHandler { ec.unmarshalInputVendorOrder, ec.unmarshalInputVendorRiskAssessmentOrder, ec.unmarshalInputVendorServiceOrder, - ec.unmarshalInputWebhookConfigurationOrder, + ec.unmarshalInputWebhookSubscriptionOrder, ec.unmarshalInputWebhookEventOrder, ) first := true @@ -11075,13 +11075,13 @@ enum MeetingOrderField ) } -enum WebhookConfigurationOrderField +enum WebhookSubscriptionOrderField @goModel( - model: "go.probo.inc/probo/pkg/coredata.WebhookConfigurationOrderField" + model: "go.probo.inc/probo/pkg/coredata.WebhookSubscriptionOrderField" ) { CREATED_AT @goEnum( - value: "go.probo.inc/probo/pkg/coredata.WebhookConfigurationOrderFieldCreatedAt" + value: "go.probo.inc/probo/pkg/coredata.WebhookSubscriptionOrderFieldCreatedAt" ) } @@ -11942,12 +11942,12 @@ input MeetingOrder field: MeetingOrderField! } -input WebhookConfigurationOrder +input WebhookSubscriptionOrder @goModel( - model: "go.probo.inc/probo/pkg/server/api/console/v1/types.WebhookConfigurationOrderBy" + model: "go.probo.inc/probo/pkg/server/api/console/v1/types.WebhookSubscriptionOrderBy" ) { direction: OrderDirection! - field: WebhookConfigurationOrderField! + field: WebhookSubscriptionOrderField! } input RiskOrder @@ -12422,13 +12422,13 @@ type Organization implements Node { customDomain: CustomDomain @goField(forceResolver: true) - webhookConfigurations( + webhookSubscriptions( first: Int after: CursorKey last: Int before: CursorKey - orderBy: WebhookConfigurationOrder - ): WebhookConfigurationConnection! @goField(forceResolver: true) + orderBy: WebhookSubscriptionOrder + ): WebhookSubscriptionConnection! @goField(forceResolver: true) createdAt: Datetime! updatedAt: Datetime! @@ -12871,7 +12871,7 @@ enum WebhookEventType @goEnum(value: "go.probo.inc/probo/pkg/coredata.WebhookEventTypeVendorDeleted") } -type WebhookConfiguration implements Node { +type WebhookSubscription implements Node { id: ID! organization: Organization @goField(forceResolver: true) endpointUrl: String! @@ -12891,18 +12891,18 @@ type WebhookConfiguration implements Node { permission(action: String!): Boolean! @goField(forceResolver: true) } -type WebhookConfigurationConnection +type WebhookSubscriptionConnection @goModel( - model: "go.probo.inc/probo/pkg/server/api/console/v1/types.WebhookConfigurationConnection" + model: "go.probo.inc/probo/pkg/server/api/console/v1/types.WebhookSubscriptionConnection" ) { - edges: [WebhookConfigurationEdge!]! + edges: [WebhookSubscriptionEdge!]! pageInfo: PageInfo! totalCount: Int! @goField(forceResolver: true) } -type WebhookConfigurationEdge { +type WebhookSubscriptionEdge { cursor: CursorKey! - node: WebhookConfiguration! + node: WebhookSubscription! } enum WebhookEventStatus @@ -12935,7 +12935,7 @@ input WebhookEventOrder type WebhookEvent implements Node { id: ID! - webhookConfigurationId: ID! + webhookSubscriptionId: ID! status: WebhookEventStatus! response: String createdAt: Datetime! @@ -13983,16 +13983,16 @@ type Mutation { createMeeting(input: CreateMeetingInput!): CreateMeetingPayload! updateMeeting(input: UpdateMeetingInput!): UpdateMeetingPayload! deleteMeeting(input: DeleteMeetingInput!): DeleteMeetingPayload! - # WebhookConfiguration mutations - createWebhookConfiguration( - input: CreateWebhookConfigurationInput! - ): CreateWebhookConfigurationPayload! - updateWebhookConfiguration( - input: UpdateWebhookConfigurationInput! - ): UpdateWebhookConfigurationPayload! - deleteWebhookConfiguration( - input: DeleteWebhookConfigurationInput! - ): DeleteWebhookConfigurationPayload! + # WebhookSubscription mutations + createWebhookSubscription( + input: CreateWebhookSubscriptionInput! + ): CreateWebhookSubscriptionPayload! + updateWebhookSubscription( + input: UpdateWebhookSubscriptionInput! + ): UpdateWebhookSubscriptionPayload! + deleteWebhookSubscription( + input: DeleteWebhookSubscriptionInput! + ): DeleteWebhookSubscriptionPayload! # StateOfApplicability mutations createStateOfApplicability( input: CreateStateOfApplicabilityInput! @@ -15344,32 +15344,32 @@ type DeleteMeetingPayload { deletedMeetingId: ID! } -input CreateWebhookConfigurationInput { +input CreateWebhookSubscriptionInput { organizationId: ID! endpointUrl: String! selectedEvents: [WebhookEventType!]! } -input UpdateWebhookConfigurationInput { +input UpdateWebhookSubscriptionInput { id: ID! endpointUrl: String selectedEvents: [WebhookEventType!] } -input DeleteWebhookConfigurationInput { - webhookConfigurationId: ID! +input DeleteWebhookSubscriptionInput { + webhookSubscriptionId: ID! } -type CreateWebhookConfigurationPayload { - webhookConfigurationEdge: WebhookConfigurationEdge! +type CreateWebhookSubscriptionPayload { + webhookSubscriptionEdge: WebhookSubscriptionEdge! } -type UpdateWebhookConfigurationPayload { - webhookConfiguration: WebhookConfiguration! +type UpdateWebhookSubscriptionPayload { + webhookSubscription: WebhookSubscription! } -type DeleteWebhookConfigurationPayload { - deletedWebhookConfigurationId: ID! +type DeleteWebhookSubscriptionPayload { + deletedWebhookSubscriptionId: ID! } type CreateStateOfApplicabilityPayload { @@ -17175,10 +17175,10 @@ func (ec *executionContext) field_Mutation_createVendor_args(ctx context.Context return args, nil } -func (ec *executionContext) field_Mutation_createWebhookConfiguration_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { +func (ec *executionContext) field_Mutation_createWebhookSubscription_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} - arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateWebhookConfigurationInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookConfigurationInput) + arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNCreateWebhookSubscriptionInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookSubscriptionInput) if err != nil { return nil, err } @@ -17648,10 +17648,10 @@ func (ec *executionContext) field_Mutation_deleteVendor_args(ctx context.Context return args, nil } -func (ec *executionContext) field_Mutation_deleteWebhookConfiguration_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { +func (ec *executionContext) field_Mutation_deleteWebhookSubscription_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} - arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNDeleteWebhookConfigurationInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookConfigurationInput) + arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNDeleteWebhookSubscriptionInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookSubscriptionInput) if err != nil { return nil, err } @@ -18176,10 +18176,10 @@ func (ec *executionContext) field_Mutation_updateVendor_args(ctx context.Context return args, nil } -func (ec *executionContext) field_Mutation_updateWebhookConfiguration_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { +func (ec *executionContext) field_Mutation_updateWebhookSubscription_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} - arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNUpdateWebhookConfigurationInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookConfigurationInput) + arg0, err := graphql.ProcessArgField(ctx, rawArgs, "input", ec.unmarshalNUpdateWebhookSubscriptionInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookSubscriptionInput) if err != nil { return nil, err } @@ -19069,7 +19069,7 @@ func (ec *executionContext) field_Organization_vendors_args(ctx context.Context, return args, nil } -func (ec *executionContext) field_Organization_webhookConfigurations_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { +func (ec *executionContext) field_Organization_webhookSubscriptions_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} arg0, err := graphql.ProcessArgField(ctx, rawArgs, "first", ec.unmarshalOInt2ᚖint) @@ -19092,7 +19092,7 @@ func (ec *executionContext) field_Organization_webhookConfigurations_args(ctx co return nil, err } args["before"] = arg3 - arg4, err := graphql.ProcessArgField(ctx, rawArgs, "orderBy", ec.unmarshalOWebhookConfigurationOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationOrderBy) + arg4, err := graphql.ProcessArgField(ctx, rawArgs, "orderBy", ec.unmarshalOWebhookSubscriptionOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionOrderBy) if err != nil { return nil, err } @@ -19915,7 +19915,7 @@ func (ec *executionContext) field_Viewer_signableDocuments_args(ctx context.Cont return args, nil } -func (ec *executionContext) field_WebhookConfiguration_events_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { +func (ec *executionContext) field_WebhookSubscription_events_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} arg0, err := graphql.ProcessArgField(ctx, rawArgs, "first", ec.unmarshalOInt2ᚖint) @@ -19946,7 +19946,7 @@ func (ec *executionContext) field_WebhookConfiguration_events_args(ctx context.C return args, nil } -func (ec *executionContext) field_WebhookConfiguration_permission_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { +func (ec *executionContext) field_WebhookSubscription_permission_args(ctx context.Context, rawArgs map[string]any) (map[string]any, error) { var err error args := map[string]any{} arg0, err := graphql.ProcessArgField(ctx, rawArgs, "action", ec.unmarshalNString2string) @@ -20959,8 +20959,8 @@ func (ec *executionContext) fieldContext_Asset_organization(_ context.Context, f return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -21410,8 +21410,8 @@ func (ec *executionContext) fieldContext_Audit_organization(_ context.Context, f return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -22382,8 +22382,8 @@ func (ec *executionContext) fieldContext_ContinualImprovement_organization(_ con return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -23035,8 +23035,8 @@ func (ec *executionContext) fieldContext_Control_organization(_ context.Context, return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -25569,36 +25569,36 @@ func (ec *executionContext) fieldContext_CreateVendorServicePayload_vendorServic return fc, nil } -func (ec *executionContext) _CreateWebhookConfigurationPayload_webhookConfigurationEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateWebhookConfigurationPayload) (ret graphql.Marshaler) { +func (ec *executionContext) _CreateWebhookSubscriptionPayload_webhookSubscriptionEdge(ctx context.Context, field graphql.CollectedField, obj *types.CreateWebhookSubscriptionPayload) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_CreateWebhookConfigurationPayload_webhookConfigurationEdge, + ec.fieldContext_CreateWebhookSubscriptionPayload_webhookSubscriptionEdge, func(ctx context.Context) (any, error) { - return obj.WebhookConfigurationEdge, nil + return obj.WebhookSubscriptionEdge, nil }, nil, - ec.marshalNWebhookConfigurationEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationEdge, + ec.marshalNWebhookSubscriptionEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionEdge, true, true, ) } -func (ec *executionContext) fieldContext_CreateWebhookConfigurationPayload_webhookConfigurationEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_CreateWebhookSubscriptionPayload_webhookSubscriptionEdge(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "CreateWebhookConfigurationPayload", + Object: "CreateWebhookSubscriptionPayload", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "cursor": - return ec.fieldContext_WebhookConfigurationEdge_cursor(ctx, field) + return ec.fieldContext_WebhookSubscriptionEdge_cursor(ctx, field) case "node": - return ec.fieldContext_WebhookConfigurationEdge_node(ctx, field) + return ec.fieldContext_WebhookSubscriptionEdge_node(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type WebhookConfigurationEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type WebhookSubscriptionEdge", field.Name) }, } return fc, nil @@ -25725,8 +25725,8 @@ func (ec *executionContext) fieldContext_CustomDomain_organization(_ context.Con return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -26322,8 +26322,8 @@ func (ec *executionContext) fieldContext_DataProtectionImpactAssessment_organiza return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -27076,8 +27076,8 @@ func (ec *executionContext) fieldContext_Datum_organization(_ context.Context, f return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -28879,14 +28879,14 @@ func (ec *executionContext) fieldContext_DeleteVendorServicePayload_deletedVendo return fc, nil } -func (ec *executionContext) _DeleteWebhookConfigurationPayload_deletedWebhookConfigurationId(ctx context.Context, field graphql.CollectedField, obj *types.DeleteWebhookConfigurationPayload) (ret graphql.Marshaler) { +func (ec *executionContext) _DeleteWebhookSubscriptionPayload_deletedWebhookSubscriptionId(ctx context.Context, field graphql.CollectedField, obj *types.DeleteWebhookSubscriptionPayload) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_DeleteWebhookConfigurationPayload_deletedWebhookConfigurationId, + ec.fieldContext_DeleteWebhookSubscriptionPayload_deletedWebhookSubscriptionId, func(ctx context.Context) (any, error) { - return obj.DeletedWebhookConfigurationID, nil + return obj.DeletedWebhookSubscriptionID, nil }, nil, ec.marshalNID2goᚗproboᚗincᚋproboᚋpkgᚋgidᚐGID, @@ -28895,9 +28895,9 @@ func (ec *executionContext) _DeleteWebhookConfigurationPayload_deletedWebhookCon ) } -func (ec *executionContext) fieldContext_DeleteWebhookConfigurationPayload_deletedWebhookConfigurationId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_DeleteWebhookSubscriptionPayload_deletedWebhookSubscriptionId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "DeleteWebhookConfigurationPayload", + Object: "DeleteWebhookSubscriptionPayload", Field: field, IsMethod: false, IsResolver: false, @@ -29256,8 +29256,8 @@ func (ec *executionContext) fieldContext_Document_organization(_ context.Context return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -32085,8 +32085,8 @@ func (ec *executionContext) fieldContext_Framework_organization(_ context.Contex return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -33554,8 +33554,8 @@ func (ec *executionContext) fieldContext_Meeting_organization(_ context.Context, return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -37393,24 +37393,24 @@ func (ec *executionContext) fieldContext_Mutation_deleteMeeting(ctx context.Cont return fc, nil } -func (ec *executionContext) _Mutation_createWebhookConfiguration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Mutation_createWebhookSubscription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_Mutation_createWebhookConfiguration, + ec.fieldContext_Mutation_createWebhookSubscription, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().CreateWebhookConfiguration(ctx, fc.Args["input"].(types.CreateWebhookConfigurationInput)) + return ec.resolvers.Mutation().CreateWebhookSubscription(ctx, fc.Args["input"].(types.CreateWebhookSubscriptionInput)) }, nil, - ec.marshalNCreateWebhookConfigurationPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookConfigurationPayload, + ec.marshalNCreateWebhookSubscriptionPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookSubscriptionPayload, true, true, ) } -func (ec *executionContext) fieldContext_Mutation_createWebhookConfiguration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_createWebhookSubscription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -37418,10 +37418,10 @@ func (ec *executionContext) fieldContext_Mutation_createWebhookConfiguration(ctx IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "webhookConfigurationEdge": - return ec.fieldContext_CreateWebhookConfigurationPayload_webhookConfigurationEdge(ctx, field) + case "webhookSubscriptionEdge": + return ec.fieldContext_CreateWebhookSubscriptionPayload_webhookSubscriptionEdge(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type CreateWebhookConfigurationPayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type CreateWebhookSubscriptionPayload", field.Name) }, } defer func() { @@ -37431,31 +37431,31 @@ func (ec *executionContext) fieldContext_Mutation_createWebhookConfiguration(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_createWebhookConfiguration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_createWebhookSubscription_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_updateWebhookConfiguration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Mutation_updateWebhookSubscription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_Mutation_updateWebhookConfiguration, + ec.fieldContext_Mutation_updateWebhookSubscription, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().UpdateWebhookConfiguration(ctx, fc.Args["input"].(types.UpdateWebhookConfigurationInput)) + return ec.resolvers.Mutation().UpdateWebhookSubscription(ctx, fc.Args["input"].(types.UpdateWebhookSubscriptionInput)) }, nil, - ec.marshalNUpdateWebhookConfigurationPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookConfigurationPayload, + ec.marshalNUpdateWebhookSubscriptionPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookSubscriptionPayload, true, true, ) } -func (ec *executionContext) fieldContext_Mutation_updateWebhookConfiguration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_updateWebhookSubscription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -37463,10 +37463,10 @@ func (ec *executionContext) fieldContext_Mutation_updateWebhookConfiguration(ctx IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "webhookConfiguration": - return ec.fieldContext_UpdateWebhookConfigurationPayload_webhookConfiguration(ctx, field) + case "webhookSubscription": + return ec.fieldContext_UpdateWebhookSubscriptionPayload_webhookSubscription(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type UpdateWebhookConfigurationPayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type UpdateWebhookSubscriptionPayload", field.Name) }, } defer func() { @@ -37476,31 +37476,31 @@ func (ec *executionContext) fieldContext_Mutation_updateWebhookConfiguration(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_updateWebhookConfiguration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_updateWebhookSubscription_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _Mutation_deleteWebhookConfiguration(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { +func (ec *executionContext) _Mutation_deleteWebhookSubscription(ctx context.Context, field graphql.CollectedField) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_Mutation_deleteWebhookConfiguration, + ec.fieldContext_Mutation_deleteWebhookSubscription, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Mutation().DeleteWebhookConfiguration(ctx, fc.Args["input"].(types.DeleteWebhookConfigurationInput)) + return ec.resolvers.Mutation().DeleteWebhookSubscription(ctx, fc.Args["input"].(types.DeleteWebhookSubscriptionInput)) }, nil, - ec.marshalNDeleteWebhookConfigurationPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookConfigurationPayload, + ec.marshalNDeleteWebhookSubscriptionPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookSubscriptionPayload, true, true, ) } -func (ec *executionContext) fieldContext_Mutation_deleteWebhookConfiguration(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Mutation_deleteWebhookSubscription(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Mutation", Field: field, @@ -37508,10 +37508,10 @@ func (ec *executionContext) fieldContext_Mutation_deleteWebhookConfiguration(ctx IsResolver: true, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { - case "deletedWebhookConfigurationId": - return ec.fieldContext_DeleteWebhookConfigurationPayload_deletedWebhookConfigurationId(ctx, field) + case "deletedWebhookSubscriptionId": + return ec.fieldContext_DeleteWebhookSubscriptionPayload_deletedWebhookSubscriptionId(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type DeleteWebhookConfigurationPayload", field.Name) + return nil, fmt.Errorf("no field named %q was found under type DeleteWebhookSubscriptionPayload", field.Name) }, } defer func() { @@ -37521,7 +37521,7 @@ func (ec *executionContext) fieldContext_Mutation_deleteWebhookConfiguration(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Mutation_deleteWebhookConfiguration_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Mutation_deleteWebhookSubscription_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -40382,8 +40382,8 @@ func (ec *executionContext) fieldContext_Nonconformity_organization(_ context.Co return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -41214,8 +41214,8 @@ func (ec *executionContext) fieldContext_Obligation_organization(_ context.Conte return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -43335,24 +43335,24 @@ func (ec *executionContext) fieldContext_Organization_customDomain(_ context.Con return fc, nil } -func (ec *executionContext) _Organization_webhookConfigurations(ctx context.Context, field graphql.CollectedField, obj *types.Organization) (ret graphql.Marshaler) { +func (ec *executionContext) _Organization_webhookSubscriptions(ctx context.Context, field graphql.CollectedField, obj *types.Organization) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_Organization_webhookConfigurations, + ec.fieldContext_Organization_webhookSubscriptions, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.Organization().WebhookConfigurations(ctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.WebhookConfigurationOrderBy)) + return ec.resolvers.Organization().WebhookSubscriptions(ctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.WebhookSubscriptionOrderBy)) }, nil, - ec.marshalNWebhookConfigurationConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationConnection, + ec.marshalNWebhookSubscriptionConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionConnection, true, true, ) } -func (ec *executionContext) fieldContext_Organization_webhookConfigurations(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_Organization_webhookSubscriptions(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "Organization", Field: field, @@ -43361,13 +43361,13 @@ func (ec *executionContext) fieldContext_Organization_webhookConfigurations(ctx Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "edges": - return ec.fieldContext_WebhookConfigurationConnection_edges(ctx, field) + return ec.fieldContext_WebhookSubscriptionConnection_edges(ctx, field) case "pageInfo": - return ec.fieldContext_WebhookConfigurationConnection_pageInfo(ctx, field) + return ec.fieldContext_WebhookSubscriptionConnection_pageInfo(ctx, field) case "totalCount": - return ec.fieldContext_WebhookConfigurationConnection_totalCount(ctx, field) + return ec.fieldContext_WebhookSubscriptionConnection_totalCount(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type WebhookConfigurationConnection", field.Name) + return nil, fmt.Errorf("no field named %q was found under type WebhookSubscriptionConnection", field.Name) }, } defer func() { @@ -43377,7 +43377,7 @@ func (ec *executionContext) fieldContext_Organization_webhookConfigurations(ctx } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_Organization_webhookConfigurations_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_Organization_webhookSubscriptions_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } @@ -43836,8 +43836,8 @@ func (ec *executionContext) fieldContext_ProcessingActivity_organization(_ conte return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -46211,8 +46211,8 @@ func (ec *executionContext) fieldContext_RightsRequest_organization(_ context.Co return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -47237,8 +47237,8 @@ func (ec *executionContext) fieldContext_Risk_organization(_ context.Context, fi return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -48675,8 +48675,8 @@ func (ec *executionContext) fieldContext_Snapshot_organization(_ context.Context return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -49283,8 +49283,8 @@ func (ec *executionContext) fieldContext_StateOfApplicability_organization(_ con return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -50001,8 +50001,8 @@ func (ec *executionContext) fieldContext_Task_organization(_ context.Context, fi return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -50618,8 +50618,8 @@ func (ec *executionContext) fieldContext_TransferImpactAssessment_organization(_ return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -51386,8 +51386,8 @@ func (ec *executionContext) fieldContext_TrustCenter_organization(_ context.Cont return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -52919,8 +52919,8 @@ func (ec *executionContext) fieldContext_TrustCenterFile_organization(_ context. return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -55377,50 +55377,50 @@ func (ec *executionContext) fieldContext_UpdateVendorServicePayload_vendorServic return fc, nil } -func (ec *executionContext) _UpdateWebhookConfigurationPayload_webhookConfiguration(ctx context.Context, field graphql.CollectedField, obj *types.UpdateWebhookConfigurationPayload) (ret graphql.Marshaler) { +func (ec *executionContext) _UpdateWebhookSubscriptionPayload_webhookSubscription(ctx context.Context, field graphql.CollectedField, obj *types.UpdateWebhookSubscriptionPayload) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_UpdateWebhookConfigurationPayload_webhookConfiguration, + ec.fieldContext_UpdateWebhookSubscriptionPayload_webhookSubscription, func(ctx context.Context) (any, error) { - return obj.WebhookConfiguration, nil + return obj.WebhookSubscription, nil }, nil, - ec.marshalNWebhookConfiguration2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfiguration, + ec.marshalNWebhookSubscription2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscription, true, true, ) } -func (ec *executionContext) fieldContext_UpdateWebhookConfigurationPayload_webhookConfiguration(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_UpdateWebhookSubscriptionPayload_webhookSubscription(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "UpdateWebhookConfigurationPayload", + Object: "UpdateWebhookSubscriptionPayload", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_WebhookConfiguration_id(ctx, field) + return ec.fieldContext_WebhookSubscription_id(ctx, field) case "organization": - return ec.fieldContext_WebhookConfiguration_organization(ctx, field) + return ec.fieldContext_WebhookSubscription_organization(ctx, field) case "endpointUrl": - return ec.fieldContext_WebhookConfiguration_endpointUrl(ctx, field) + return ec.fieldContext_WebhookSubscription_endpointUrl(ctx, field) case "signingSecret": - return ec.fieldContext_WebhookConfiguration_signingSecret(ctx, field) + return ec.fieldContext_WebhookSubscription_signingSecret(ctx, field) case "selectedEvents": - return ec.fieldContext_WebhookConfiguration_selectedEvents(ctx, field) + return ec.fieldContext_WebhookSubscription_selectedEvents(ctx, field) case "createdAt": - return ec.fieldContext_WebhookConfiguration_createdAt(ctx, field) + return ec.fieldContext_WebhookSubscription_createdAt(ctx, field) case "updatedAt": - return ec.fieldContext_WebhookConfiguration_updatedAt(ctx, field) + return ec.fieldContext_WebhookSubscription_updatedAt(ctx, field) case "events": - return ec.fieldContext_WebhookConfiguration_events(ctx, field) + return ec.fieldContext_WebhookSubscription_events(ctx, field) case "permission": - return ec.fieldContext_WebhookConfiguration_permission(ctx, field) + return ec.fieldContext_WebhookSubscription_permission(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type WebhookConfiguration", field.Name) + return nil, fmt.Errorf("no field named %q was found under type WebhookSubscription", field.Name) }, } return fc, nil @@ -55949,8 +55949,8 @@ func (ec *executionContext) fieldContext_Vendor_organization(_ context.Context, return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -59912,12 +59912,12 @@ func (ec *executionContext) fieldContext_Viewer_signableDocument(ctx context.Con return fc, nil } -func (ec *executionContext) _WebhookConfiguration_id(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_id(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_id, + ec.fieldContext_WebhookSubscription_id, func(ctx context.Context) (any, error) { return obj.ID, nil }, @@ -59928,9 +59928,9 @@ func (ec *executionContext) _WebhookConfiguration_id(ctx context.Context, field ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_id(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: false, IsResolver: false, @@ -59941,14 +59941,14 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_id(_ context.Conte return fc, nil } -func (ec *executionContext) _WebhookConfiguration_organization(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_organization(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_organization, + ec.fieldContext_WebhookSubscription_organization, func(ctx context.Context) (any, error) { - return ec.resolvers.WebhookConfiguration().Organization(ctx, obj) + return ec.resolvers.WebhookSubscription().Organization(ctx, obj) }, nil, ec.marshalOOrganization2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐOrganization, @@ -59957,9 +59957,9 @@ func (ec *executionContext) _WebhookConfiguration_organization(ctx context.Conte ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_organization(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: true, IsResolver: true, @@ -60033,8 +60033,8 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_organization(_ con return ec.fieldContext_Organization_trustCenter(ctx, field) case "customDomain": return ec.fieldContext_Organization_customDomain(ctx, field) - case "webhookConfigurations": - return ec.fieldContext_Organization_webhookConfigurations(ctx, field) + case "webhookSubscriptions": + return ec.fieldContext_Organization_webhookSubscriptions(ctx, field) case "createdAt": return ec.fieldContext_Organization_createdAt(ctx, field) case "updatedAt": @@ -60048,12 +60048,12 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_organization(_ con return fc, nil } -func (ec *executionContext) _WebhookConfiguration_endpointUrl(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_endpointUrl(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_endpointUrl, + ec.fieldContext_WebhookSubscription_endpointUrl, func(ctx context.Context) (any, error) { return obj.EndpointURL, nil }, @@ -60064,9 +60064,9 @@ func (ec *executionContext) _WebhookConfiguration_endpointUrl(ctx context.Contex ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_endpointUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_endpointUrl(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: false, IsResolver: false, @@ -60077,14 +60077,14 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_endpointUrl(_ cont return fc, nil } -func (ec *executionContext) _WebhookConfiguration_signingSecret(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_signingSecret(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_signingSecret, + ec.fieldContext_WebhookSubscription_signingSecret, func(ctx context.Context) (any, error) { - return ec.resolvers.WebhookConfiguration().SigningSecret(ctx, obj) + return ec.resolvers.WebhookSubscription().SigningSecret(ctx, obj) }, nil, ec.marshalNString2string, @@ -60093,9 +60093,9 @@ func (ec *executionContext) _WebhookConfiguration_signingSecret(ctx context.Cont ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_signingSecret(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_signingSecret(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: true, IsResolver: true, @@ -60106,12 +60106,12 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_signingSecret(_ co return fc, nil } -func (ec *executionContext) _WebhookConfiguration_selectedEvents(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_selectedEvents(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_selectedEvents, + ec.fieldContext_WebhookSubscription_selectedEvents, func(ctx context.Context) (any, error) { return obj.SelectedEvents, nil }, @@ -60122,9 +60122,9 @@ func (ec *executionContext) _WebhookConfiguration_selectedEvents(ctx context.Con ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_selectedEvents(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_selectedEvents(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: false, IsResolver: false, @@ -60135,12 +60135,12 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_selectedEvents(_ c return fc, nil } -func (ec *executionContext) _WebhookConfiguration_createdAt(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_createdAt(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_createdAt, + ec.fieldContext_WebhookSubscription_createdAt, func(ctx context.Context) (any, error) { return obj.CreatedAt, nil }, @@ -60151,9 +60151,9 @@ func (ec *executionContext) _WebhookConfiguration_createdAt(ctx context.Context, ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_createdAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: false, IsResolver: false, @@ -60164,12 +60164,12 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_createdAt(_ contex return fc, nil } -func (ec *executionContext) _WebhookConfiguration_updatedAt(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_updatedAt(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_updatedAt, + ec.fieldContext_WebhookSubscription_updatedAt, func(ctx context.Context) (any, error) { return obj.UpdatedAt, nil }, @@ -60180,9 +60180,9 @@ func (ec *executionContext) _WebhookConfiguration_updatedAt(ctx context.Context, ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_updatedAt(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: false, IsResolver: false, @@ -60193,15 +60193,15 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_updatedAt(_ contex return fc, nil } -func (ec *executionContext) _WebhookConfiguration_events(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_events(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_events, + ec.fieldContext_WebhookSubscription_events, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.WebhookConfiguration().Events(ctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.WebhookEventOrderBy)) + return ec.resolvers.WebhookSubscription().Events(ctx, obj, fc.Args["first"].(*int), fc.Args["after"].(*page.CursorKey), fc.Args["last"].(*int), fc.Args["before"].(*page.CursorKey), fc.Args["orderBy"].(*types.WebhookEventOrderBy)) }, nil, ec.marshalNWebhookEventConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookEventConnection, @@ -60210,9 +60210,9 @@ func (ec *executionContext) _WebhookConfiguration_events(ctx context.Context, fi ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_events(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_events(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: true, IsResolver: true, @@ -60235,22 +60235,22 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_events(ctx context } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_WebhookConfiguration_events_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_WebhookSubscription_events_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _WebhookConfiguration_permission(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfiguration) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscription_permission(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscription) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfiguration_permission, + ec.fieldContext_WebhookSubscription_permission, func(ctx context.Context) (any, error) { fc := graphql.GetFieldContext(ctx) - return ec.resolvers.WebhookConfiguration().Permission(ctx, obj, fc.Args["action"].(string)) + return ec.resolvers.WebhookSubscription().Permission(ctx, obj, fc.Args["action"].(string)) }, nil, ec.marshalNBoolean2bool, @@ -60259,9 +60259,9 @@ func (ec *executionContext) _WebhookConfiguration_permission(ctx context.Context ) } -func (ec *executionContext) fieldContext_WebhookConfiguration_permission(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscription_permission(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfiguration", + Object: "WebhookSubscription", Field: field, IsMethod: true, IsResolver: true, @@ -60276,54 +60276,54 @@ func (ec *executionContext) fieldContext_WebhookConfiguration_permission(ctx con } }() ctx = graphql.WithFieldContext(ctx, fc) - if fc.Args, err = ec.field_WebhookConfiguration_permission_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { + if fc.Args, err = ec.field_WebhookSubscription_permission_args(ctx, field.ArgumentMap(ec.Variables)); err != nil { ec.Error(ctx, err) return fc, err } return fc, nil } -func (ec *executionContext) _WebhookConfigurationConnection_edges(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfigurationConnection) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscriptionConnection_edges(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscriptionConnection) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfigurationConnection_edges, + ec.fieldContext_WebhookSubscriptionConnection_edges, func(ctx context.Context) (any, error) { return obj.Edges, nil }, nil, - ec.marshalNWebhookConfigurationEdge2ᚕᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationEdgeᚄ, + ec.marshalNWebhookSubscriptionEdge2ᚕᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionEdgeᚄ, true, true, ) } -func (ec *executionContext) fieldContext_WebhookConfigurationConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscriptionConnection_edges(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfigurationConnection", + Object: "WebhookSubscriptionConnection", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "cursor": - return ec.fieldContext_WebhookConfigurationEdge_cursor(ctx, field) + return ec.fieldContext_WebhookSubscriptionEdge_cursor(ctx, field) case "node": - return ec.fieldContext_WebhookConfigurationEdge_node(ctx, field) + return ec.fieldContext_WebhookSubscriptionEdge_node(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type WebhookConfigurationEdge", field.Name) + return nil, fmt.Errorf("no field named %q was found under type WebhookSubscriptionEdge", field.Name) }, } return fc, nil } -func (ec *executionContext) _WebhookConfigurationConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfigurationConnection) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscriptionConnection_pageInfo(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscriptionConnection) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfigurationConnection_pageInfo, + ec.fieldContext_WebhookSubscriptionConnection_pageInfo, func(ctx context.Context) (any, error) { return obj.PageInfo, nil }, @@ -60334,9 +60334,9 @@ func (ec *executionContext) _WebhookConfigurationConnection_pageInfo(ctx context ) } -func (ec *executionContext) fieldContext_WebhookConfigurationConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscriptionConnection_pageInfo(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfigurationConnection", + Object: "WebhookSubscriptionConnection", Field: field, IsMethod: false, IsResolver: false, @@ -60357,14 +60357,14 @@ func (ec *executionContext) fieldContext_WebhookConfigurationConnection_pageInfo return fc, nil } -func (ec *executionContext) _WebhookConfigurationConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfigurationConnection) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscriptionConnection_totalCount(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscriptionConnection) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfigurationConnection_totalCount, + ec.fieldContext_WebhookSubscriptionConnection_totalCount, func(ctx context.Context) (any, error) { - return ec.resolvers.WebhookConfigurationConnection().TotalCount(ctx, obj) + return ec.resolvers.WebhookSubscriptionConnection().TotalCount(ctx, obj) }, nil, ec.marshalNInt2int, @@ -60373,9 +60373,9 @@ func (ec *executionContext) _WebhookConfigurationConnection_totalCount(ctx conte ) } -func (ec *executionContext) fieldContext_WebhookConfigurationConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscriptionConnection_totalCount(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfigurationConnection", + Object: "WebhookSubscriptionConnection", Field: field, IsMethod: true, IsResolver: true, @@ -60386,12 +60386,12 @@ func (ec *executionContext) fieldContext_WebhookConfigurationConnection_totalCou return fc, nil } -func (ec *executionContext) _WebhookConfigurationEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfigurationEdge) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscriptionEdge_cursor(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscriptionEdge) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfigurationEdge_cursor, + ec.fieldContext_WebhookSubscriptionEdge_cursor, func(ctx context.Context) (any, error) { return obj.Cursor, nil }, @@ -60402,9 +60402,9 @@ func (ec *executionContext) _WebhookConfigurationEdge_cursor(ctx context.Context ) } -func (ec *executionContext) fieldContext_WebhookConfigurationEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscriptionEdge_cursor(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfigurationEdge", + Object: "WebhookSubscriptionEdge", Field: field, IsMethod: false, IsResolver: false, @@ -60415,50 +60415,50 @@ func (ec *executionContext) fieldContext_WebhookConfigurationEdge_cursor(_ conte return fc, nil } -func (ec *executionContext) _WebhookConfigurationEdge_node(ctx context.Context, field graphql.CollectedField, obj *types.WebhookConfigurationEdge) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookSubscriptionEdge_node(ctx context.Context, field graphql.CollectedField, obj *types.WebhookSubscriptionEdge) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookConfigurationEdge_node, + ec.fieldContext_WebhookSubscriptionEdge_node, func(ctx context.Context) (any, error) { return obj.Node, nil }, nil, - ec.marshalNWebhookConfiguration2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfiguration, + ec.marshalNWebhookSubscription2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscription, true, true, ) } -func (ec *executionContext) fieldContext_WebhookConfigurationEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookSubscriptionEdge_node(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ - Object: "WebhookConfigurationEdge", + Object: "WebhookSubscriptionEdge", Field: field, IsMethod: false, IsResolver: false, Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { switch field.Name { case "id": - return ec.fieldContext_WebhookConfiguration_id(ctx, field) + return ec.fieldContext_WebhookSubscription_id(ctx, field) case "organization": - return ec.fieldContext_WebhookConfiguration_organization(ctx, field) + return ec.fieldContext_WebhookSubscription_organization(ctx, field) case "endpointUrl": - return ec.fieldContext_WebhookConfiguration_endpointUrl(ctx, field) + return ec.fieldContext_WebhookSubscription_endpointUrl(ctx, field) case "signingSecret": - return ec.fieldContext_WebhookConfiguration_signingSecret(ctx, field) + return ec.fieldContext_WebhookSubscription_signingSecret(ctx, field) case "selectedEvents": - return ec.fieldContext_WebhookConfiguration_selectedEvents(ctx, field) + return ec.fieldContext_WebhookSubscription_selectedEvents(ctx, field) case "createdAt": - return ec.fieldContext_WebhookConfiguration_createdAt(ctx, field) + return ec.fieldContext_WebhookSubscription_createdAt(ctx, field) case "updatedAt": - return ec.fieldContext_WebhookConfiguration_updatedAt(ctx, field) + return ec.fieldContext_WebhookSubscription_updatedAt(ctx, field) case "events": - return ec.fieldContext_WebhookConfiguration_events(ctx, field) + return ec.fieldContext_WebhookSubscription_events(ctx, field) case "permission": - return ec.fieldContext_WebhookConfiguration_permission(ctx, field) + return ec.fieldContext_WebhookSubscription_permission(ctx, field) } - return nil, fmt.Errorf("no field named %q was found under type WebhookConfiguration", field.Name) + return nil, fmt.Errorf("no field named %q was found under type WebhookSubscription", field.Name) }, } return fc, nil @@ -60493,14 +60493,14 @@ func (ec *executionContext) fieldContext_WebhookEvent_id(_ context.Context, fiel return fc, nil } -func (ec *executionContext) _WebhookEvent_webhookConfigurationId(ctx context.Context, field graphql.CollectedField, obj *types.WebhookEvent) (ret graphql.Marshaler) { +func (ec *executionContext) _WebhookEvent_webhookSubscriptionId(ctx context.Context, field graphql.CollectedField, obj *types.WebhookEvent) (ret graphql.Marshaler) { return graphql.ResolveField( ctx, ec.OperationContext, field, - ec.fieldContext_WebhookEvent_webhookConfigurationId, + ec.fieldContext_WebhookEvent_webhookSubscriptionId, func(ctx context.Context) (any, error) { - return obj.WebhookConfigurationID, nil + return obj.WebhookSubscriptionID, nil }, nil, ec.marshalNID2goᚗproboᚗincᚋproboᚋpkgᚋgidᚐGID, @@ -60509,7 +60509,7 @@ func (ec *executionContext) _WebhookEvent_webhookConfigurationId(ctx context.Con ) } -func (ec *executionContext) fieldContext_WebhookEvent_webhookConfigurationId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { +func (ec *executionContext) fieldContext_WebhookEvent_webhookSubscriptionId(_ context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { fc = &graphql.FieldContext{ Object: "WebhookEvent", Field: field, @@ -60767,8 +60767,8 @@ func (ec *executionContext) fieldContext_WebhookEventEdge_node(_ context.Context switch field.Name { case "id": return ec.fieldContext_WebhookEvent_id(ctx, field) - case "webhookConfigurationId": - return ec.fieldContext_WebhookEvent_webhookConfigurationId(ctx, field) + case "webhookSubscriptionId": + return ec.fieldContext_WebhookEvent_webhookSubscriptionId(ctx, field) case "status": return ec.fieldContext_WebhookEvent_status(ctx, field) case "response": @@ -64948,8 +64948,8 @@ func (ec *executionContext) unmarshalInputCreateVendorServiceInput(ctx context.C return it, nil } -func (ec *executionContext) unmarshalInputCreateWebhookConfigurationInput(ctx context.Context, obj any) (types.CreateWebhookConfigurationInput, error) { - var it types.CreateWebhookConfigurationInput +func (ec *executionContext) unmarshalInputCreateWebhookSubscriptionInput(ctx context.Context, obj any) (types.CreateWebhookSubscriptionInput, error) { + var it types.CreateWebhookSubscriptionInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v @@ -66301,27 +66301,27 @@ func (ec *executionContext) unmarshalInputDeleteVendorServiceInput(ctx context.C return it, nil } -func (ec *executionContext) unmarshalInputDeleteWebhookConfigurationInput(ctx context.Context, obj any) (types.DeleteWebhookConfigurationInput, error) { - var it types.DeleteWebhookConfigurationInput +func (ec *executionContext) unmarshalInputDeleteWebhookSubscriptionInput(ctx context.Context, obj any) (types.DeleteWebhookSubscriptionInput, error) { + var it types.DeleteWebhookSubscriptionInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v } - fieldsInOrder := [...]string{"webhookConfigurationId"} + fieldsInOrder := [...]string{"webhookSubscriptionId"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { continue } switch k { - case "webhookConfigurationId": - ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("webhookConfigurationId")) + case "webhookSubscriptionId": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("webhookSubscriptionId")) data, err := ec.unmarshalNID2goᚗproboᚗincᚋproboᚋpkgᚋgidᚐGID(ctx, v) if err != nil { return it, err } - it.WebhookConfigurationID = data + it.WebhookSubscriptionID = data } } @@ -69937,8 +69937,8 @@ func (ec *executionContext) unmarshalInputUpdateVendorServiceInput(ctx context.C return it, nil } -func (ec *executionContext) unmarshalInputUpdateWebhookConfigurationInput(ctx context.Context, obj any) (types.UpdateWebhookConfigurationInput, error) { - var it types.UpdateWebhookConfigurationInput +func (ec *executionContext) unmarshalInputUpdateWebhookSubscriptionInput(ctx context.Context, obj any) (types.UpdateWebhookSubscriptionInput, error) { + var it types.UpdateWebhookSubscriptionInput asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v @@ -70449,8 +70449,8 @@ func (ec *executionContext) unmarshalInputVendorServiceOrder(ctx context.Context return it, nil } -func (ec *executionContext) unmarshalInputWebhookConfigurationOrder(ctx context.Context, obj any) (types.WebhookConfigurationOrderBy, error) { - var it types.WebhookConfigurationOrderBy +func (ec *executionContext) unmarshalInputWebhookSubscriptionOrder(ctx context.Context, obj any) (types.WebhookSubscriptionOrderBy, error) { + var it types.WebhookSubscriptionOrderBy asMap := map[string]any{} for k, v := range obj.(map[string]any) { asMap[k] = v @@ -70472,7 +70472,7 @@ func (ec *executionContext) unmarshalInputWebhookConfigurationOrder(ctx context. it.Direction = data case "field": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("field")) - data, err := ec.unmarshalNWebhookConfigurationOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookConfigurationOrderField(ctx, v) + data, err := ec.unmarshalNWebhookSubscriptionOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookSubscriptionOrderField(ctx, v) if err != nil { return it, err } @@ -70532,13 +70532,13 @@ func (ec *executionContext) _Node(ctx context.Context, sel ast.SelectionSet, obj return graphql.Null } return ec._WebhookEvent(ctx, sel, obj) - case types.WebhookConfiguration: - return ec._WebhookConfiguration(ctx, sel, &obj) - case *types.WebhookConfiguration: + case types.WebhookSubscription: + return ec._WebhookSubscription(ctx, sel, &obj) + case *types.WebhookSubscription: if obj == nil { return graphql.Null } - return ec._WebhookConfiguration(ctx, sel, obj) + return ec._WebhookSubscription(ctx, sel, obj) case types.VendorService: return ec._VendorService(ctx, sel, &obj) case *types.VendorService: @@ -74470,19 +74470,19 @@ func (ec *executionContext) _CreateVendorServicePayload(ctx context.Context, sel return out } -var createWebhookConfigurationPayloadImplementors = []string{"CreateWebhookConfigurationPayload"} +var createWebhookSubscriptionPayloadImplementors = []string{"CreateWebhookSubscriptionPayload"} -func (ec *executionContext) _CreateWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, obj *types.CreateWebhookConfigurationPayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, createWebhookConfigurationPayloadImplementors) +func (ec *executionContext) _CreateWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, obj *types.CreateWebhookSubscriptionPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, createWebhookSubscriptionPayloadImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("CreateWebhookConfigurationPayload") - case "webhookConfigurationEdge": - out.Values[i] = ec._CreateWebhookConfigurationPayload_webhookConfigurationEdge(ctx, field, obj) + out.Values[i] = graphql.MarshalString("CreateWebhookSubscriptionPayload") + case "webhookSubscriptionEdge": + out.Values[i] = ec._CreateWebhookSubscriptionPayload_webhookSubscriptionEdge(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -76973,19 +76973,19 @@ func (ec *executionContext) _DeleteVendorServicePayload(ctx context.Context, sel return out } -var deleteWebhookConfigurationPayloadImplementors = []string{"DeleteWebhookConfigurationPayload"} +var deleteWebhookSubscriptionPayloadImplementors = []string{"DeleteWebhookSubscriptionPayload"} -func (ec *executionContext) _DeleteWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, obj *types.DeleteWebhookConfigurationPayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, deleteWebhookConfigurationPayloadImplementors) +func (ec *executionContext) _DeleteWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, obj *types.DeleteWebhookSubscriptionPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, deleteWebhookSubscriptionPayloadImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("DeleteWebhookConfigurationPayload") - case "deletedWebhookConfigurationId": - out.Values[i] = ec._DeleteWebhookConfigurationPayload_deletedWebhookConfigurationId(ctx, field, obj) + out.Values[i] = graphql.MarshalString("DeleteWebhookSubscriptionPayload") + case "deletedWebhookSubscriptionId": + out.Values[i] = ec._DeleteWebhookSubscriptionPayload_deletedWebhookSubscriptionId(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -80547,23 +80547,23 @@ func (ec *executionContext) _Mutation(ctx context.Context, sel ast.SelectionSet) if out.Values[i] == graphql.Null { out.Invalids++ } - case "createWebhookConfiguration": + case "createWebhookSubscription": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_createWebhookConfiguration(ctx, field) + return ec._Mutation_createWebhookSubscription(ctx, field) }) if out.Values[i] == graphql.Null { out.Invalids++ } - case "updateWebhookConfiguration": + case "updateWebhookSubscription": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_updateWebhookConfiguration(ctx, field) + return ec._Mutation_updateWebhookSubscription(ctx, field) }) if out.Values[i] == graphql.Null { out.Invalids++ } - case "deleteWebhookConfiguration": + case "deleteWebhookSubscription": out.Values[i] = ec.OperationContext.RootResolverMiddleware(innerCtx, func(ctx context.Context) (res graphql.Marshaler) { - return ec._Mutation_deleteWebhookConfiguration(ctx, field) + return ec._Mutation_deleteWebhookSubscription(ctx, field) }) if out.Values[i] == graphql.Null { out.Invalids++ @@ -82683,7 +82683,7 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection } out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) - case "webhookConfigurations": + case "webhookSubscriptions": field := field innerFunc := func(ctx context.Context, fs *graphql.FieldSet) (res graphql.Marshaler) { @@ -82692,7 +82692,7 @@ func (ec *executionContext) _Organization(ctx context.Context, sel ast.Selection ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._Organization_webhookConfigurations(ctx, field, obj) + res = ec._Organization_webhookSubscriptions(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -89076,19 +89076,19 @@ func (ec *executionContext) _UpdateVendorServicePayload(ctx context.Context, sel return out } -var updateWebhookConfigurationPayloadImplementors = []string{"UpdateWebhookConfigurationPayload"} +var updateWebhookSubscriptionPayloadImplementors = []string{"UpdateWebhookSubscriptionPayload"} -func (ec *executionContext) _UpdateWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, obj *types.UpdateWebhookConfigurationPayload) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, updateWebhookConfigurationPayloadImplementors) +func (ec *executionContext) _UpdateWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, obj *types.UpdateWebhookSubscriptionPayload) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, updateWebhookSubscriptionPayloadImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("UpdateWebhookConfigurationPayload") - case "webhookConfiguration": - out.Values[i] = ec._UpdateWebhookConfigurationPayload_webhookConfiguration(ctx, field, obj) + out.Values[i] = graphql.MarshalString("UpdateWebhookSubscriptionPayload") + case "webhookSubscription": + out.Values[i] = ec._UpdateWebhookSubscriptionPayload_webhookSubscription(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -91286,19 +91286,19 @@ func (ec *executionContext) _Viewer(ctx context.Context, sel ast.SelectionSet, o return out } -var webhookConfigurationImplementors = []string{"WebhookConfiguration", "Node"} +var webhookSubscriptionImplementors = []string{"WebhookSubscription", "Node"} -func (ec *executionContext) _WebhookConfiguration(ctx context.Context, sel ast.SelectionSet, obj *types.WebhookConfiguration) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, webhookConfigurationImplementors) +func (ec *executionContext) _WebhookSubscription(ctx context.Context, sel ast.SelectionSet, obj *types.WebhookSubscription) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookSubscriptionImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("WebhookConfiguration") + out.Values[i] = graphql.MarshalString("WebhookSubscription") case "id": - out.Values[i] = ec._WebhookConfiguration_id(ctx, field, obj) + out.Values[i] = ec._WebhookSubscription_id(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -91311,7 +91311,7 @@ func (ec *executionContext) _WebhookConfiguration(ctx context.Context, sel ast.S ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._WebhookConfiguration_organization(ctx, field, obj) + res = ec._WebhookSubscription_organization(ctx, field, obj) return res } @@ -91336,7 +91336,7 @@ func (ec *executionContext) _WebhookConfiguration(ctx context.Context, sel ast.S out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "endpointUrl": - out.Values[i] = ec._WebhookConfiguration_endpointUrl(ctx, field, obj) + out.Values[i] = ec._WebhookSubscription_endpointUrl(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -91349,7 +91349,7 @@ func (ec *executionContext) _WebhookConfiguration(ctx context.Context, sel ast.S ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._WebhookConfiguration_signingSecret(ctx, field, obj) + res = ec._WebhookSubscription_signingSecret(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -91377,17 +91377,17 @@ func (ec *executionContext) _WebhookConfiguration(ctx context.Context, sel ast.S out.Concurrently(i, func(ctx context.Context) graphql.Marshaler { return innerFunc(ctx, out) }) case "selectedEvents": - out.Values[i] = ec._WebhookConfiguration_selectedEvents(ctx, field, obj) + out.Values[i] = ec._WebhookSubscription_selectedEvents(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } case "createdAt": - out.Values[i] = ec._WebhookConfiguration_createdAt(ctx, field, obj) + out.Values[i] = ec._WebhookSubscription_createdAt(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } case "updatedAt": - out.Values[i] = ec._WebhookConfiguration_updatedAt(ctx, field, obj) + out.Values[i] = ec._WebhookSubscription_updatedAt(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -91400,7 +91400,7 @@ func (ec *executionContext) _WebhookConfiguration(ctx context.Context, sel ast.S ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._WebhookConfiguration_events(ctx, field, obj) + res = ec._WebhookSubscription_events(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -91436,7 +91436,7 @@ func (ec *executionContext) _WebhookConfiguration(ctx context.Context, sel ast.S ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._WebhookConfiguration_permission(ctx, field, obj) + res = ec._WebhookSubscription_permission(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -91486,24 +91486,24 @@ func (ec *executionContext) _WebhookConfiguration(ctx context.Context, sel ast.S return out } -var webhookConfigurationConnectionImplementors = []string{"WebhookConfigurationConnection"} +var webhookSubscriptionConnectionImplementors = []string{"WebhookSubscriptionConnection"} -func (ec *executionContext) _WebhookConfigurationConnection(ctx context.Context, sel ast.SelectionSet, obj *types.WebhookConfigurationConnection) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, webhookConfigurationConnectionImplementors) +func (ec *executionContext) _WebhookSubscriptionConnection(ctx context.Context, sel ast.SelectionSet, obj *types.WebhookSubscriptionConnection) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookSubscriptionConnectionImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("WebhookConfigurationConnection") + out.Values[i] = graphql.MarshalString("WebhookSubscriptionConnection") case "edges": - out.Values[i] = ec._WebhookConfigurationConnection_edges(ctx, field, obj) + out.Values[i] = ec._WebhookSubscriptionConnection_edges(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } case "pageInfo": - out.Values[i] = ec._WebhookConfigurationConnection_pageInfo(ctx, field, obj) + out.Values[i] = ec._WebhookSubscriptionConnection_pageInfo(ctx, field, obj) if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } @@ -91516,7 +91516,7 @@ func (ec *executionContext) _WebhookConfigurationConnection(ctx context.Context, ec.Error(ctx, ec.Recover(ctx, r)) } }() - res = ec._WebhookConfigurationConnection_totalCount(ctx, field, obj) + res = ec._WebhookSubscriptionConnection_totalCount(ctx, field, obj) if res == graphql.Null { atomic.AddUint32(&fs.Invalids, 1) } @@ -91566,24 +91566,24 @@ func (ec *executionContext) _WebhookConfigurationConnection(ctx context.Context, return out } -var webhookConfigurationEdgeImplementors = []string{"WebhookConfigurationEdge"} +var webhookSubscriptionEdgeImplementors = []string{"WebhookSubscriptionEdge"} -func (ec *executionContext) _WebhookConfigurationEdge(ctx context.Context, sel ast.SelectionSet, obj *types.WebhookConfigurationEdge) graphql.Marshaler { - fields := graphql.CollectFields(ec.OperationContext, sel, webhookConfigurationEdgeImplementors) +func (ec *executionContext) _WebhookSubscriptionEdge(ctx context.Context, sel ast.SelectionSet, obj *types.WebhookSubscriptionEdge) graphql.Marshaler { + fields := graphql.CollectFields(ec.OperationContext, sel, webhookSubscriptionEdgeImplementors) out := graphql.NewFieldSet(fields) deferred := make(map[string]*graphql.FieldSet) for i, field := range fields { switch field.Name { case "__typename": - out.Values[i] = graphql.MarshalString("WebhookConfigurationEdge") + out.Values[i] = graphql.MarshalString("WebhookSubscriptionEdge") case "cursor": - out.Values[i] = ec._WebhookConfigurationEdge_cursor(ctx, field, obj) + out.Values[i] = ec._WebhookSubscriptionEdge_cursor(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } case "node": - out.Values[i] = ec._WebhookConfigurationEdge_node(ctx, field, obj) + out.Values[i] = ec._WebhookSubscriptionEdge_node(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -91626,8 +91626,8 @@ func (ec *executionContext) _WebhookEvent(ctx context.Context, sel ast.Selection if out.Values[i] == graphql.Null { out.Invalids++ } - case "webhookConfigurationId": - out.Values[i] = ec._WebhookEvent_webhookConfigurationId(ctx, field, obj) + case "webhookSubscriptionId": + out.Values[i] = ec._WebhookEvent_webhookSubscriptionId(ctx, field, obj) if out.Values[i] == graphql.Null { out.Invalids++ } @@ -94279,23 +94279,23 @@ func (ec *executionContext) marshalNCreateVendorServicePayload2ᚖgoᚗproboᚗi return ec._CreateVendorServicePayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNCreateWebhookConfigurationInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookConfigurationInput(ctx context.Context, v any) (types.CreateWebhookConfigurationInput, error) { - res, err := ec.unmarshalInputCreateWebhookConfigurationInput(ctx, v) +func (ec *executionContext) unmarshalNCreateWebhookSubscriptionInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookSubscriptionInput(ctx context.Context, v any) (types.CreateWebhookSubscriptionInput, error) { + res, err := ec.unmarshalInputCreateWebhookSubscriptionInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNCreateWebhookConfigurationPayload2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, v types.CreateWebhookConfigurationPayload) graphql.Marshaler { - return ec._CreateWebhookConfigurationPayload(ctx, sel, &v) +func (ec *executionContext) marshalNCreateWebhookSubscriptionPayload2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, v types.CreateWebhookSubscriptionPayload) graphql.Marshaler { + return ec._CreateWebhookSubscriptionPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNCreateWebhookConfigurationPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, v *types.CreateWebhookConfigurationPayload) graphql.Marshaler { +func (ec *executionContext) marshalNCreateWebhookSubscriptionPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐCreateWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, v *types.CreateWebhookSubscriptionPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._CreateWebhookConfigurationPayload(ctx, sel, v) + return ec._CreateWebhookSubscriptionPayload(ctx, sel, v) } func (ec *executionContext) unmarshalNCursorKey2goᚗproboᚗincᚋproboᚋpkgᚋpageᚐCursorKey(ctx context.Context, v any) (page.CursorKey, error) { @@ -95470,23 +95470,23 @@ func (ec *executionContext) marshalNDeleteVendorServicePayload2ᚖgoᚗproboᚗi return ec._DeleteVendorServicePayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNDeleteWebhookConfigurationInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookConfigurationInput(ctx context.Context, v any) (types.DeleteWebhookConfigurationInput, error) { - res, err := ec.unmarshalInputDeleteWebhookConfigurationInput(ctx, v) +func (ec *executionContext) unmarshalNDeleteWebhookSubscriptionInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookSubscriptionInput(ctx context.Context, v any) (types.DeleteWebhookSubscriptionInput, error) { + res, err := ec.unmarshalInputDeleteWebhookSubscriptionInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNDeleteWebhookConfigurationPayload2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, v types.DeleteWebhookConfigurationPayload) graphql.Marshaler { - return ec._DeleteWebhookConfigurationPayload(ctx, sel, &v) +func (ec *executionContext) marshalNDeleteWebhookSubscriptionPayload2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, v types.DeleteWebhookSubscriptionPayload) graphql.Marshaler { + return ec._DeleteWebhookSubscriptionPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNDeleteWebhookConfigurationPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, v *types.DeleteWebhookConfigurationPayload) graphql.Marshaler { +func (ec *executionContext) marshalNDeleteWebhookSubscriptionPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDeleteWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, v *types.DeleteWebhookSubscriptionPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._DeleteWebhookConfigurationPayload(ctx, sel, v) + return ec._DeleteWebhookSubscriptionPayload(ctx, sel, v) } func (ec *executionContext) marshalNDocument2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐDocument(ctx context.Context, sel ast.SelectionSet, v types.Document) graphql.Marshaler { @@ -99907,23 +99907,23 @@ func (ec *executionContext) marshalNUpdateVendorServicePayload2ᚖgoᚗproboᚗi return ec._UpdateVendorServicePayload(ctx, sel, v) } -func (ec *executionContext) unmarshalNUpdateWebhookConfigurationInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookConfigurationInput(ctx context.Context, v any) (types.UpdateWebhookConfigurationInput, error) { - res, err := ec.unmarshalInputUpdateWebhookConfigurationInput(ctx, v) +func (ec *executionContext) unmarshalNUpdateWebhookSubscriptionInput2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookSubscriptionInput(ctx context.Context, v any) (types.UpdateWebhookSubscriptionInput, error) { + res, err := ec.unmarshalInputUpdateWebhookSubscriptionInput(ctx, v) return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNUpdateWebhookConfigurationPayload2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, v types.UpdateWebhookConfigurationPayload) graphql.Marshaler { - return ec._UpdateWebhookConfigurationPayload(ctx, sel, &v) +func (ec *executionContext) marshalNUpdateWebhookSubscriptionPayload2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, v types.UpdateWebhookSubscriptionPayload) graphql.Marshaler { + return ec._UpdateWebhookSubscriptionPayload(ctx, sel, &v) } -func (ec *executionContext) marshalNUpdateWebhookConfigurationPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookConfigurationPayload(ctx context.Context, sel ast.SelectionSet, v *types.UpdateWebhookConfigurationPayload) graphql.Marshaler { +func (ec *executionContext) marshalNUpdateWebhookSubscriptionPayload2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐUpdateWebhookSubscriptionPayload(ctx context.Context, sel ast.SelectionSet, v *types.UpdateWebhookSubscriptionPayload) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._UpdateWebhookConfigurationPayload(ctx, sel, v) + return ec._UpdateWebhookSubscriptionPayload(ctx, sel, v) } func (ec *executionContext) unmarshalNUpload2githubᚗcomᚋ99designsᚋgqlgenᚋgraphqlᚐUpload(ctx context.Context, v any) (graphql.Upload, error) { @@ -100696,31 +100696,31 @@ func (ec *executionContext) marshalNViewer2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋs return ec._Viewer(ctx, sel, v) } -func (ec *executionContext) marshalNWebhookConfiguration2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfiguration(ctx context.Context, sel ast.SelectionSet, v *types.WebhookConfiguration) graphql.Marshaler { +func (ec *executionContext) marshalNWebhookSubscription2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscription(ctx context.Context, sel ast.SelectionSet, v *types.WebhookSubscription) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._WebhookConfiguration(ctx, sel, v) + return ec._WebhookSubscription(ctx, sel, v) } -func (ec *executionContext) marshalNWebhookConfigurationConnection2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationConnection(ctx context.Context, sel ast.SelectionSet, v types.WebhookConfigurationConnection) graphql.Marshaler { - return ec._WebhookConfigurationConnection(ctx, sel, &v) +func (ec *executionContext) marshalNWebhookSubscriptionConnection2goᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionConnection(ctx context.Context, sel ast.SelectionSet, v types.WebhookSubscriptionConnection) graphql.Marshaler { + return ec._WebhookSubscriptionConnection(ctx, sel, &v) } -func (ec *executionContext) marshalNWebhookConfigurationConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationConnection(ctx context.Context, sel ast.SelectionSet, v *types.WebhookConfigurationConnection) graphql.Marshaler { +func (ec *executionContext) marshalNWebhookSubscriptionConnection2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionConnection(ctx context.Context, sel ast.SelectionSet, v *types.WebhookSubscriptionConnection) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._WebhookConfigurationConnection(ctx, sel, v) + return ec._WebhookSubscriptionConnection(ctx, sel, v) } -func (ec *executionContext) marshalNWebhookConfigurationEdge2ᚕᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*types.WebhookConfigurationEdge) graphql.Marshaler { +func (ec *executionContext) marshalNWebhookSubscriptionEdge2ᚕᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionEdgeᚄ(ctx context.Context, sel ast.SelectionSet, v []*types.WebhookSubscriptionEdge) graphql.Marshaler { ret := make(graphql.Array, len(v)) var wg sync.WaitGroup isLen1 := len(v) == 1 @@ -100744,7 +100744,7 @@ func (ec *executionContext) marshalNWebhookConfigurationEdge2ᚕᚖgoᚗproboᚗ if !isLen1 { defer wg.Done() } - ret[i] = ec.marshalNWebhookConfigurationEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationEdge(ctx, sel, v[i]) + ret[i] = ec.marshalNWebhookSubscriptionEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionEdge(ctx, sel, v[i]) } if isLen1 { f(i) @@ -100764,25 +100764,25 @@ func (ec *executionContext) marshalNWebhookConfigurationEdge2ᚕᚖgoᚗproboᚗ return ret } -func (ec *executionContext) marshalNWebhookConfigurationEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationEdge(ctx context.Context, sel ast.SelectionSet, v *types.WebhookConfigurationEdge) graphql.Marshaler { +func (ec *executionContext) marshalNWebhookSubscriptionEdge2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionEdge(ctx context.Context, sel ast.SelectionSet, v *types.WebhookSubscriptionEdge) graphql.Marshaler { if v == nil { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") } return graphql.Null } - return ec._WebhookConfigurationEdge(ctx, sel, v) + return ec._WebhookSubscriptionEdge(ctx, sel, v) } -func (ec *executionContext) unmarshalNWebhookConfigurationOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookConfigurationOrderField(ctx context.Context, v any) (coredata.WebhookConfigurationOrderField, error) { +func (ec *executionContext) unmarshalNWebhookSubscriptionOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookSubscriptionOrderField(ctx context.Context, v any) (coredata.WebhookSubscriptionOrderField, error) { tmp, err := graphql.UnmarshalString(v) - res := unmarshalNWebhookConfigurationOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookConfigurationOrderField[tmp] + res := unmarshalNWebhookSubscriptionOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookSubscriptionOrderField[tmp] return res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) marshalNWebhookConfigurationOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookConfigurationOrderField(ctx context.Context, sel ast.SelectionSet, v coredata.WebhookConfigurationOrderField) graphql.Marshaler { +func (ec *executionContext) marshalNWebhookSubscriptionOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookSubscriptionOrderField(ctx context.Context, sel ast.SelectionSet, v coredata.WebhookSubscriptionOrderField) graphql.Marshaler { _ = sel - res := graphql.MarshalString(marshalNWebhookConfigurationOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookConfigurationOrderField[v]) + res := graphql.MarshalString(marshalNWebhookSubscriptionOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookSubscriptionOrderField[v]) if res == graphql.Null { if !graphql.HasFieldError(ctx, graphql.GetFieldContext(ctx)) { graphql.AddErrorf(ctx, "the requested element is null which the schema does not allow") @@ -100792,11 +100792,11 @@ func (ec *executionContext) marshalNWebhookConfigurationOrderField2goᚗproboᚗ } var ( - unmarshalNWebhookConfigurationOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookConfigurationOrderField = map[string]coredata.WebhookConfigurationOrderField{ - "CREATED_AT": coredata.WebhookConfigurationOrderFieldCreatedAt, + unmarshalNWebhookSubscriptionOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookSubscriptionOrderField = map[string]coredata.WebhookSubscriptionOrderField{ + "CREATED_AT": coredata.WebhookSubscriptionOrderFieldCreatedAt, } - marshalNWebhookConfigurationOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookConfigurationOrderField = map[coredata.WebhookConfigurationOrderField]string{ - coredata.WebhookConfigurationOrderFieldCreatedAt: "CREATED_AT", + marshalNWebhookSubscriptionOrderField2goᚗproboᚗincᚋproboᚋpkgᚋcoredataᚐWebhookSubscriptionOrderField = map[coredata.WebhookSubscriptionOrderField]string{ + coredata.WebhookSubscriptionOrderFieldCreatedAt: "CREATED_AT", } ) @@ -103105,11 +103105,11 @@ func (ec *executionContext) unmarshalOVendorServiceOrder2ᚖgoᚗproboᚗincᚋp return &res, graphql.ErrorOnPath(ctx, err) } -func (ec *executionContext) unmarshalOWebhookConfigurationOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookConfigurationOrderBy(ctx context.Context, v any) (*types.WebhookConfigurationOrderBy, error) { +func (ec *executionContext) unmarshalOWebhookSubscriptionOrder2ᚖgoᚗproboᚗincᚋproboᚋpkgᚋserverᚋapiᚋconsoleᚋv1ᚋtypesᚐWebhookSubscriptionOrderBy(ctx context.Context, v any) (*types.WebhookSubscriptionOrderBy, error) { if v == nil { return nil, nil } - res, err := ec.unmarshalInputWebhookConfigurationOrder(ctx, v) + res, err := ec.unmarshalInputWebhookSubscriptionOrder(ctx, v) return &res, graphql.ErrorOnPath(ctx, err) } diff --git a/pkg/server/api/console/v1/types/types.go b/pkg/server/api/console/v1/types/types.go index 580a35dc6..e98d442f3 100644 --- a/pkg/server/api/console/v1/types/types.go +++ b/pkg/server/api/console/v1/types/types.go @@ -693,14 +693,14 @@ type CreateVendorServicePayload struct { VendorServiceEdge *VendorServiceEdge `json:"vendorServiceEdge"` } -type CreateWebhookConfigurationInput struct { +type CreateWebhookSubscriptionInput struct { OrganizationID gid.GID `json:"organizationId"` EndpointURL string `json:"endpointUrl"` SelectedEvents []coredata.WebhookEventType `json:"selectedEvents"` } -type CreateWebhookConfigurationPayload struct { - WebhookConfigurationEdge *WebhookConfigurationEdge `json:"webhookConfigurationEdge"` +type CreateWebhookSubscriptionPayload struct { + WebhookSubscriptionEdge *WebhookSubscriptionEdge `json:"webhookSubscriptionEdge"` } type CustomDomain struct { @@ -1113,12 +1113,12 @@ type DeleteVendorServicePayload struct { DeletedVendorServiceID gid.GID `json:"deletedVendorServiceId"` } -type DeleteWebhookConfigurationInput struct { - WebhookConfigurationID gid.GID `json:"webhookConfigurationId"` +type DeleteWebhookSubscriptionInput struct { + WebhookSubscriptionID gid.GID `json:"webhookSubscriptionId"` } -type DeleteWebhookConfigurationPayload struct { - DeletedWebhookConfigurationID gid.GID `json:"deletedWebhookConfigurationId"` +type DeleteWebhookSubscriptionPayload struct { + DeletedWebhookSubscriptionID gid.GID `json:"deletedWebhookSubscriptionId"` } type Document struct { @@ -1517,7 +1517,7 @@ type Organization struct { TrustCenterFiles *TrustCenterFileConnection `json:"trustCenterFiles"` TrustCenter *TrustCenter `json:"trustCenter,omitempty"` CustomDomain *CustomDomain `json:"customDomain,omitempty"` - WebhookConfigurations *WebhookConfigurationConnection `json:"webhookConfigurations"` + WebhookSubscriptions *WebhookSubscriptionConnection `json:"webhookSubscriptions"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` Permission bool `json:"permission"` @@ -2361,14 +2361,14 @@ type UpdateVendorServicePayload struct { VendorService *VendorService `json:"vendorService"` } -type UpdateWebhookConfigurationInput struct { +type UpdateWebhookSubscriptionInput struct { ID gid.GID `json:"id"` EndpointURL *string `json:"endpointUrl,omitempty"` SelectedEvents []coredata.WebhookEventType `json:"selectedEvents,omitempty"` } -type UpdateWebhookConfigurationPayload struct { - WebhookConfiguration *WebhookConfiguration `json:"webhookConfiguration"` +type UpdateWebhookSubscriptionPayload struct { + WebhookSubscription *WebhookSubscription `json:"webhookSubscription"` } type UploadAuditReportInput struct { @@ -2623,7 +2623,7 @@ type Viewer struct { SignableDocument *SignableDocument `json:"signableDocument,omitempty"` } -type WebhookConfiguration struct { +type WebhookSubscription struct { ID gid.GID `json:"id"` Organization *Organization `json:"organization,omitempty"` EndpointURL string `json:"endpointUrl"` @@ -2635,17 +2635,17 @@ type WebhookConfiguration struct { Permission bool `json:"permission"` } -func (WebhookConfiguration) IsNode() {} -func (this WebhookConfiguration) GetID() gid.GID { return this.ID } +func (WebhookSubscription) IsNode() {} +func (this WebhookSubscription) GetID() gid.GID { return this.ID } -type WebhookConfigurationEdge struct { - Cursor page.CursorKey `json:"cursor"` - Node *WebhookConfiguration `json:"node"` +type WebhookSubscriptionEdge struct { + Cursor page.CursorKey `json:"cursor"` + Node *WebhookSubscription `json:"node"` } type WebhookEvent struct { ID gid.GID `json:"id"` - WebhookConfigurationID gid.GID `json:"webhookConfigurationId"` + WebhookSubscriptionID gid.GID `json:"webhookSubscriptionId"` Status coredata.WebhookEventStatus `json:"status"` Response *string `json:"response,omitempty"` CreatedAt time.Time `json:"createdAt"` diff --git a/pkg/server/api/console/v1/types/webhook_event.go b/pkg/server/api/console/v1/types/webhook_event.go index f8d64c51a..ea512238e 100644 --- a/pkg/server/api/console/v1/types/webhook_event.go +++ b/pkg/server/api/console/v1/types/webhook_event.go @@ -69,7 +69,7 @@ func NewWebhookEvent(we *coredata.WebhookEvent) *WebhookEvent { return &WebhookEvent{ ID: we.ID, - WebhookConfigurationID: we.WebhookConfigurationID, + WebhookSubscriptionID: we.WebhookSubscriptionID, Status: we.Status, Response: response, CreatedAt: we.CreatedAt, diff --git a/pkg/server/api/console/v1/types/webhook_configuration.go b/pkg/server/api/console/v1/types/webhook_subscription.go similarity index 62% rename from pkg/server/api/console/v1/types/webhook_configuration.go rename to pkg/server/api/console/v1/types/webhook_subscription.go index 907a7fc07..387189620 100644 --- a/pkg/server/api/console/v1/types/webhook_configuration.go +++ b/pkg/server/api/console/v1/types/webhook_subscription.go @@ -21,11 +21,11 @@ import ( ) type ( - WebhookConfigurationOrderBy OrderBy[coredata.WebhookConfigurationOrderField] + WebhookSubscriptionOrderBy OrderBy[coredata.WebhookSubscriptionOrderField] - WebhookConfigurationConnection struct { + WebhookSubscriptionConnection struct { TotalCount int - Edges []*WebhookConfigurationEdge + Edges []*WebhookSubscriptionEdge PageInfo PageInfo Resolver any @@ -33,18 +33,18 @@ type ( } ) -func NewWebhookConfigurationConnection( - p *page.Page[*coredata.WebhookConfiguration, coredata.WebhookConfigurationOrderField], +func NewWebhookSubscriptionConnection( + p *page.Page[*coredata.WebhookSubscription, coredata.WebhookSubscriptionOrderField], parentType any, parentID gid.GID, -) *WebhookConfigurationConnection { - var edges = make([]*WebhookConfigurationEdge, len(p.Data)) +) *WebhookSubscriptionConnection { + var edges = make([]*WebhookSubscriptionEdge, len(p.Data)) for i := range edges { - edges[i] = NewWebhookConfigurationEdge(p.Data[i], p.Cursor.OrderBy.Field) + edges[i] = NewWebhookSubscriptionEdge(p.Data[i], p.Cursor.OrderBy.Field) } - return &WebhookConfigurationConnection{ + return &WebhookSubscriptionConnection{ Edges: edges, PageInfo: *NewPageInfo(p), @@ -53,15 +53,15 @@ func NewWebhookConfigurationConnection( } } -func NewWebhookConfigurationEdge(wc *coredata.WebhookConfiguration, orderBy coredata.WebhookConfigurationOrderField) *WebhookConfigurationEdge { - return &WebhookConfigurationEdge{ +func NewWebhookSubscriptionEdge(wc *coredata.WebhookSubscription, orderBy coredata.WebhookSubscriptionOrderField) *WebhookSubscriptionEdge { + return &WebhookSubscriptionEdge{ Cursor: wc.CursorKey(orderBy), - Node: NewWebhookConfiguration(wc), + Node: NewWebhookSubscription(wc), } } -func NewWebhookConfiguration(wc *coredata.WebhookConfiguration) *WebhookConfiguration { - return &WebhookConfiguration{ +func NewWebhookSubscription(wc *coredata.WebhookSubscription) *WebhookSubscription { + return &WebhookSubscription{ ID: wc.ID, Organization: &Organization{ ID: wc.OrganizationID, diff --git a/pkg/server/api/console/v1/v1_resolver.go b/pkg/server/api/console/v1/v1_resolver.go index 86dff4d2d..29428d31d 100644 --- a/pkg/server/api/console/v1/v1_resolver.go +++ b/pkg/server/api/console/v1/v1_resolver.go @@ -3678,74 +3678,74 @@ func (r *mutationResolver) DeleteMeeting(ctx context.Context, input types.Delete }, nil } -// CreateWebhookConfiguration is the resolver for the createWebhookConfiguration field. -func (r *mutationResolver) CreateWebhookConfiguration(ctx context.Context, input types.CreateWebhookConfigurationInput) (*types.CreateWebhookConfigurationPayload, error) { - if err := r.authorize(ctx, input.OrganizationID, probo.ActionWebhookConfigurationCreate); err != nil { +// CreateWebhookSubscription is the resolver for the createWebhookSubscription field. +func (r *mutationResolver) CreateWebhookSubscription(ctx context.Context, input types.CreateWebhookSubscriptionInput) (*types.CreateWebhookSubscriptionPayload, error) { + if err := r.authorize(ctx, input.OrganizationID, probo.ActionWebhookSubscriptionCreate); err != nil { return nil, err } prb := r.ProboService(ctx, input.OrganizationID.TenantID()) - wc, err := prb.WebhookConfigurations.Create( + wc, err := prb.WebhookSubscriptions.Create( ctx, - probo.CreateWebhookConfigurationRequest{ + probo.CreateWebhookSubscriptionRequest{ OrganizationID: input.OrganizationID, EndpointURL: input.EndpointURL, SelectedEvents: input.SelectedEvents, }, ) if err != nil { - r.logger.ErrorCtx(ctx, "cannot create webhook configuration", log.Error(err)) + r.logger.ErrorCtx(ctx, "cannot create webhook subscription", log.Error(err)) return nil, gqlutils.Internal(ctx) } - return &types.CreateWebhookConfigurationPayload{ - WebhookConfigurationEdge: types.NewWebhookConfigurationEdge(wc, coredata.WebhookConfigurationOrderFieldCreatedAt), + return &types.CreateWebhookSubscriptionPayload{ + WebhookSubscriptionEdge: types.NewWebhookSubscriptionEdge(wc, coredata.WebhookSubscriptionOrderFieldCreatedAt), }, nil } -// UpdateWebhookConfiguration is the resolver for the updateWebhookConfiguration field. -func (r *mutationResolver) UpdateWebhookConfiguration(ctx context.Context, input types.UpdateWebhookConfigurationInput) (*types.UpdateWebhookConfigurationPayload, error) { - if err := r.authorize(ctx, input.ID, probo.ActionWebhookConfigurationUpdate); err != nil { +// UpdateWebhookSubscription is the resolver for the updateWebhookSubscription field. +func (r *mutationResolver) UpdateWebhookSubscription(ctx context.Context, input types.UpdateWebhookSubscriptionInput) (*types.UpdateWebhookSubscriptionPayload, error) { + if err := r.authorize(ctx, input.ID, probo.ActionWebhookSubscriptionUpdate); err != nil { return nil, err } prb := r.ProboService(ctx, input.ID.TenantID()) - wc, err := prb.WebhookConfigurations.Update( + wc, err := prb.WebhookSubscriptions.Update( ctx, - probo.UpdateWebhookConfigurationRequest{ - WebhookConfigurationID: input.ID, + probo.UpdateWebhookSubscriptionRequest{ + WebhookSubscriptionID: input.ID, EndpointURL: input.EndpointURL, SelectedEvents: input.SelectedEvents, }, ) if err != nil { - r.logger.ErrorCtx(ctx, "cannot update webhook configuration", log.Error(err)) + r.logger.ErrorCtx(ctx, "cannot update webhook subscription", log.Error(err)) return nil, gqlutils.Internal(ctx) } - return &types.UpdateWebhookConfigurationPayload{ - WebhookConfiguration: types.NewWebhookConfiguration(wc), + return &types.UpdateWebhookSubscriptionPayload{ + WebhookSubscription: types.NewWebhookSubscription(wc), }, nil } -// DeleteWebhookConfiguration is the resolver for the deleteWebhookConfiguration field. -func (r *mutationResolver) DeleteWebhookConfiguration(ctx context.Context, input types.DeleteWebhookConfigurationInput) (*types.DeleteWebhookConfigurationPayload, error) { - if err := r.authorize(ctx, input.WebhookConfigurationID, probo.ActionWebhookConfigurationDelete); err != nil { +// DeleteWebhookSubscription is the resolver for the deleteWebhookSubscription field. +func (r *mutationResolver) DeleteWebhookSubscription(ctx context.Context, input types.DeleteWebhookSubscriptionInput) (*types.DeleteWebhookSubscriptionPayload, error) { + if err := r.authorize(ctx, input.WebhookSubscriptionID, probo.ActionWebhookSubscriptionDelete); err != nil { return nil, err } - prb := r.ProboService(ctx, input.WebhookConfigurationID.TenantID()) + prb := r.ProboService(ctx, input.WebhookSubscriptionID.TenantID()) - err := prb.WebhookConfigurations.Delete(ctx, input.WebhookConfigurationID) + err := prb.WebhookSubscriptions.Delete(ctx, input.WebhookSubscriptionID) if err != nil { - r.logger.ErrorCtx(ctx, "cannot delete webhook configuration", log.Error(err)) + r.logger.ErrorCtx(ctx, "cannot delete webhook subscription", log.Error(err)) return nil, gqlutils.Internal(ctx) } - return &types.DeleteWebhookConfigurationPayload{ - DeletedWebhookConfigurationID: input.WebhookConfigurationID, + return &types.DeleteWebhookSubscriptionPayload{ + DeletedWebhookSubscriptionID: input.WebhookSubscriptionID, }, nil } @@ -6384,20 +6384,20 @@ func (r *organizationResolver) CustomDomain(ctx context.Context, obj *types.Orga return types.NewCustomDomain(domain, r.customDomainCname), nil } -// WebhookConfigurations is the resolver for the webhookConfigurations field. -func (r *organizationResolver) WebhookConfigurations(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookConfigurationOrderBy) (*types.WebhookConfigurationConnection, error) { - if err := r.authorize(ctx, obj.ID, probo.ActionWebhookConfigurationList); err != nil { +// WebhookSubscriptions is the resolver for the webhookSubscriptions field. +func (r *organizationResolver) WebhookSubscriptions(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookSubscriptionOrderBy) (*types.WebhookSubscriptionConnection, error) { + if err := r.authorize(ctx, obj.ID, probo.ActionWebhookSubscriptionList); err != nil { return nil, err } prb := r.ProboService(ctx, obj.ID.TenantID()) - pageOrderBy := page.OrderBy[coredata.WebhookConfigurationOrderField]{ - Field: coredata.WebhookConfigurationOrderFieldCreatedAt, + pageOrderBy := page.OrderBy[coredata.WebhookSubscriptionOrderField]{ + Field: coredata.WebhookSubscriptionOrderFieldCreatedAt, Direction: page.OrderDirectionDesc, } if orderBy != nil { - pageOrderBy = page.OrderBy[coredata.WebhookConfigurationOrderField]{ + pageOrderBy = page.OrderBy[coredata.WebhookSubscriptionOrderField]{ Field: orderBy.Field, Direction: orderBy.Direction, } @@ -6405,13 +6405,13 @@ func (r *organizationResolver) WebhookConfigurations(ctx context.Context, obj *t cursor := types.NewCursor(first, after, last, before, pageOrderBy) - page, err := prb.WebhookConfigurations.ListForOrganizationID(ctx, obj.ID, cursor) + page, err := prb.WebhookSubscriptions.ListForOrganizationID(ctx, obj.ID, cursor) if err != nil { - r.logger.ErrorCtx(ctx, "cannot list organization webhook configurations", log.Error(err)) + r.logger.ErrorCtx(ctx, "cannot list organization webhook subscriptions", log.Error(err)) return nil, gqlutils.Internal(ctx) } - return types.NewWebhookConfigurationConnection(page, r, obj.ID), nil + return types.NewWebhookSubscriptionConnection(page, r, obj.ID), nil } // Permission is the resolver for the permission field. @@ -6862,14 +6862,14 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error } return types.NewStateOfApplicability(stateOfApplicability), nil } - case coredata.WebhookConfigurationEntityType: - action = probo.ActionWebhookConfigurationGet + case coredata.WebhookSubscriptionEntityType: + action = probo.ActionWebhookSubscriptionGet loadNode = func(ctx context.Context, id gid.GID) (types.Node, error) { - wc, err := prb.WebhookConfigurations.Get(ctx, id) + wc, err := prb.WebhookSubscriptions.Get(ctx, id) if err != nil { return nil, err } - return types.NewWebhookConfiguration(wc), nil + return types.NewWebhookSubscription(wc), nil } default: } @@ -8560,7 +8560,7 @@ func (r *viewerResolver) SignableDocument(ctx context.Context, obj *types.Viewer } // Organization is the resolver for the organization field. -func (r *webhookConfigurationResolver) Organization(ctx context.Context, obj *types.WebhookConfiguration) (*types.Organization, error) { +func (r *webhookSubscriptionResolver) Organization(ctx context.Context, obj *types.WebhookSubscription) (*types.Organization, error) { if err := r.authorize(ctx, obj.ID, probo.ActionOrganizationGet); err != nil { return nil, err } @@ -8581,14 +8581,14 @@ func (r *webhookConfigurationResolver) Organization(ctx context.Context, obj *ty } // SigningSecret is the resolver for the signingSecret field. -func (r *webhookConfigurationResolver) SigningSecret(ctx context.Context, obj *types.WebhookConfiguration) (string, error) { - if err := r.authorize(ctx, obj.ID, probo.ActionWebhookConfigurationUpdate); err != nil { +func (r *webhookSubscriptionResolver) SigningSecret(ctx context.Context, obj *types.WebhookSubscription) (string, error) { + if err := r.authorize(ctx, obj.ID, probo.ActionWebhookSubscriptionUpdate); err != nil { return "", err } prb := r.ProboService(ctx, obj.ID.TenantID()) - signingSecret, err := prb.WebhookConfigurations.GetSigningSecret(ctx, obj.ID) + signingSecret, err := prb.WebhookSubscriptions.GetSigningSecret(ctx, obj.ID) if err != nil { r.logger.ErrorCtx(ctx, "cannot get signing secret", log.Error(err)) return "", gqlutils.Internal(ctx) @@ -8598,8 +8598,8 @@ func (r *webhookConfigurationResolver) SigningSecret(ctx context.Context, obj *t } // Events is the resolver for the events field. -func (r *webhookConfigurationResolver) Events(ctx context.Context, obj *types.WebhookConfiguration, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookEventOrderBy) (*types.WebhookEventConnection, error) { - if err := r.authorize(ctx, obj.ID, probo.ActionWebhookConfigurationGet); err != nil { +func (r *webhookSubscriptionResolver) Events(ctx context.Context, obj *types.WebhookSubscription, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.WebhookEventOrderBy) (*types.WebhookEventConnection, error) { + if err := r.authorize(ctx, obj.ID, probo.ActionWebhookSubscriptionGet); err != nil { return nil, err } @@ -8618,7 +8618,7 @@ func (r *webhookConfigurationResolver) Events(ctx context.Context, obj *types.We cursor := types.NewCursor(first, after, last, before, pageOrderBy) - page, err := prb.WebhookConfigurations.ListEventsForConfigurationID(ctx, obj.ID, cursor) + page, err := prb.WebhookSubscriptions.ListEventsForSubscriptionID(ctx, obj.ID, cursor) if err != nil { r.logger.ErrorCtx(ctx, "cannot list webhook events", log.Error(err)) return nil, gqlutils.Internal(ctx) @@ -8628,13 +8628,13 @@ func (r *webhookConfigurationResolver) Events(ctx context.Context, obj *types.We } // Permission is the resolver for the permission field. -func (r *webhookConfigurationResolver) Permission(ctx context.Context, obj *types.WebhookConfiguration, action string) (bool, error) { +func (r *webhookSubscriptionResolver) Permission(ctx context.Context, obj *types.WebhookSubscription, action string) (bool, error) { return r.Resolver.Permission(ctx, obj, action) } // TotalCount is the resolver for the totalCount field. -func (r *webhookConfigurationConnectionResolver) TotalCount(ctx context.Context, obj *types.WebhookConfigurationConnection) (int, error) { - if err := r.authorize(ctx, obj.ParentID, probo.ActionWebhookConfigurationList); err != nil { +func (r *webhookSubscriptionConnectionResolver) TotalCount(ctx context.Context, obj *types.WebhookSubscriptionConnection) (int, error) { + if err := r.authorize(ctx, obj.ParentID, probo.ActionWebhookSubscriptionList); err != nil { return 0, err } @@ -8642,27 +8642,27 @@ func (r *webhookConfigurationConnectionResolver) TotalCount(ctx context.Context, switch obj.Resolver.(type) { case *organizationResolver: - count, err := prb.WebhookConfigurations.CountForOrganizationID(ctx, obj.ParentID) + count, err := prb.WebhookSubscriptions.CountForOrganizationID(ctx, obj.ParentID) if err != nil { - r.logger.ErrorCtx(ctx, "cannot count webhook configurations", log.Error(err)) + r.logger.ErrorCtx(ctx, "cannot count webhook subscriptions", log.Error(err)) return 0, gqlutils.Internal(ctx) } return count, nil } - r.logger.ErrorCtx(ctx, "unsupported resolver for webhook configuration connection", log.String("resolver", fmt.Sprintf("%T", obj.Resolver))) + r.logger.ErrorCtx(ctx, "unsupported resolver for webhook subscription connection", log.String("resolver", fmt.Sprintf("%T", obj.Resolver))) return 0, gqlutils.Internal(ctx) } // TotalCount is the resolver for the totalCount field. func (r *webhookEventConnectionResolver) TotalCount(ctx context.Context, obj *types.WebhookEventConnection) (int, error) { - if err := r.authorize(ctx, obj.ParentID, probo.ActionWebhookConfigurationGet); err != nil { + if err := r.authorize(ctx, obj.ParentID, probo.ActionWebhookSubscriptionGet); err != nil { return 0, err } prb := r.ProboService(ctx, obj.ParentID.TenantID()) - count, err := prb.WebhookConfigurations.CountEventsForConfigurationID(ctx, obj.ParentID) + count, err := prb.WebhookSubscriptions.CountEventsForSubscriptionID(ctx, obj.ParentID) if err != nil { r.logger.ErrorCtx(ctx, "cannot count webhook events", log.Error(err)) return 0, gqlutils.Internal(ctx) @@ -8973,14 +8973,14 @@ func (r *Resolver) VendorService() schema.VendorServiceResolver { return &vendor // Viewer returns schema.ViewerResolver implementation. func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} } -// WebhookConfiguration returns schema.WebhookConfigurationResolver implementation. -func (r *Resolver) WebhookConfiguration() schema.WebhookConfigurationResolver { - return &webhookConfigurationResolver{r} +// WebhookSubscription returns schema.WebhookSubscriptionResolver implementation. +func (r *Resolver) WebhookSubscription() schema.WebhookSubscriptionResolver { + return &webhookSubscriptionResolver{r} } -// WebhookConfigurationConnection returns schema.WebhookConfigurationConnectionResolver implementation. -func (r *Resolver) WebhookConfigurationConnection() schema.WebhookConfigurationConnectionResolver { - return &webhookConfigurationConnectionResolver{r} +// WebhookSubscriptionConnection returns schema.WebhookSubscriptionConnectionResolver implementation. +func (r *Resolver) WebhookSubscriptionConnection() schema.WebhookSubscriptionConnectionResolver { + return &webhookSubscriptionConnectionResolver{r} } // WebhookEventConnection returns schema.WebhookEventConnectionResolver implementation. @@ -9060,6 +9060,6 @@ type vendorDataPrivacyAgreementResolver struct{ *Resolver } type vendorRiskAssessmentResolver struct{ *Resolver } type vendorServiceResolver struct{ *Resolver } type viewerResolver struct{ *Resolver } -type webhookConfigurationResolver struct{ *Resolver } -type webhookConfigurationConnectionResolver struct{ *Resolver } +type webhookSubscriptionResolver struct{ *Resolver } +type webhookSubscriptionConnectionResolver struct{ *Resolver } type webhookEventConnectionResolver struct{ *Resolver } diff --git a/pkg/webhook/data.go b/pkg/webhook/data.go index 649914178..564771c24 100644 --- a/pkg/webhook/data.go +++ b/pkg/webhook/data.go @@ -33,10 +33,10 @@ func InsertEvent( eventType coredata.WebhookEventType, data any, ) error { - var configs coredata.WebhookConfigurations + var configs coredata.WebhookSubscriptions exists, err := configs.ExistsByOrganizationIDAndEventType(ctx, conn, scope, organizationID, eventType) if err != nil { - return fmt.Errorf("cannot check webhook configurations: %w", err) + return fmt.Errorf("cannot check webhook subscriptions: %w", err) } if !exists { diff --git a/pkg/webhook/sender.go b/pkg/webhook/sender.go index 4a28f61ca..952487540 100644 --- a/pkg/webhook/sender.go +++ b/pkg/webhook/sender.go @@ -64,7 +64,7 @@ type ( pendingDelivery struct { Event *coredata.WebhookEvent - Config *coredata.WebhookConfiguration + Config *coredata.WebhookSubscription } ) @@ -138,22 +138,22 @@ func (s *Sender) claimNextWebhookData(ctx context.Context) (*coredata.WebhookDat scope := coredata.NewScopeFromObjectID(webhookData.ID) - var configs coredata.WebhookConfigurations + var configs coredata.WebhookSubscriptions if err := configs.LoadMatchingByOrganizationIDAndEventType( ctx, tx, scope, webhookData.OrganizationID, webhookData.EventType, ); err != nil { - return fmt.Errorf("cannot load matching webhook configurations: %w", err) + return fmt.Errorf("cannot load matching webhook subscriptions: %w", err) } now := time.Now() for _, config := range configs { event := &coredata.WebhookEvent{ - ID: gid.New(webhookData.ID.TenantID(), coredata.WebhookEventEntityType), - WebhookDataID: webhookData.ID, - WebhookConfigurationID: config.ID, - Status: coredata.WebhookEventStatusPending, - CreatedAt: now, + ID: gid.New(webhookData.ID.TenantID(), coredata.WebhookEventEntityType), + WebhookDataID: webhookData.ID, + WebhookSubscriptionID: config.ID, + Status: coredata.WebhookEventStatusPending, + CreatedAt: now, } if err := event.Insert(ctx, tx, scope); err != nil { @@ -195,7 +195,7 @@ func (s *Sender) deliver(ctx context.Context, webhookData *coredata.WebhookData, s.logger.ErrorCtx(ctx, "cannot get signing secret", log.Error(err), log.String("webhook_data_id", webhookData.ID.String()), - log.String("configuration_id", d.Config.ID.String()), + log.String("subscription_id", d.Config.ID.String()), ) s.updateEventStatus(ctx, d.Event, scope, coredata.WebhookEventStatusFailed, nil) return @@ -238,8 +238,8 @@ func (s *Sender) updateEventStatus( } } -func (s *Sender) getSigningSecret(webhookConfigurationID string, encryptedSigningSecret []byte) (string, error) { - if cached, ok := s.cache.Load(webhookConfigurationID); ok { +func (s *Sender) getSigningSecret(webhookSubscriptionID string, encryptedSigningSecret []byte) (string, error) { + if cached, ok := s.cache.Load(webhookSubscriptionID); ok { entry := cached.(*cachedSecret) if bytes.Equal(entry.encryptedSecret, encryptedSigningSecret) { return entry.plaintext, nil @@ -252,7 +252,7 @@ func (s *Sender) getSigningSecret(webhookConfigurationID string, encryptedSignin } signingSecret := string(plaintext) - s.cache.Store(webhookConfigurationID, &cachedSecret{ + s.cache.Store(webhookSubscriptionID, &cachedSecret{ encryptedSecret: encryptedSigningSecret, plaintext: signingSecret, }) @@ -265,16 +265,16 @@ func (s *Sender) doHTTPCall( eventID gid.GID, endpointURL string, webhookData *coredata.WebhookData, - configurationID gid.GID, + subscriptionID gid.GID, signingSecret string, ) (json.RawMessage, error) { payload := map[string]any{ - "eventId": eventID.String(), - "configurationId": configurationID.String(), - "organizationId": webhookData.OrganizationID.String(), - "eventType": webhookData.EventType.String(), - "createdAt": webhookData.CreatedAt, - "data": webhookData.Data, + "eventId": eventID.String(), + "subscriptionId": subscriptionID.String(), + "organizationId": webhookData.OrganizationID.String(), + "eventType": webhookData.EventType.String(), + "createdAt": webhookData.CreatedAt, + "data": webhookData.Data, } body, err := json.Marshal(payload) if err != nil {