Revert "Add Kaggle platform support and path transformation"
This reverts commit 1480595fbc.
This commit is contained in:
1 parent
3469e3f8d6
commit
2166f02cb8
3 files changed
+1
-86
No files matched your search
+1
-2
@@ -45,8 +45,7 @@ export default async function handler(request) {
|
||||
'Container Registries',
|
||||
'AI Inference Providers',
|
||||
'arXiv',
|
||||
'F-Droid',
|
||||
'Kaggle'
|
||||
'F-Droid'
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ export const PLATFORMS = {
|
||||
arch: 'https://geo.mirror.pkgbuild.com',
|
||||
arxiv: 'https://arxiv.org',
|
||||
fdroid: 'https://f-droid.org',
|
||||
kaggle: 'https://www.kaggle.com',
|
||||
|
||||
// AI Inference Providers
|
||||
'ip-openai': 'https://api.openai.com',
|
||||
@@ -158,24 +157,5 @@ export function transformPath(path, platformKey) {
|
||||
}
|
||||
}
|
||||
|
||||
// Special handling for Kaggle API paths
|
||||
if (platformKey === 'kaggle') {
|
||||
// Transform paths to include the API prefix
|
||||
if (transformedPath.startsWith('/')) {
|
||||
// Handle different Kaggle API endpoints:
|
||||
// /datasets/download/owner/dataset-slug -> /api/v1/datasets/download/owner/dataset-slug
|
||||
// /competitions/data/download/competition-name -> /api/v1/competitions/data/download/competition-name
|
||||
// /datasets/list -> /api/v1/datasets/list
|
||||
// /competitions/list -> /api/v1/competitions/list
|
||||
// /models/list -> /api/v1/models/list
|
||||
// /kernels/list -> /api/v1/kernels/list
|
||||
|
||||
// Add API prefix if not already present
|
||||
if (!transformedPath.startsWith('/api/v1/')) {
|
||||
transformedPath = `/api/v1${transformedPath}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return transformedPath;
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { transformPath } from '../src/config/platforms.js';
|
||||
|
||||
describe('Kaggle API path transformation', () => {
|
||||
it('should transform dataset download URLs correctly', () => {
|
||||
const path = '/kaggle/datasets/download/zillow/zecon';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/datasets/download/zillow/zecon');
|
||||
});
|
||||
|
||||
it('should transform dataset list URLs correctly', () => {
|
||||
const path = '/kaggle/datasets/list';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/datasets/list');
|
||||
});
|
||||
|
||||
it('should transform competition data download URLs correctly', () => {
|
||||
const path = '/kaggle/competitions/data/download/titanic';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/competitions/data/download/titanic');
|
||||
});
|
||||
|
||||
it('should transform competition list URLs correctly', () => {
|
||||
const path = '/kaggle/competitions/list';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/competitions/list');
|
||||
});
|
||||
|
||||
it('should transform model list URLs correctly', () => {
|
||||
const path = '/kaggle/models/list';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/models/list');
|
||||
});
|
||||
|
||||
it('should transform kernel list URLs correctly', () => {
|
||||
const path = '/kaggle/kernels/list';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/kernels/list');
|
||||
});
|
||||
|
||||
it('should handle URLs that already have API prefix', () => {
|
||||
const path = '/kaggle/api/v1/datasets/download/owner/dataset';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/datasets/download/owner/dataset');
|
||||
});
|
||||
|
||||
it('should handle search endpoints with query parameters', () => {
|
||||
const path = '/kaggle/datasets/list?search=housing&sortBy=votes';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/datasets/list?search=housing&sortBy=votes');
|
||||
});
|
||||
|
||||
it('should handle dataset metadata URLs', () => {
|
||||
const path = '/kaggle/datasets/metadata/owner/dataset-slug';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/datasets/metadata/owner/dataset-slug');
|
||||
});
|
||||
|
||||
it('should handle competition submissions', () => {
|
||||
const path = '/kaggle/competitions/submissions/submit';
|
||||
const result = transformPath(path, 'kaggle');
|
||||
expect(result).toBe('/api/v1/competitions/submissions/submit');
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user