From 2de07608b4df928b40f090536a1452df3fad62ab Mon Sep 17 00:00:00 2001 From: anneeb Date: Wed, 15 May 2024 15:29:20 -0400 Subject: [PATCH 1/4] remove unused fields --- .../getCurrentConnectionFromPortal.test.ts | 2 - src/__tests__/getPortalSdk.test.ts | 8 - src/getPortalSdk.ts | 10 - src/sdk/documents/addShareMutation.graphql | 4 - .../getConnectionByIndexQuery.graphql | 30 +-- .../documents/getVoiceboxConversation.graphql | 3 - .../documents/listConnectionsQuery.graphql | 14 +- .../listVoiceboxConversations.graphql | 8 - .../marketplaceSettingsQuery.graphql | 8 - src/sdk/documents/profileQuery.graphql | 23 +- .../renameVoiceboxConversation.graphql | 6 - src/sdk/index.ts | 205 ++++-------------- 12 files changed, 75 insertions(+), 246 deletions(-) delete mode 100644 src/sdk/documents/marketplaceSettingsQuery.graphql delete mode 100644 src/sdk/documents/renameVoiceboxConversation.graphql 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..9884c6c 100644 --- a/src/sdk/documents/listVoiceboxConversations.graphql +++ b/src/sdk/documents/listVoiceboxConversations.graphql @@ -1,15 +1,7 @@ query listVoiceboxConversations($paging: PagingInput) { listVoiceboxConversations(paging: $paging) { - 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..6cecf37 100644 --- a/src/sdk/documents/profileQuery.graphql +++ b/src/sdk/documents/profileQuery.graphql @@ -1,18 +1,25 @@ query profile { profile { - id - username - email + # display name first_name last_name + username + + # analytics setup (bones) + email company - use_case + date_joined + id + is_databricks_user is_authenticated - is_staff - is_superuser + is_ephemeral + title + use_case 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..f2fb5ce 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -868,14 +868,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 +879,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 +904,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 +916,6 @@ export type GetVoiceboxConversationQuery = { } | null; system_message_context?: { __typename?: 'SystemVoiceboxMessageContext'; - id: string; followup_examples?: Array | null; actions?: Array<{ __typename?: 'VoicboxSystemMessageAction'; @@ -949,19 +934,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; }; @@ -973,18 +953,10 @@ export type ListVoiceboxConversationsQuery = { __typename?: 'Query'; listVoiceboxConversations?: Array<{ __typename?: 'VoiceboxConversation'; - id: string; 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 +971,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; + email?: string | null; company?: string | null; - use_case?: string | null; + date_joined?: string | null; + id?: string | null; + is_databricks_user?: boolean | null; is_authenticated: boolean; - is_staff?: boolean | null; - is_superuser?: boolean | null; + is_ephemeral?: boolean | null; + title?: string | null; + use_case?: string | 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 +1013,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 +1038,8 @@ export const GetVoiceboxConversationDocument = ` id content sender - created score user_message_context { - id app connection_id database @@ -1113,7 +1048,6 @@ export const GetVoiceboxConversationDocument = ` reasoning } system_message_context { - id followup_examples actions { type @@ -1128,37 +1062,22 @@ 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 } } `; export const ListVoiceboxConversationsDocument = ` query listVoiceboxConversations($paging: PagingInput) { listVoiceboxConversations(paging: $paging) { - id last_user_message { - id - content - sender - created - score user_message_context { - id - app connection_id database named_graphs @@ -1172,41 +1091,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 + email company - use_case + date_joined + id + is_databricks_user is_authenticated - is_staff - is_superuser + is_ephemeral + title + use_case 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 +1213,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 +1227,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'] From 99a86993579f2000a3f28bfe6eaeb0604c278c8e Mon Sep 17 00:00:00 2001 From: anneeb Date: Wed, 15 May 2024 15:35:35 -0400 Subject: [PATCH 2/4] restore list ids --- src/sdk/documents/listVoiceboxConversations.graphql | 2 ++ src/sdk/index.ts | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/sdk/documents/listVoiceboxConversations.graphql b/src/sdk/documents/listVoiceboxConversations.graphql index 9884c6c..c6c85ec 100644 --- a/src/sdk/documents/listVoiceboxConversations.graphql +++ b/src/sdk/documents/listVoiceboxConversations.graphql @@ -1,6 +1,8 @@ query listVoiceboxConversations($paging: PagingInput) { listVoiceboxConversations(paging: $paging) { + id last_user_message { + id user_message_context { connection_id database diff --git a/src/sdk/index.ts b/src/sdk/index.ts index f2fb5ce..2136668 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -953,8 +953,10 @@ export type ListVoiceboxConversationsQuery = { __typename?: 'Query'; listVoiceboxConversations?: Array<{ __typename?: 'VoiceboxConversation'; + id: string; last_user_message?: { __typename?: 'VoiceboxMessage'; + id: string; user_message_context?: { __typename?: 'UserVoiceboxMessageContext'; connection_id?: string | null; @@ -1076,7 +1078,9 @@ export const ListConnectionsDocument = ` export const ListVoiceboxConversationsDocument = ` query listVoiceboxConversations($paging: PagingInput) { listVoiceboxConversations(paging: $paging) { + id last_user_message { + id user_message_context { connection_id database From ed72bb7cc043166d8de27e3149f2bf99b0acd552 Mon Sep 17 00:00:00 2001 From: anneeb Date: Wed, 15 May 2024 15:42:04 -0400 Subject: [PATCH 3/4] re-org profile --- src/sdk/documents/profileQuery.graphql | 10 ++++++---- src/sdk/index.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/sdk/documents/profileQuery.graphql b/src/sdk/documents/profileQuery.graphql index 6cecf37..eaea612 100644 --- a/src/sdk/documents/profileQuery.graphql +++ b/src/sdk/documents/profileQuery.graphql @@ -5,16 +5,18 @@ query profile { last_name username - # analytics setup (bones) - email + # analytics identity (bones) company date_joined + email id is_databricks_user - is_authenticated - is_ephemeral title use_case + + # analytics setup (bones) + is_authenticated + is_ephemeral userflow_signature # feature flags (bones) diff --git a/src/sdk/index.ts b/src/sdk/index.ts index 2136668..b4efa68 100644 --- a/src/sdk/index.ts +++ b/src/sdk/index.ts @@ -982,15 +982,15 @@ export type ProfileQuery = { first_name?: string | null; last_name?: string | null; username: string; - email?: string | null; company?: string | null; date_joined?: string | null; + email?: string | null; id?: string | null; is_databricks_user?: boolean | null; - is_authenticated: boolean; - is_ephemeral?: boolean | null; title?: string | null; use_case?: string | null; + is_authenticated: boolean; + is_ephemeral?: boolean | null; userflow_signature?: string | null; is_staff?: boolean | null; is_static_voicebox?: boolean | null; @@ -1101,15 +1101,15 @@ export const ProfileDocument = ` first_name last_name username - email company date_joined + email id is_databricks_user - is_authenticated - is_ephemeral title use_case + is_authenticated + is_ephemeral userflow_signature is_staff is_static_voicebox From 37dc4fca8ec0b108823df55b66ed6c2857239b59 Mon Sep 17 00:00:00 2001 From: anneeb Date: Thu, 29 Aug 2024 10:24:38 -0400 Subject: [PATCH 4/4] update sdk --- src/sdk/index.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/sdk/index.ts b/src/sdk/index.ts index b4efa68..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';