diff --git a/src/__tests__/getCurrentConnectionFromPortal.test.ts b/src/__tests__/getCurrentConnectionFromPortal.test.ts index 4c22014..21318f8 100644 --- a/src/__tests__/getCurrentConnectionFromPortal.test.ts +++ b/src/__tests__/getCurrentConnectionFromPortal.test.ts @@ -10,12 +10,10 @@ describe('getCurrentConnectionFromPortal', () => { jest.spyOn(getPortalSdkModule, 'getPortalSdk').mockReturnValue({ addShare: jest.fn(), - editVoiceboxConversation: jest.fn(), getConnectionByIndex, getVoiceboxConversation: jest.fn(), listConnections: jest.fn(), listVoiceboxConversations: jest.fn(), - marketplaceSettings: jest.fn(), profile: jest.fn(), trackEvent: jest.fn(), }); diff --git a/src/__tests__/getPortalSdk.test.ts b/src/__tests__/getPortalSdk.test.ts index 50671d9..0f2d81c 100644 --- a/src/__tests__/getPortalSdk.test.ts +++ b/src/__tests__/getPortalSdk.test.ts @@ -15,9 +15,6 @@ jest.mock('../cookies', () => ({ })); const addShare = jest.fn(async () => ({ addShare: null })); -const editVoiceboxConversation = jest.fn(async () => ({ - editVoiceboxConversation: null, -})); const getConnectionByIndex = jest.fn(async () => ({ connection: null })); const getVoiceboxConversation = jest.fn(async () => ({ getVoiceboxConversation: null, @@ -27,9 +24,6 @@ const listVoiceboxConversations = jest.fn(async () => ({ listVoiceboxConversations: null, voiceboxConversationCount: null, })); -const marketplaceSettings = jest.fn(async () => ({ - marketplaceSettings: null, -})); const profile = jest.fn(async () => ({ profile: null })); const trackEvent = jest.fn(async () => ({ trackEvent: null })); @@ -37,12 +31,10 @@ describe('getPortalSdk', () => { beforeEach(() => { jest.spyOn(portalSdkImport, 'getSdk').mockReturnValue({ addShare, - editVoiceboxConversation, getConnectionByIndex, getVoiceboxConversation, listConnections, listVoiceboxConversations, - marketplaceSettings, profile, trackEvent, }); diff --git a/src/getPortalSdk.ts b/src/getPortalSdk.ts index 30f0838..1677d4f 100644 --- a/src/getPortalSdk.ts +++ b/src/getPortalSdk.ts @@ -58,12 +58,6 @@ export const getPortalSdk = () => { const result = await sdk.addShare({ input }); return result.addShare || null; }, - editVoiceboxConversation: async (input: { id: string; name: string }) => { - const result = await sdk.editVoiceboxConversation({ - input, - }); - return result.editVoiceboxConversation || null; - }, getConnectionByIndex: async (index: number) => { const result = await sdk.getConnectionByIndex({ index }); return result.connection || null; @@ -115,10 +109,6 @@ export const getPortalSdk = () => { count: result.voiceboxConversationCount?.count || 0, }; }, - marketplaceSettings: async () => { - const result = await sdk.marketplaceSettings(); - return result.marketplaceSettings || null; - }, profile: async () => { const result = await sdk.profile(); return result.profile || null; diff --git a/src/sdk/documents/addShareMutation.graphql b/src/sdk/documents/addShareMutation.graphql index 4f6a16f..95061b1 100644 --- a/src/sdk/documents/addShareMutation.graphql +++ b/src/sdk/documents/addShareMutation.graphql @@ -1,9 +1,5 @@ mutation addShare($input: ShareInput!) { addShare(input: $input) { short_url - target_path - endpoint - service - expiration } } diff --git a/src/sdk/documents/getConnectionByIndexQuery.graphql b/src/sdk/documents/getConnectionByIndexQuery.graphql index 0c40f97..fe8b626 100644 --- a/src/sdk/documents/getConnectionByIndexQuery.graphql +++ b/src/sdk/documents/getConnectionByIndexQuery.graphql @@ -1,19 +1,23 @@ query getConnectionByIndex($index: Int!) { connection: getConnectionByIndex(index: $index) { - id - index - cloud { - id - } - dashboard - name - username - endpoint + # getCurrentConnectionFromPortal token - isStardogCloud - isStardogFree - isAllocating useBrowserAuth - useSSO + username + + # useStardogConnectionFromPortalIndex (bones) + endpoint + + # usePortalDashboardUrl (bones) + dashboard + + # usePortalVoiceboxLastSettings (bones) + id + + # sign in form (VET apps) + name + + # refetch token (VET apps) + index } } diff --git a/src/sdk/documents/getVoiceboxConversation.graphql b/src/sdk/documents/getVoiceboxConversation.graphql index 84951a3..6893545 100644 --- a/src/sdk/documents/getVoiceboxConversation.graphql +++ b/src/sdk/documents/getVoiceboxConversation.graphql @@ -5,10 +5,8 @@ query getVoiceboxConversation($conversation_id: String!) { id content sender - created score user_message_context { - id app connection_id database @@ -17,7 +15,6 @@ query getVoiceboxConversation($conversation_id: String!) { reasoning } system_message_context { - id followup_examples actions { type diff --git a/src/sdk/documents/listConnectionsQuery.graphql b/src/sdk/documents/listConnectionsQuery.graphql index b6b1b9b..785f91a 100644 --- a/src/sdk/documents/listConnectionsQuery.graphql +++ b/src/sdk/documents/listConnectionsQuery.graphql @@ -1,19 +1,13 @@ query listConnections { listConnections { + # same fields as getConnectionByIndex + dashboard + endpoint id index - cloud { - id - } - dashboard name - username - endpoint token - isStardogCloud - isStardogFree - isAllocating useBrowserAuth - useSSO + username } } diff --git a/src/sdk/documents/listVoiceboxConversations.graphql b/src/sdk/documents/listVoiceboxConversations.graphql index 09180f1..c6c85ec 100644 --- a/src/sdk/documents/listVoiceboxConversations.graphql +++ b/src/sdk/documents/listVoiceboxConversations.graphql @@ -3,13 +3,7 @@ query listVoiceboxConversations($paging: PagingInput) { id last_user_message { id - content - sender - created - score user_message_context { - id - app connection_id database named_graphs diff --git a/src/sdk/documents/marketplaceSettingsQuery.graphql b/src/sdk/documents/marketplaceSettingsQuery.graphql deleted file mode 100644 index a6b2490..0000000 --- a/src/sdk/documents/marketplaceSettingsQuery.graphql +++ /dev/null @@ -1,8 +0,0 @@ -query marketplaceSettings { - marketplaceSettings { - marketplaceUsername - marketplacePassword - marketplaceEndpoint - marketplaceDatabase - } -} diff --git a/src/sdk/documents/profileQuery.graphql b/src/sdk/documents/profileQuery.graphql index 1753a4c..eaea612 100644 --- a/src/sdk/documents/profileQuery.graphql +++ b/src/sdk/documents/profileQuery.graphql @@ -1,18 +1,27 @@ query profile { profile { - id - username - email + # display name first_name last_name + username + + # analytics identity (bones) company + date_joined + email + id + is_databricks_user + title use_case + + # analytics setup (bones) is_authenticated - is_staff - is_superuser + is_ephemeral userflow_signature - date_joined - is_voicebox_enabled + + # feature flags (bones) + is_staff is_static_voicebox + is_voicebox_enabled } } diff --git a/src/sdk/documents/renameVoiceboxConversation.graphql b/src/sdk/documents/renameVoiceboxConversation.graphql deleted file mode 100644 index 93dad33..0000000 --- a/src/sdk/documents/renameVoiceboxConversation.graphql +++ /dev/null @@ -1,6 +0,0 @@ -mutation editVoiceboxConversation($input: EditVoiceboxConversationInput!) { - editVoiceboxConversation(input: $input) { - success - error - } -} diff --git a/src/sdk/index.ts b/src/sdk/index.ts index 3ec1daa..c0346de 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -149,6 +149,11 @@ export type CustomerSsoSettings = { azureProviders: Array>; }; +export type DeleteApiTokenInput = { + app_id?: InputMaybe; + id: Scalars['ID']; +}; + /** Generic deletion response type to handle reporting success. */ export type DeletionResponse = { __typename?: 'DeletionResponse'; @@ -311,7 +316,7 @@ export type MutationCreateVoiceboxAppArgs = { /** Root Mutation Type */ export type MutationDeleteApiTokenArgs = { - id: Scalars['ID']; + input: DeleteApiTokenInput; }; /** Root Mutation Type */ @@ -494,6 +499,8 @@ export type Query = { /** * Retrieve Voicebox conversations for the authenticated user, ordered by creation date, with the newest first. * Use PagingInput to paginate. If PagingInput is omitted, all conversations are returned. + * Designer conversations will only be returned if include_designer is set to true. + * Use connection_id to filter by connection_id, if no connection_id is provided, all conversations are returned. */ listVoiceboxConversations?: Maybe>>; marketplaceSettings?: Maybe; @@ -602,6 +609,7 @@ export type QueryListStardogCloudArgs = { /** Root Query Type */ export type QueryListVoiceboxConversationsArgs = { + filterInput?: InputMaybe; paging?: InputMaybe; }; @@ -613,6 +621,11 @@ export type QuerySearchUsersArgs = { token: Scalars['String']; }; +/** Root Query Type */ +export type QueryVoiceboxConversationCountArgs = { + filterInput?: InputMaybe; +}; + /** Contains the counts of available cloud resources to sell. */ export type QueueCounts = { __typename?: 'QueueCounts'; @@ -642,6 +655,7 @@ export type Settings = { designerVersion: Scalars['String']; explorerVersion: Scalars['String']; friendlyName: Scalars['String']; + geoaxisAuth: Scalars['Boolean']; googleAuth: Scalars['Boolean']; homeFooterLinks: Scalars['Boolean']; keycloakAuth: Scalars['Boolean']; @@ -849,6 +863,11 @@ export type VoiceboxConversation = { updated?: Maybe; }; +export type VoiceboxConversationsFilterInput = { + connection_id?: InputMaybe; + include_designer?: InputMaybe; +}; + /** A Message within a Voicebox conversation. */ export type VoiceboxMessage = { __typename?: 'VoiceboxMessage'; @@ -868,14 +887,7 @@ export type AddShareMutationVariables = Exact<{ export type AddShareMutation = { __typename?: 'Mutation'; - addShare?: { - __typename?: 'Share'; - short_url?: string | null; - target_path?: string | null; - endpoint?: string | null; - service?: string | null; - expiration?: string | null; - } | null; + addShare?: { __typename?: 'Share'; short_url?: string | null } | null; }; export type GetConnectionByIndexQueryVariables = Exact<{ @@ -886,19 +898,14 @@ export type GetConnectionByIndexQuery = { __typename?: 'Query'; connection?: { __typename?: 'Connection'; - id: string; - index: number; - dashboard?: string | null; - name: string; - username?: string | null; - endpoint: string; token?: string | null; - isStardogCloud?: boolean | null; - isStardogFree?: boolean | null; - isAllocating?: boolean | null; useBrowserAuth?: boolean | null; - useSSO?: boolean | null; - cloud?: { __typename?: 'StardogCloud'; id?: string | null } | null; + username?: string | null; + endpoint: string; + dashboard?: string | null; + id: string; + name: string; + index: number; } | null; }; @@ -916,11 +923,9 @@ export type GetVoiceboxConversationQuery = { id: string; content?: string | null; sender?: string | null; - created?: string | null; score?: number | null; user_message_context?: { __typename?: 'UserVoiceboxMessageContext'; - id: string; app?: string | null; connection_id?: string | null; database?: string | null; @@ -930,7 +935,6 @@ export type GetVoiceboxConversationQuery = { } | null; system_message_context?: { __typename?: 'SystemVoiceboxMessageContext'; - id: string; followup_examples?: Array | null; actions?: Array<{ __typename?: 'VoicboxSystemMessageAction'; @@ -949,19 +953,14 @@ export type ListConnectionsQuery = { __typename?: 'Query'; listConnections?: Array<{ __typename?: 'Connection'; + dashboard?: string | null; + endpoint: string; id: string; index: number; - dashboard?: string | null; name: string; - username?: string | null; - endpoint: string; token?: string | null; - isStardogCloud?: boolean | null; - isStardogFree?: boolean | null; - isAllocating?: boolean | null; useBrowserAuth?: boolean | null; - useSSO?: boolean | null; - cloud?: { __typename?: 'StardogCloud'; id?: string | null } | null; + username?: string | null; } | null> | null; }; @@ -977,14 +976,8 @@ export type ListVoiceboxConversationsQuery = { last_user_message?: { __typename?: 'VoiceboxMessage'; id: string; - content?: string | null; - sender?: string | null; - created?: string | null; - score?: number | null; user_message_context?: { __typename?: 'UserVoiceboxMessageContext'; - id: string; - app?: string | null; connection_id?: string | null; database?: string | null; named_graphs?: Array | null; @@ -999,52 +992,28 @@ export type ListVoiceboxConversationsQuery = { } | null; }; -export type MarketplaceSettingsQueryVariables = Exact<{ [key: string]: never }>; - -export type MarketplaceSettingsQuery = { - __typename?: 'Query'; - marketplaceSettings?: { - __typename?: 'MarketplaceSettings'; - marketplaceUsername: string; - marketplacePassword: string; - marketplaceEndpoint: string; - marketplaceDatabase: string; - } | null; -}; - export type ProfileQueryVariables = Exact<{ [key: string]: never }>; export type ProfileQuery = { __typename?: 'Query'; profile?: { __typename?: 'User'; - id?: string | null; - username: string; - email?: string | null; first_name?: string | null; last_name?: string | null; + username: string; company?: string | null; + date_joined?: string | null; + email?: string | null; + id?: string | null; + is_databricks_user?: boolean | null; + title?: string | null; use_case?: string | null; is_authenticated: boolean; - is_staff?: boolean | null; - is_superuser?: boolean | null; + is_ephemeral?: boolean | null; userflow_signature?: string | null; - date_joined?: string | null; - is_voicebox_enabled?: boolean | null; + is_staff?: boolean | null; is_static_voicebox?: boolean | null; - } | null; -}; - -export type EditVoiceboxConversationMutationVariables = Exact<{ - input: EditVoiceboxConversationInput; -}>; - -export type EditVoiceboxConversationMutation = { - __typename?: 'Mutation'; - editVoiceboxConversation?: { - __typename?: 'GenericResponse'; - success: boolean; - error?: string | null; + is_voicebox_enabled?: boolean | null; } | null; }; @@ -1065,31 +1034,20 @@ export const AddShareDocument = ` mutation addShare($input: ShareInput!) { addShare(input: $input) { short_url - target_path - endpoint - service - expiration } } `; export const GetConnectionByIndexDocument = ` query getConnectionByIndex($index: Int!) { connection: getConnectionByIndex(index: $index) { - id - index - cloud { - id - } - dashboard - name - username - endpoint token - isStardogCloud - isStardogFree - isAllocating useBrowserAuth - useSSO + username + endpoint + dashboard + id + name + index } } `; @@ -1101,10 +1059,8 @@ export const GetVoiceboxConversationDocument = ` id content sender - created score user_message_context { - id app connection_id database @@ -1113,7 +1069,6 @@ export const GetVoiceboxConversationDocument = ` reasoning } system_message_context { - id followup_examples actions { type @@ -1128,21 +1083,14 @@ export const GetVoiceboxConversationDocument = ` export const ListConnectionsDocument = ` query listConnections { listConnections { + dashboard + endpoint id index - cloud { - id - } - dashboard name - username - endpoint token - isStardogCloud - isStardogFree - isAllocating useBrowserAuth - useSSO + username } } `; @@ -1152,13 +1100,7 @@ export const ListVoiceboxConversationsDocument = ` id last_user_message { id - content - sender - created - score user_message_context { - id - app connection_id database named_graphs @@ -1172,41 +1114,25 @@ export const ListVoiceboxConversationsDocument = ` } } `; -export const MarketplaceSettingsDocument = ` - query marketplaceSettings { - marketplaceSettings { - marketplaceUsername - marketplacePassword - marketplaceEndpoint - marketplaceDatabase - } -} - `; export const ProfileDocument = ` query profile { profile { - id - username - email first_name last_name + username company + date_joined + email + id + is_databricks_user + title use_case is_authenticated - is_staff - is_superuser + is_ephemeral userflow_signature - date_joined - is_voicebox_enabled + is_staff is_static_voicebox - } -} - `; -export const EditVoiceboxConversationDocument = ` - mutation editVoiceboxConversation($input: EditVoiceboxConversationInput!) { - editVoiceboxConversation(input: $input) { - success - error + is_voicebox_enabled } } `; @@ -1310,21 +1236,6 @@ export function getSdk( 'query' ); }, - marketplaceSettings( - variables?: MarketplaceSettingsQueryVariables, - requestHeaders?: Dom.RequestInit['headers'] - ): Promise { - return withWrapper( - (wrappedRequestHeaders) => - client.request( - MarketplaceSettingsDocument, - variables, - { ...requestHeaders, ...wrappedRequestHeaders } - ), - 'marketplaceSettings', - 'query' - ); - }, profile( variables?: ProfileQueryVariables, requestHeaders?: Dom.RequestInit['headers'] @@ -1339,21 +1250,6 @@ export function getSdk( 'query' ); }, - editVoiceboxConversation( - variables: EditVoiceboxConversationMutationVariables, - requestHeaders?: Dom.RequestInit['headers'] - ): Promise { - return withWrapper( - (wrappedRequestHeaders) => - client.request( - EditVoiceboxConversationDocument, - variables, - { ...requestHeaders, ...wrappedRequestHeaders } - ), - 'editVoiceboxConversation', - 'mutation' - ); - }, trackEvent( variables: TrackEventMutationVariables, requestHeaders?: Dom.RequestInit['headers']