Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 28 additions & 25 deletions packages/twenty-front/src/generated-metadata/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ export enum AllMetadataName {
viewField = 'viewField',
viewFilter = 'viewFilter',
viewFilterGroup = 'viewFilterGroup',
viewGroup = 'viewGroup'
viewGroup = 'viewGroup',
webhook = 'webhook'
}

export type Analytics = {
Expand Down Expand Up @@ -1148,6 +1149,7 @@ export type CreateViewSortInput = {

export type CreateWebhookInput = {
description?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['UUID']>;
operations: Array<Scalars['String']>;
secret?: InputMaybe<Scalars['String']>;
targetUrl: Scalars['String'];
Expand Down Expand Up @@ -1287,10 +1289,6 @@ export type DeleteViewGroupInput = {
id: Scalars['UUID'];
};

export type DeleteWebhookInput = {
id: Scalars['UUID'];
};

export type DeleteWorkflowVersionStepInput = {
/** Step to delete ID */
stepId: Scalars['String'];
Expand Down Expand Up @@ -1691,10 +1689,6 @@ export type GetServerlessFunctionSourceCodeInput = {
version?: Scalars['String'];
};

export type GetWebhookInput = {
id: Scalars['UUID'];
};

/** Order by options for graph widgets */
export enum GraphOrderBy {
FIELD_ASC = 'FIELD_ASC',
Expand Down Expand Up @@ -2075,7 +2069,7 @@ export type Mutation = {
deleteTwoFactorAuthenticationMethod: DeleteTwoFactorAuthenticationMethodOutput;
deleteUser: User;
deleteUserFromWorkspace: UserWorkspace;
deleteWebhook: Scalars['Boolean'];
deleteWebhook: Webhook;
deleteWorkflowVersionEdge: WorkflowVersionStepChanges;
deleteWorkflowVersionStep: WorkflowVersionStepChanges;
deleteWorkspaceInvitation: Scalars['String'];
Expand Down Expand Up @@ -2165,7 +2159,7 @@ export type Mutation = {
updatePasswordViaResetToken: InvalidatePasswordOutput;
updateSkill: Skill;
updateUserEmail: Scalars['Boolean'];
updateWebhook?: Maybe<Webhook>;
updateWebhook: Webhook;
updateWorkflowRunStep: WorkflowAction;
updateWorkflowVersionPositions: Scalars['Boolean'];
updateWorkflowVersionStep: WorkflowAction;
Expand Down Expand Up @@ -2592,7 +2586,7 @@ export type MutationDeleteUserFromWorkspaceArgs = {


export type MutationDeleteWebhookArgs = {
input: DeleteWebhookInput;
id: Scalars['UUID'];
};


Expand Down Expand Up @@ -4017,7 +4011,7 @@ export type QueryValidatePasswordResetTokenArgs = {


export type QueryWebhookArgs = {
input: GetWebhookInput;
id: Scalars['UUID'];
};

export type QueueJob = {
Expand Down Expand Up @@ -5001,8 +4995,14 @@ export type UpdateViewSortInput = {
};

export type UpdateWebhookInput = {
description?: InputMaybe<Scalars['String']>;
/** The id of the webhook to update */
id: Scalars['UUID'];
/** The webhook fields to update */
update: UpdateWebhookInputUpdates;
};

export type UpdateWebhookInputUpdates = {
description?: InputMaybe<Scalars['String']>;
operations?: InputMaybe<Array<Scalars['String']>>;
secret?: InputMaybe<Scalars['String']>;
targetUrl?: InputMaybe<Scalars['String']>;
Expand Down Expand Up @@ -5246,6 +5246,7 @@ export enum ViewVisibility {

export type Webhook = {
__typename?: 'Webhook';
applicationId: Scalars['UUID'];
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
description?: Maybe<Scalars['String']>;
Expand Down Expand Up @@ -6345,11 +6346,11 @@ export type CreateWebhookMutationVariables = Exact<{
export type CreateWebhookMutation = { __typename?: 'Mutation', createWebhook: { __typename?: 'Webhook', id: string, targetUrl: string, operations: Array<string>, description?: string | null, secret: string } };

export type DeleteWebhookMutationVariables = Exact<{
input: DeleteWebhookInput;
id: Scalars['UUID'];
}>;


export type DeleteWebhookMutation = { __typename?: 'Mutation', deleteWebhook: boolean };
export type DeleteWebhookMutation = { __typename?: 'Mutation', deleteWebhook: { __typename?: 'Webhook', id: string, targetUrl: string, operations: Array<string>, description?: string | null, secret: string } };

export type RevokeApiKeyMutationVariables = Exact<{
input: RevokeApiKeyInput;
Expand All @@ -6370,7 +6371,7 @@ export type UpdateWebhookMutationVariables = Exact<{
}>;


export type UpdateWebhookMutation = { __typename?: 'Mutation', updateWebhook?: { __typename?: 'Webhook', id: string, targetUrl: string, operations: Array<string>, description?: string | null, secret: string } | null };
export type UpdateWebhookMutation = { __typename?: 'Mutation', updateWebhook: { __typename?: 'Webhook', id: string, targetUrl: string, operations: Array<string>, description?: string | null, secret: string } };

export type GetApiKeyQueryVariables = Exact<{
input: GetApiKeyInput;
Expand All @@ -6385,7 +6386,7 @@ export type GetApiKeysQueryVariables = Exact<{ [key: string]: never; }>;
export type GetApiKeysQuery = { __typename?: 'Query', apiKeys: Array<{ __typename?: 'ApiKey', id: string, name: string, expiresAt: string, revokedAt?: string | null, role: { __typename?: 'Role', id: string, label: string, icon?: string | null } }> };

export type GetWebhookQueryVariables = Exact<{
input: GetWebhookInput;
id: Scalars['UUID'];
}>;


Expand Down Expand Up @@ -11989,10 +11990,12 @@ export type CreateWebhookMutationHookResult = ReturnType<typeof useCreateWebhook
export type CreateWebhookMutationResult = Apollo.MutationResult<CreateWebhookMutation>;
export type CreateWebhookMutationOptions = Apollo.BaseMutationOptions<CreateWebhookMutation, CreateWebhookMutationVariables>;
export const DeleteWebhookDocument = gql`
mutation DeleteWebhook($input: DeleteWebhookInput!) {
deleteWebhook(input: $input)
mutation DeleteWebhook($id: UUID!) {
deleteWebhook(id: $id) {
...WebhookFragment
}
}
`;
${WebhookFragmentFragmentDoc}`;
export type DeleteWebhookMutationFn = Apollo.MutationFunction<DeleteWebhookMutation, DeleteWebhookMutationVariables>;

/**
Expand All @@ -12008,7 +12011,7 @@ export type DeleteWebhookMutationFn = Apollo.MutationFunction<DeleteWebhookMutat
* @example
* const [deleteWebhookMutation, { data, loading, error }] = useDeleteWebhookMutation({
* variables: {
* input: // value for 'input'
* id: // value for 'id'
* },
* });
*/
Expand Down Expand Up @@ -12189,8 +12192,8 @@ export type GetApiKeysQueryHookResult = ReturnType<typeof useGetApiKeysQuery>;
export type GetApiKeysLazyQueryHookResult = ReturnType<typeof useGetApiKeysLazyQuery>;
export type GetApiKeysQueryResult = Apollo.QueryResult<GetApiKeysQuery, GetApiKeysQueryVariables>;
export const GetWebhookDocument = gql`
query GetWebhook($input: GetWebhookInput!) {
webhook(input: $input) {
query GetWebhook($id: UUID!) {
webhook(id: $id) {
...WebhookFragment
}
}
Expand All @@ -12208,7 +12211,7 @@ export const GetWebhookDocument = gql`
* @example
* const { data, loading, error } = useGetWebhookQuery({
* variables: {
* input: // value for 'input'
* id: // value for 'id'
* },
* });
*/
Expand Down
29 changes: 15 additions & 14 deletions packages/twenty-front/src/generated/graphql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ export enum AllMetadataName {
viewField = 'viewField',
viewFilter = 'viewFilter',
viewFilterGroup = 'viewFilterGroup',
viewGroup = 'viewGroup'
viewGroup = 'viewGroup',
webhook = 'webhook'
}

export type Analytics = {
Expand Down Expand Up @@ -1115,6 +1116,7 @@ export type CreateViewSortInput = {

export type CreateWebhookInput = {
description?: InputMaybe<Scalars['String']>;
id?: InputMaybe<Scalars['UUID']>;
operations: Array<Scalars['String']>;
secret?: InputMaybe<Scalars['String']>;
targetUrl: Scalars['String'];
Expand Down Expand Up @@ -1254,10 +1256,6 @@ export type DeleteViewGroupInput = {
id: Scalars['UUID'];
};

export type DeleteWebhookInput = {
id: Scalars['UUID'];
};

export type DeleteWorkflowVersionStepInput = {
/** Step to delete ID */
stepId: Scalars['String'];
Expand Down Expand Up @@ -1658,10 +1656,6 @@ export type GetServerlessFunctionSourceCodeInput = {
version?: Scalars['String'];
};

export type GetWebhookInput = {
id: Scalars['UUID'];
};

/** Order by options for graph widgets */
export enum GraphOrderBy {
FIELD_ASC = 'FIELD_ASC',
Expand Down Expand Up @@ -2033,7 +2027,7 @@ export type Mutation = {
deleteTwoFactorAuthenticationMethod: DeleteTwoFactorAuthenticationMethodOutput;
deleteUser: User;
deleteUserFromWorkspace: UserWorkspace;
deleteWebhook: Scalars['Boolean'];
deleteWebhook: Webhook;
deleteWorkflowVersionEdge: WorkflowVersionStepChanges;
deleteWorkflowVersionStep: WorkflowVersionStepChanges;
deleteWorkspaceInvitation: Scalars['String'];
Expand Down Expand Up @@ -2118,7 +2112,7 @@ export type Mutation = {
updatePageLayoutWithTabsAndWidgets: PageLayout;
updatePasswordViaResetToken: InvalidatePasswordOutput;
updateUserEmail: Scalars['Boolean'];
updateWebhook?: Maybe<Webhook>;
updateWebhook: Webhook;
updateWorkflowRunStep: WorkflowAction;
updateWorkflowVersionPositions: Scalars['Boolean'];
updateWorkflowVersionStep: WorkflowAction;
Expand Down Expand Up @@ -2500,7 +2494,7 @@ export type MutationDeleteUserFromWorkspaceArgs = {


export type MutationDeleteWebhookArgs = {
input: DeleteWebhookInput;
id: Scalars['UUID'];
};


Expand Down Expand Up @@ -3820,7 +3814,7 @@ export type QueryValidatePasswordResetTokenArgs = {


export type QueryWebhookArgs = {
input: GetWebhookInput;
id: Scalars['UUID'];
};

export type QueueJob = {
Expand Down Expand Up @@ -4770,8 +4764,14 @@ export type UpdateViewSortInput = {
};

export type UpdateWebhookInput = {
description?: InputMaybe<Scalars['String']>;
/** The id of the webhook to update */
id: Scalars['UUID'];
/** The webhook fields to update */
update: UpdateWebhookInputUpdates;
};

export type UpdateWebhookInputUpdates = {
description?: InputMaybe<Scalars['String']>;
operations?: InputMaybe<Array<Scalars['String']>>;
secret?: InputMaybe<Scalars['String']>;
targetUrl?: InputMaybe<Scalars['String']>;
Expand Down Expand Up @@ -5015,6 +5015,7 @@ export enum ViewVisibility {

export type Webhook = {
__typename?: 'Webhook';
applicationId: Scalars['UUID'];
createdAt: Scalars['DateTime'];
deletedAt?: Maybe<Scalars['DateTime']>;
description?: Maybe<Scalars['String']>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const useMetadataErrorHandler = () => {
commandMenuItem: t`command menu item`,
frontComponent: t`front component`,
navigationMenuItem: t`navigation menu item`,
webhook: t`webhook`,
} as const satisfies Record<AllMetadataName, string>;

const handleMetadataError = (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import gql from 'graphql-tag';
import { WEBHOOK_FRAGMENT } from '@/settings/developers/graphql/fragments/webhookFragment';

export const DELETE_WEBHOOK = gql`
mutation DeleteWebhook($input: DeleteWebhookInput!) {
deleteWebhook(input: $input)
mutation DeleteWebhook($id: UUID!) {
deleteWebhook(id: $id) {
...WebhookFragment
}
}
${WEBHOOK_FRAGMENT}
`;
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import gql from 'graphql-tag';
import { WEBHOOK_FRAGMENT } from '@/settings/developers/graphql/fragments/webhookFragment';

export const GET_WEBHOOK = gql`
query GetWebhook($input: GetWebhookInput!) {
webhook(input: $input) {
query GetWebhook($id: UUID!) {
webhook(id: $id) {
...WebhookFragment
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ const createSuccessfulUpdateMock = (webhookId: string, webhookData = {}) => ({
variables: {
input: {
id: webhookId,
targetUrl: 'https://updated.com/webhook',
operations: ['person.updated'],
description: 'Updated webhook',
secret: 'updated-secret',
...webhookData,
update: {
targetUrl: 'https://updated.com/webhook',
operations: ['person.updated'],
description: 'Updated webhook',
secret: 'updated-secret',
...webhookData,
},
},
},
},
Expand All @@ -87,16 +89,12 @@ const createSuccessfulDeleteMock = (webhookId: string) => ({
request: {
query: DELETE_WEBHOOK,
variables: {
input: {
id: webhookId,
},
id: webhookId,
},
},
result: {
data: {
deleteWebhook: {
id: webhookId,
},
deleteWebhook: createMockWebhookData({ id: webhookId }),
},
},
});
Expand All @@ -105,9 +103,7 @@ const createGetWebhookMock = (webhookId: string, webhookData = {}) => ({
request: {
query: GET_WEBHOOK,
variables: {
input: {
id: webhookId,
},
id: webhookId,
},
},
result: {
Expand Down Expand Up @@ -329,10 +325,12 @@ describe('useWebhookForm', () => {
variables: {
input: {
id: webhookId,
targetUrl: 'https://test.com/webhook',
operations: ['person.created'],
description: 'Test webhook',
secret: 'test-secret',
update: {
targetUrl: 'https://test.com/webhook',
operations: ['person.created'],
description: 'Test webhook',
secret: 'test-secret',
},
},
},
},
Expand Down Expand Up @@ -464,9 +462,7 @@ describe('useWebhookForm', () => {
request: {
query: DELETE_WEBHOOK,
variables: {
input: {
id: webhookId,
},
id: webhookId,
},
},
error: new Error('Deletion failed'),
Expand Down
Loading
Loading