@hasna/connectors 1.2.1 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/index.js +432 -10
- package/bin/mcp.js +548 -167
- package/bin/serve.js +119 -0
- package/connectors/connect-huggingface/src/api/client.ts +5 -0
- package/connectors/connect-huggingface/src/api/datasets.ts +73 -0
- package/connectors/connect-huggingface/src/api/index.ts +17 -19
- package/connectors/connect-huggingface/src/api/inference.ts +100 -0
- package/connectors/connect-huggingface/src/api/models.ts +66 -0
- package/connectors/connect-huggingface/src/api/spaces.ts +42 -0
- package/connectors/connect-huggingface/src/cli/index.ts +148 -36
- package/connectors/connect-openai/src/api/images.ts +52 -8
- package/dist/db/promotions.d.ts +5 -0
- package/dist/db/promotions.test.d.ts +1 -0
- package/dist/db/usage.d.ts +17 -0
- package/dist/db/usage.test.d.ts +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +234 -3
- package/dist/lib/fuzzy.d.ts +16 -0
- package/dist/lib/fuzzy.test.d.ts +1 -0
- package/dist/lib/registry.d.ts +22 -1
- package/dist/lib/synonyms.d.ts +12 -0
- package/dist/lib/synonyms.test.d.ts +1 -0
- package/package.json +1 -1
- package/connectors/connect-huggingface/src/api/example.ts +0 -48
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { HuggingFaceClient } from './client';
|
|
2
|
-
import type { ExampleResource, ExampleListResponse, ExampleCreateParams } from '../types';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Example API module - demonstrates the pattern for API modules
|
|
6
|
-
* Replace with actual HuggingFace API endpoints (models, datasets, spaces, etc.)
|
|
7
|
-
*/
|
|
8
|
-
export class ExampleApi {
|
|
9
|
-
constructor(private readonly client: HuggingFaceClient) {}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* List resources with optional pagination
|
|
13
|
-
*/
|
|
14
|
-
async list(options?: { maxResults?: number; pageToken?: string }): Promise<ExampleListResponse> {
|
|
15
|
-
return this.client.get<ExampleListResponse>('/resources', {
|
|
16
|
-
max_results: options?.maxResults,
|
|
17
|
-
page_token: options?.pageToken,
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Get a single resource by ID
|
|
23
|
-
*/
|
|
24
|
-
async get(id: string): Promise<ExampleResource> {
|
|
25
|
-
return this.client.get<ExampleResource>(`/resources/${id}`);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Create a new resource
|
|
30
|
-
*/
|
|
31
|
-
async create(params: ExampleCreateParams): Promise<ExampleResource> {
|
|
32
|
-
return this.client.post<ExampleResource>('/resources', params);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Update an existing resource
|
|
37
|
-
*/
|
|
38
|
-
async update(id: string, params: Partial<ExampleCreateParams>): Promise<ExampleResource> {
|
|
39
|
-
return this.client.patch<ExampleResource>(`/resources/${id}`, params);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Delete a resource
|
|
44
|
-
*/
|
|
45
|
-
async delete(id: string): Promise<void> {
|
|
46
|
-
await this.client.delete(`/resources/${id}`);
|
|
47
|
-
}
|
|
48
|
-
}
|