-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce dev dash webhooks API #4884
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
d567c2f
Introduce dev dash webhooks API
cdarne c49eb8a
Simplify the PublicApiVersions query
cdarne ebca8ac
sendSampleWebhook better null field handling
cdarne fe1b92e
Add the OrgId to all webhooks API calls
cdarne 86c1afe
Update webhooks GQL schema branch
cdarne 62c69bb
Fix lint
cdarne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
packages/app/src/cli/api/graphql/webhooks/generated/available-topics.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
import * as Types from './types.js' | ||
|
||
import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/core' | ||
|
||
export type AvailableTopicsQueryVariables = Types.Exact<{ | ||
apiVersion: Types.Scalars['String']['input'] | ||
}> | ||
|
||
export type AvailableTopicsQuery = {availableTopics?: string[] | null} | ||
|
||
export const AvailableTopics = { | ||
kind: 'Document', | ||
definitions: [ | ||
{ | ||
kind: 'OperationDefinition', | ||
operation: 'query', | ||
name: {kind: 'Name', value: 'availableTopics'}, | ||
variableDefinitions: [ | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'apiVersion'}}, | ||
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'availableTopics'}, | ||
arguments: [ | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'apiVersion'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'apiVersion'}}, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} as unknown as DocumentNode<AvailableTopicsQuery, AvailableTopicsQueryVariables> |
111 changes: 111 additions & 0 deletions
111
packages/app/src/cli/api/graphql/webhooks/generated/cli-testing.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
import * as Types from './types.js' | ||
|
||
import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/core' | ||
|
||
export type CliTestingMutationVariables = Types.Exact<{ | ||
address: Types.Scalars['String']['input'] | ||
apiKey?: Types.InputMaybe<Types.Scalars['String']['input']> | ||
apiVersion: Types.Scalars['String']['input'] | ||
deliveryMethod: Types.Scalars['String']['input'] | ||
sharedSecret: Types.Scalars['String']['input'] | ||
topic: Types.Scalars['String']['input'] | ||
}> | ||
|
||
export type CliTestingMutation = { | ||
cliTesting?: {headers?: string | null; samplePayload?: string | null; success: boolean; errors: string[]} | null | ||
} | ||
|
||
export const CliTesting = { | ||
kind: 'Document', | ||
definitions: [ | ||
{ | ||
kind: 'OperationDefinition', | ||
operation: 'mutation', | ||
name: {kind: 'Name', value: 'CliTesting'}, | ||
variableDefinitions: [ | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'address'}}, | ||
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}}, | ||
}, | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'apiKey'}}, | ||
type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}, | ||
}, | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'apiVersion'}}, | ||
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}}, | ||
}, | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'deliveryMethod'}}, | ||
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}}, | ||
}, | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'sharedSecret'}}, | ||
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}}, | ||
}, | ||
{ | ||
kind: 'VariableDefinition', | ||
variable: {kind: 'Variable', name: {kind: 'Name', value: 'topic'}}, | ||
type: {kind: 'NonNullType', type: {kind: 'NamedType', name: {kind: 'Name', value: 'String'}}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'cliTesting'}, | ||
arguments: [ | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'address'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'address'}}, | ||
}, | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'apiKey'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'apiKey'}}, | ||
}, | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'apiVersion'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'apiVersion'}}, | ||
}, | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'deliveryMethod'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'deliveryMethod'}}, | ||
}, | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'sharedSecret'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'sharedSecret'}}, | ||
}, | ||
{ | ||
kind: 'Argument', | ||
name: {kind: 'Name', value: 'topic'}, | ||
value: {kind: 'Variable', name: {kind: 'Name', value: 'topic'}}, | ||
}, | ||
], | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{kind: 'Field', name: {kind: 'Name', value: 'headers'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'samplePayload'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'success'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: 'errors'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} as unknown as DocumentNode<CliTestingMutation, CliTestingMutationVariables> |
35 changes: 35 additions & 0 deletions
35
packages/app/src/cli/api/graphql/webhooks/generated/public-api-versions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions */ | ||
import * as Types from './types.js' | ||
|
||
import {TypedDocumentNode as DocumentNode} from '@graphql-typed-document-node/core' | ||
|
||
export type PublicApiVersionsQueryVariables = Types.Exact<{[key: string]: never}> | ||
|
||
export type PublicApiVersionsQuery = {publicApiVersions: {handle: string}[]} | ||
|
||
export const PublicApiVersions = { | ||
kind: 'Document', | ||
definitions: [ | ||
{ | ||
kind: 'OperationDefinition', | ||
operation: 'query', | ||
name: {kind: 'Name', value: 'publicApiVersions'}, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{ | ||
kind: 'Field', | ||
name: {kind: 'Name', value: 'publicApiVersions'}, | ||
selectionSet: { | ||
kind: 'SelectionSet', | ||
selections: [ | ||
{kind: 'Field', name: {kind: 'Name', value: 'handle'}}, | ||
{kind: 'Field', name: {kind: 'Name', value: '__typename'}}, | ||
], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
} as unknown as DocumentNode<PublicApiVersionsQuery, PublicApiVersionsQueryVariables> |
16 changes: 16 additions & 0 deletions
16
packages/app/src/cli/api/graphql/webhooks/generated/types.d.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* eslint-disable @typescript-eslint/consistent-type-definitions, @typescript-eslint/naming-convention */ | ||
export type Maybe<T> = T | null | ||
export type InputMaybe<T> = Maybe<T> | ||
export type Exact<T extends {[key: string]: unknown}> = {[K in keyof T]: T[K]} | ||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & {[SubKey in K]?: Maybe<T[SubKey]>} | ||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & {[SubKey in K]: Maybe<T[SubKey]>} | ||
export type MakeEmpty<T extends {[key: string]: unknown}, K extends keyof T> = {[_ in K]?: never} | ||
export type Incremental<T> = T | {[P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never} | ||
/** All built-in and custom scalars, mapped to their actual values */ | ||
export type Scalars = { | ||
ID: {input: string; output: string} | ||
String: {input: string; output: string} | ||
Boolean: {input: boolean; output: boolean} | ||
Int: {input: number; output: number} | ||
Float: {input: number; output: number} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/app/src/cli/api/graphql/webhooks/queries/available-topics.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query availableTopics($apiVersion: String!) { | ||
availableTopics(apiVersion: $apiVersion) | ||
} |
8 changes: 8 additions & 0 deletions
8
packages/app/src/cli/api/graphql/webhooks/queries/cli-testing.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
mutation CliTesting($address: String!, $apiKey: String, $apiVersion: String!, $deliveryMethod: String!, $sharedSecret: String!, $topic: String!) { | ||
cliTesting(address: $address, apiKey: $apiKey, apiVersion: $apiVersion, deliveryMethod: $deliveryMethod, sharedSecret: $sharedSecret, topic: $topic) { | ||
headers | ||
samplePayload | ||
success | ||
errors | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/app/src/cli/api/graphql/webhooks/queries/public-api-versions.graphql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
query publicApiVersions { | ||
publicApiVersions { | ||
handle | ||
cdarne marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wish we had a nicer way to do this but all the plumbing looks great 👌