Api keys and webhook migration to core (#13011)
TODO: check Zapier trigger records work as expected --------- Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
+10
@@ -0,0 +1,10 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const API_KEY_FRAGMENT = gql`
|
||||
fragment ApiKeyFragment on ApiKey {
|
||||
id
|
||||
name
|
||||
expiresAt
|
||||
revokedAt
|
||||
}
|
||||
`;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const WEBHOOK_FRAGMENT = gql`
|
||||
fragment WebhookFragment on Webhook {
|
||||
id
|
||||
targetUrl
|
||||
operations
|
||||
description
|
||||
secret
|
||||
}
|
||||
`;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { API_KEY_FRAGMENT } from '../fragments/apiKeyFragment';
|
||||
|
||||
export const CREATE_API_KEY = gql`
|
||||
mutation CreateApiKey($input: CreateApiKeyDTO!) {
|
||||
createApiKey(input: $input) {
|
||||
...ApiKeyFragment
|
||||
}
|
||||
}
|
||||
${API_KEY_FRAGMENT}
|
||||
`;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { WEBHOOK_FRAGMENT } from '../fragments/webhookFragment';
|
||||
|
||||
export const CREATE_WEBHOOK = gql`
|
||||
mutation CreateWebhook($input: CreateWebhookDTO!) {
|
||||
createWebhook(input: $input) {
|
||||
...WebhookFragment
|
||||
}
|
||||
}
|
||||
${WEBHOOK_FRAGMENT}
|
||||
`;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const DELETE_WEBHOOK = gql`
|
||||
mutation DeleteWebhook($input: DeleteWebhookDTO!) {
|
||||
deleteWebhook(input: $input)
|
||||
}
|
||||
`;
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import gql from 'graphql-tag';
|
||||
|
||||
export const REVOKE_API_KEY = gql`
|
||||
mutation RevokeApiKey($input: RevokeApiKeyDTO!) {
|
||||
revokeApiKey(input: $input) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { API_KEY_FRAGMENT } from '../fragments/apiKeyFragment';
|
||||
|
||||
export const UPDATE_API_KEY = gql`
|
||||
mutation UpdateApiKey($input: UpdateApiKeyDTO!) {
|
||||
updateApiKey(input: $input) {
|
||||
...ApiKeyFragment
|
||||
}
|
||||
}
|
||||
${API_KEY_FRAGMENT}
|
||||
`;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { WEBHOOK_FRAGMENT } from '../fragments/webhookFragment';
|
||||
|
||||
export const UPDATE_WEBHOOK = gql`
|
||||
mutation UpdateWebhook($input: UpdateWebhookDTO!) {
|
||||
updateWebhook(input: $input) {
|
||||
...WebhookFragment
|
||||
}
|
||||
}
|
||||
${WEBHOOK_FRAGMENT}
|
||||
`;
|
||||
@@ -0,0 +1,12 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { API_KEY_FRAGMENT } from '../fragments/apiKeyFragment';
|
||||
|
||||
export const GET_API_KEY = gql`
|
||||
query GetApiKey($input: GetApiKeyDTO!) {
|
||||
apiKey(input: $input) {
|
||||
...ApiKeyFragment
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
${API_KEY_FRAGMENT}
|
||||
`;
|
||||
@@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { API_KEY_FRAGMENT } from '../fragments/apiKeyFragment';
|
||||
|
||||
export const GET_API_KEYS = gql`
|
||||
query GetApiKeys {
|
||||
apiKeys {
|
||||
...ApiKeyFragment
|
||||
}
|
||||
}
|
||||
${API_KEY_FRAGMENT}
|
||||
`;
|
||||
@@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { WEBHOOK_FRAGMENT } from '../fragments/webhookFragment';
|
||||
|
||||
export const GET_WEBHOOK = gql`
|
||||
query GetWebhook($input: GetWebhookDTO!) {
|
||||
webhook(input: $input) {
|
||||
...WebhookFragment
|
||||
}
|
||||
}
|
||||
${WEBHOOK_FRAGMENT}
|
||||
`;
|
||||
@@ -0,0 +1,11 @@
|
||||
import gql from 'graphql-tag';
|
||||
import { WEBHOOK_FRAGMENT } from '../fragments/webhookFragment';
|
||||
|
||||
export const GET_WEBHOOKS = gql`
|
||||
query GetWebhooks {
|
||||
webhooks {
|
||||
...WebhookFragment
|
||||
}
|
||||
}
|
||||
${WEBHOOK_FRAGMENT}
|
||||
`;
|
||||
Reference in New Issue
Block a user