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

ML Hub - resolve base path implicitly #403

Merged
merged 3 commits into from
Jul 16, 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
3 changes: 0 additions & 3 deletions lib/tapisui-hooks/src/ml-hub/datasets/basePath.ts

This file was deleted.

4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/datasets/useCardDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useCardDetails = (
params: Datasets.GetDatasetCardRequest,
options: QueryObserverOptions<Datasets.RespDatasetCard, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDatasetCard, Error>(
[QueryKeys.details, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/datasets/useDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useDetails = (
params: Datasets.GetDatasetRequest,
options: QueryObserverOptions<Datasets.RespDataset, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDataset, Error>(
[QueryKeys.details, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/datasets/useList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useList = (
options: QueryObserverOptions<Datasets.RespDatasetsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDatasetsObject, Error>(
[QueryKeys.list, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/datasets/useListByAuthor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByAuthor = (
params: Datasets.ListDatasetsByAuthorRequest,
options: QueryObserverOptions<Datasets.RespDatasetsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDatasetsObject, Error>(
[QueryKeys.listByAuthor, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/datasets/useListByLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByLanguage = (
params: Datasets.ListDatasetsByLanguageRequest,
options: QueryObserverOptions<Datasets.RespDatasetsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDatasetsObject, Error>(
[QueryKeys.listByLanguage, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/datasets/useListByQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByQuery = (
params: Datasets.ListDatasetsByQueryRequest,
options: QueryObserverOptions<Datasets.RespDatasetsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDatasetsObject, Error>(
[QueryKeys.listByQuery, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListBySizeCategory = (
params: Datasets.ListDatasetsBySizeCategoryRequest,
options: QueryObserverOptions<Datasets.RespDatasetsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDatasetsObject, Error>(
[QueryKeys.listBySizeCategory, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/datasets/useListByTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByTask = (
params: Datasets.ListDatasetsByTaskRequest,
options: QueryObserverOptions<Datasets.RespDatasetsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDatasetsObject, Error>(
[QueryKeys.listByTask, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Datasets } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListDownloadLinks = (
params: Datasets.DownloadDatasetRequest,
options: QueryObserverOptions<Datasets.RespDatasetDownload, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Datasets.RespDatasetDownload, Error>(
[QueryKeys.listDownloadLinks, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
1 change: 1 addition & 0 deletions lib/tapisui-hooks/src/ml-hub/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * as Models from './models';
export * as Datasets from './datasets';
3 changes: 0 additions & 3 deletions lib/tapisui-hooks/src/ml-hub/models/basePath.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../../';
import QueryKeys from '../queryKeys';
import basePath from '../basePath'; // remove if ml-hub is listed in NGINX

const useInferenceServerDetails = (
params: Models.DownloadModelRequest,
Expand All @@ -12,8 +11,7 @@ const useInferenceServerDetails = (
Error
> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<
Models.RespModelServer & Models.RespModelServerError,
Error
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useDetails = (
params: Models.GetModelRequest,
options: QueryObserverOptions<Models.RespModel, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModel, Error>(
[QueryKeys.details, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useList = (
options: QueryObserverOptions<Models.RespModelsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModelsObject, Error>(
[QueryKeys.list, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useListByAuthor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByAuthor = (
params: Models.ListModelsByAuthorRequest,
options: QueryObserverOptions<Models.RespModelsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModelsObject, Error>(
[QueryKeys.listByAuthor, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useListByDataset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByDataset = (
params: Models.ListModelsByDatasetRequest,
options: QueryObserverOptions<Models.RespModelsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModelsObject, Error>(
[QueryKeys.listByDataset, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useListByLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByLanguage = (
params: Models.ListModelsByLanguageRequest,
options: QueryObserverOptions<Models.RespModelsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModelsObject, Error>(
[QueryKeys.listByLanguage, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useListByLibrary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByLibrary = (
params: Models.ListModelsByLibraryRequest,
options: QueryObserverOptions<Models.RespModelsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModelsObject, Error>(
[QueryKeys.listByLibrary, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useListByQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByQuery = (
params: Models.ListModelsByQueryRequest,
options: QueryObserverOptions<Models.RespModelsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModelsObject, Error>(
[QueryKeys.listByQuery, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useListByTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListByTask = (
params: Models.ListModelsByTaskRequest,
options: QueryObserverOptions<Models.RespModelsObject, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModelsObject, Error>(
[QueryKeys.listByTask, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
4 changes: 1 addition & 3 deletions lib/tapisui-hooks/src/ml-hub/models/useListDownloadLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ import { MLHub as API } from '@tapis/tapisui-api';
import { Models } from '@tapis/tapis-typescript';
import { useTapisConfig } from '../../';
import QueryKeys from './queryKeys';
import basePath from './basePath'; // remove if ml-hub is listed in NGINX

const useListDownloadLinks = (
params: Models.DownloadModelRequest,
options: QueryObserverOptions<Models.RespModelDownload, Error> = {}
) => {
// const { accessToken, basePath } = useTapisConfig();
const { accessToken } = useTapisConfig(); // remove this line and uncomment line above if ml-hub is listed in NGINX
const { accessToken, basePath } = useTapisConfig();
const result = useQuery<Models.RespModelDownload, Error>(
[QueryKeys.listDownloadLinks, params, accessToken],
// Default to no token. This will generate a 403 when calling the list function
Expand Down
Loading