diff --git a/src/client/components/terminal/index.ts b/src/client/components/terminal/index.ts index db17c6a1b..ef94bed86 100644 --- a/src/client/components/terminal/index.ts +++ b/src/client/components/terminal/index.ts @@ -20,7 +20,7 @@ import './share' import './gistCell' import './open' import { - CreateCellOutputMutation, + CreateExtensionCellOutputMutation, UpdateCellOutputMutation, } from '../../../extension/__generated-platform__/graphql' @@ -483,12 +483,12 @@ export class TerminalView extends LitElement { return } - const data = (e.output.data?.data || {}) as CreateCellOutputMutation & + const data = (e.output.data?.data || {}) as CreateExtensionCellOutputMutation & UpdateCellOutputMutation const { escalationButton: escalationButtonEnabled } = e.output - if (data.createCellOutput) { + if (data.createExtensionCellOutput) { const { - createCellOutput: { id, exitCode, htmlUrl }, + createExtensionCellOutput: { id, exitCode, htmlUrl }, } = data this.cloudId = id this.shareUrl = htmlUrl || '' diff --git a/src/extension/__generated-platform__/gql.ts b/src/extension/__generated-platform__/gql.ts index dac6844a9..b9c7c5f7a 100644 --- a/src/extension/__generated-platform__/gql.ts +++ b/src/extension/__generated-platform__/gql.ts @@ -14,7 +14,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/ */ const documents = { "mutation ArchiveCellOutput($id: String!) {\n archiveCellOutput(id: $id) {\n id\n }\n}": types.ArchiveCellOutputDocument, - "mutation CreateCellOutput($input: ReporterInput!) {\n createCellOutput(input: $input) {\n id\n htmlUrl\n exitCode\n isSlackReady\n }\n}": types.CreateCellOutputDocument, + "mutation CreateExtensionCellOutput($input: ReporterInput!) {\n createExtensionCellOutput(input: $input) {\n id\n htmlUrl\n exitCode\n isSlackReady\n }\n}": types.CreateExtensionCellOutputDocument, "mutation UnArchiveCellOutput($id: String!) {\n unArchiveCellOutput(id: $id) {\n id\n }\n}": types.UnArchiveCellOutputDocument, "mutation UpdateCellOutput($id: String!, $input: UpdateCellOutputInput!) {\n updateCellOutput(id: $id, input: $input) {\n id\n htmlUrl\n exitCode\n isSlackReady\n }\n}": types.UpdateCellOutputDocument, }; @@ -40,7 +40,7 @@ export function graphql(source: "mutation ArchiveCellOutput($id: String!) {\n a /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ -export function graphql(source: "mutation CreateCellOutput($input: ReporterInput!) {\n createCellOutput(input: $input) {\n id\n htmlUrl\n exitCode\n isSlackReady\n }\n}"): (typeof documents)["mutation CreateCellOutput($input: ReporterInput!) {\n createCellOutput(input: $input) {\n id\n htmlUrl\n exitCode\n isSlackReady\n }\n}"]; +export function graphql(source: "mutation CreateExtensionCellOutput($input: ReporterInput!) {\n createExtensionCellOutput(input: $input) {\n id\n htmlUrl\n exitCode\n isSlackReady\n }\n}"): (typeof documents)["mutation CreateExtensionCellOutput($input: ReporterInput!) {\n createExtensionCellOutput(input: $input) {\n id\n htmlUrl\n exitCode\n isSlackReady\n }\n}"]; /** * The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients. */ diff --git a/src/extension/__generated-platform__/graphql.ts b/src/extension/__generated-platform__/graphql.ts index 170afe73a..9ac3ae75f 100644 --- a/src/extension/__generated-platform__/graphql.ts +++ b/src/extension/__generated-platform__/graphql.ts @@ -743,9 +743,9 @@ export type Mutation = { activeOrganization: Organization; archiveCellOutput: CellOutput; createAccessRequest: AccessRequest; - createCellOutput: CellOutput; createCellOutputBookmark: Bookmark; createConversationBookmark: Bookmark; + createExtensionCellOutput: CellOutput; createGroup: Group; createMarkdownBookmark: Bookmark; createMessage: Message; @@ -809,11 +809,6 @@ export type MutationCreateAccessRequestArgs = { }; -export type MutationCreateCellOutputArgs = { - input: ReporterInput; -}; - - export type MutationCreateCellOutputBookmarkArgs = { input: CreateBookmarkInput; }; @@ -824,6 +819,11 @@ export type MutationCreateConversationBookmarkArgs = { }; +export type MutationCreateExtensionCellOutputArgs = { + input: ReporterInput; +}; + + export type MutationCreateGroupArgs = { input: CreateGroupInput; }; @@ -1998,12 +1998,12 @@ export type ArchiveCellOutputMutationVariables = Exact<{ export type ArchiveCellOutputMutation = { __typename?: 'Mutation', archiveCellOutput: { __typename?: 'CellOutput', id: string } }; -export type CreateCellOutputMutationVariables = Exact<{ +export type CreateExtensionCellOutputMutationVariables = Exact<{ input: ReporterInput; }>; -export type CreateCellOutputMutation = { __typename?: 'Mutation', createCellOutput: { __typename?: 'CellOutput', id: string, htmlUrl?: string | null, exitCode: number, isSlackReady?: boolean | null } }; +export type CreateExtensionCellOutputMutation = { __typename?: 'Mutation', createExtensionCellOutput: { __typename?: 'CellOutput', id: string, htmlUrl?: string | null, exitCode: number, isSlackReady?: boolean | null } }; export type UnArchiveCellOutputMutationVariables = Exact<{ id: Scalars['String']['input']; @@ -2022,6 +2022,6 @@ export type UpdateCellOutputMutation = { __typename?: 'Mutation', updateCellOutp export const ArchiveCellOutputDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"ArchiveCellOutput"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"archiveCellOutput"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; -export const CreateCellOutputDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateCellOutput"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ReporterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createCellOutput"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"htmlUrl"}},{"kind":"Field","name":{"kind":"Name","value":"exitCode"}},{"kind":"Field","name":{"kind":"Name","value":"isSlackReady"}}]}}]}}]} as unknown as DocumentNode; +export const CreateExtensionCellOutputDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"CreateExtensionCellOutput"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ReporterInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"createExtensionCellOutput"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"htmlUrl"}},{"kind":"Field","name":{"kind":"Name","value":"exitCode"}},{"kind":"Field","name":{"kind":"Name","value":"isSlackReady"}}]}}]}}]} as unknown as DocumentNode; export const UnArchiveCellOutputDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UnArchiveCellOutput"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"unArchiveCellOutput"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}}]}}]}}]} as unknown as DocumentNode; export const UpdateCellOutputDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"UpdateCellOutput"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"id"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}}},{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"UpdateCellOutputInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"updateCellOutput"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"id"},"value":{"kind":"Variable","name":{"kind":"Name","value":"id"}}},{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"id"}},{"kind":"Field","name":{"kind":"Name","value":"htmlUrl"}},{"kind":"Field","name":{"kind":"Name","value":"exitCode"}},{"kind":"Field","name":{"kind":"Name","value":"isSlackReady"}}]}}]}}]} as unknown as DocumentNode; \ No newline at end of file diff --git a/src/extension/messages/platformRequest/saveCellExecution.ts b/src/extension/messages/platformRequest/saveCellExecution.ts index 0f1f2d861..f7ebe1ebc 100644 --- a/src/extension/messages/platformRequest/saveCellExecution.ts +++ b/src/extension/messages/platformRequest/saveCellExecution.ts @@ -14,7 +14,7 @@ import { getGitContext, getPlatformAuthSession } from '../../utils' import { GrpcSerializer } from '../../serializer' import { InitializeClient } from '../../api/client' import { - CreateCellOutputDocument, + CreateExtensionCellOutputDocument, ReporterFrontmatterInput, } from '../../__generated-platform__/graphql' import { Cell } from '../../grpc/serializerTypes' @@ -86,7 +86,7 @@ export default async function saveCellExecution( // TODO: Implement the reporter to normalize the data into a valid Platform api payload const result = await graphClient.mutate({ - mutation: CreateCellOutputDocument, + mutation: CreateExtensionCellOutputDocument, variables: { input: { extension: { @@ -142,7 +142,7 @@ export default async function saveCellExecution( log.info('Cell execution saved') - const showEscalationButton = !!result.data?.createCellOutput?.isSlackReady + const showEscalationButton = !!result.data?.createExtensionCellOutput?.isSlackReady log.info(`showEscalationButton: ${showEscalationButton ? 'enabled' : 'disabled'}`) TelemetryReporter.sendTelemetryEvent('app.save') diff --git a/src/gql-platform/createCellOutput.graphql b/src/gql-platform/createCellOutput.graphql index 7b00fd8ae..714cce17b 100644 --- a/src/gql-platform/createCellOutput.graphql +++ b/src/gql-platform/createCellOutput.graphql @@ -1,5 +1,5 @@ -mutation CreateCellOutput($input: ReporterInput!) { - createCellOutput(input: $input) { +mutation CreateExtensionCellOutput($input: ReporterInput!) { + createExtensionCellOutput(input: $input) { id htmlUrl exitCode diff --git a/tests/extension/messages/platformApiRequest/saveCellExecution.test.ts b/tests/extension/messages/platformApiRequest/saveCellExecution.test.ts index 260dd3a9a..d3ec663a9 100644 --- a/tests/extension/messages/platformApiRequest/saveCellExecution.test.ts +++ b/tests/extension/messages/platformApiRequest/saveCellExecution.test.ts @@ -40,7 +40,7 @@ vi.mock('../../../../src/extension/cell', async () => { }) const graphqlHandlers = [ - graphql.mutation('CreateCellOutput', () => { + graphql.mutation('CreateExtensionCellOutput', () => { return HttpResponse.json({ data: { id: 'cell-id',