Skip to content
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

[VET-4697] remove unused fields #60

Merged
merged 4 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/__tests__/getCurrentConnectionFromPortal.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
});
Expand Down
8 changes: 0 additions & 8 deletions src/__tests__/getPortalSdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -27,22 +24,17 @@ 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 }));

describe('getPortalSdk', () => {
beforeEach(() => {
jest.spyOn(portalSdkImport, 'getSdk').mockReturnValue({
addShare,
editVoiceboxConversation,
getConnectionByIndex,
getVoiceboxConversation,
listConnections,
listVoiceboxConversations,
marketplaceSettings,
profile,
trackEvent,
});
Expand Down
10 changes: 0 additions & 10 deletions src/getPortalSdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 0 additions & 4 deletions src/sdk/documents/addShareMutation.graphql
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
mutation addShare($input: ShareInput!) {
addShare(input: $input) {
short_url
target_path
endpoint
service
expiration
}
}
30 changes: 17 additions & 13 deletions src/sdk/documents/getConnectionByIndexQuery.graphql
Original file line number Diff line number Diff line change
@@ -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
}
}
3 changes: 0 additions & 3 deletions src/sdk/documents/getVoiceboxConversation.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ query getVoiceboxConversation($conversation_id: String!) {
id
content
sender
created
score
user_message_context {
id
app
connection_id
database
Expand All @@ -17,7 +15,6 @@ query getVoiceboxConversation($conversation_id: String!) {
reasoning
}
system_message_context {
id
followup_examples
actions {
type
Expand Down
14 changes: 4 additions & 10 deletions src/sdk/documents/listConnectionsQuery.graphql
Original file line number Diff line number Diff line change
@@ -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
}
}
6 changes: 0 additions & 6 deletions src/sdk/documents/listVoiceboxConversations.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions src/sdk/documents/marketplaceSettingsQuery.graphql

This file was deleted.

23 changes: 16 additions & 7 deletions src/sdk/documents/profileQuery.graphql
Original file line number Diff line number Diff line change
@@ -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
}
}
6 changes: 0 additions & 6 deletions src/sdk/documents/renameVoiceboxConversation.graphql

This file was deleted.

Loading
Loading