@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.
@@ -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
- }