Change webhook configuration to subscription
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<56bfc2d1746edae72b0da44526fab12f>>
|
||||
* @generated SignedSource<<d3e3309eefb502b19d48c61f9f162d18>>
|
||||
* @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<WebhookEventType>;
|
||||
};
|
||||
export type WebhooksSettingsPage_createMutation$variables = {
|
||||
connections: ReadonlyArray<string>;
|
||||
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<WebhookEventType>;
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<86d94ecf595a0048971276541e185905>>
|
||||
* @generated SignedSource<<bbbb8700958f1bee82226fdbf53189b3>>
|
||||
* @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<string>;
|
||||
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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @generated SignedSource<<af555c91779a2fbceaae3666d5bae667>>
|
||||
* @generated SignedSource<<d341340b571530212b3cdc8722d694f1>>
|
||||
* @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;
|
||||
|
||||
@@ -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<WebhookEventType> | 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<WebhookEventType>;
|
||||
@@ -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;
|
||||
|
||||
@@ -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<string | null>(null);
|
||||
|
||||
const fetchSigningSecret = useCallback(
|
||||
async (webhookConfigurationId: string): Promise<string | null> => {
|
||||
async (webhookSubscriptionId: string): Promise<string | null> => {
|
||||
// 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<WebhooksSettingsPage_signingSecretQuery>(
|
||||
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<WebhooksSettingsPage_createMutation>(
|
||||
createWebhookConfigurationMutation,
|
||||
createWebhookSubscriptionMutation,
|
||||
{
|
||||
successMessage: __("Webhook created successfully"),
|
||||
errorMessage: __("Failed to create webhook"),
|
||||
@@ -532,7 +535,7 @@ export function WebhooksSettingsPage(props: {
|
||||
|
||||
const [updateWebhook, isUpdating]
|
||||
= useMutationWithToasts<WebhooksSettingsPage_updateMutation>(
|
||||
updateWebhookConfigurationMutation,
|
||||
updateWebhookSubscriptionMutation,
|
||||
{
|
||||
successMessage: __("Webhook updated successfully"),
|
||||
errorMessage: __("Failed to update webhook"),
|
||||
@@ -541,21 +544,21 @@ export function WebhooksSettingsPage(props: {
|
||||
|
||||
const [deleteWebhook, isDeleting]
|
||||
= useMutationWithToasts<WebhooksSettingsPage_deleteMutation>(
|
||||
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: {
|
||||
<div className="space-y-4">
|
||||
<div className="flex items-center justify-between">
|
||||
<div>
|
||||
<h2 className="text-base font-medium">{__("Webhook Configurations")}</h2>
|
||||
<h2 className="text-base font-medium">{__("Webhook Subscriptions")}</h2>
|
||||
<p className="text-sm text-txt-tertiary">
|
||||
{__(
|
||||
"Configure webhooks to receive notifications when events occur in your organization.",
|
||||
@@ -615,7 +618,7 @@ export function WebhooksSettingsPage(props: {
|
||||
isSubmitting={isCreating}
|
||||
trigger={(
|
||||
<Button icon={IconPlusLarge}>
|
||||
{__("Add Webhook Configuration")}
|
||||
{__("Add Webhook Subscription")}
|
||||
</Button>
|
||||
)}
|
||||
/>
|
||||
@@ -626,7 +629,7 @@ export function WebhooksSettingsPage(props: {
|
||||
<Card padded>
|
||||
<div className="text-center py-8">
|
||||
<p className="text-sm text-txt-tertiary">
|
||||
{__("No webhook configurations yet. Add one to get started.")}
|
||||
{__("No webhook subscriptions yet. Add one to get started.")}
|
||||
</p>
|
||||
</div>
|
||||
</Card>
|
||||
@@ -737,7 +740,7 @@ export function WebhooksSettingsPage(props: {
|
||||
<DialogContent padded>
|
||||
<p className="text-txt-secondary">
|
||||
{__(
|
||||
"Are you sure you want to delete this webhook configuration?",
|
||||
"Are you sure you want to delete this webhook subscription?",
|
||||
)}
|
||||
</p>
|
||||
<p className="text-txt-secondary mt-2">
|
||||
@@ -766,7 +769,7 @@ export function WebhooksSettingsPage(props: {
|
||||
|
||||
{viewingEventsWebhook && viewingEventsId && (
|
||||
<WebhookEventsDialog
|
||||
webhookConfigurationId={viewingEventsId}
|
||||
webhookSubscriptionId={viewingEventsId}
|
||||
endpointUrl={viewingEventsWebhook.endpointUrl}
|
||||
onClose={() => setViewingEventsId(null)}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user