@gymspace/sdk 1.2.8 → 1.2.11

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 { BaseResource } from './base';
2
- import {
3
- Lead,
4
- CreateLeadDto,
5
- UpdateLeadDto,
6
- SearchLeadsParams,
7
- LeadStats
8
- } from '../models/leads';
9
- import { RequestOptions, PaginatedResponseDto } from '../types';
10
-
11
- export class LeadsResource extends BaseResource {
12
- private basePath = 'leads';
13
-
14
- async createLead(data: CreateLeadDto, options?: RequestOptions): Promise<Lead> {
15
- return this.client.post<Lead>(this.basePath, data, options);
16
- }
17
-
18
- async searchLeads(
19
- params?: SearchLeadsParams,
20
- options?: RequestOptions
21
- ): Promise<PaginatedResponseDto<Lead>> {
22
- return this.paginate<Lead>(this.basePath, params, options);
23
- }
24
-
25
- async getLead(id: string, options?: RequestOptions): Promise<Lead> {
26
- return this.client.get<Lead>(`${this.basePath}/${id}`, undefined, options);
27
- }
28
-
29
- async updateLead(
30
- id: string,
31
- data: UpdateLeadDto,
32
- options?: RequestOptions
33
- ): Promise<Lead> {
34
- return this.client.put<Lead>(`${this.basePath}/${id}`, data, options);
35
- }
36
-
37
- async getLeadStats(options?: RequestOptions): Promise<LeadStats> {
38
- return this.client.get<LeadStats>(`${this.basePath}/stats/gym`, undefined, options);
39
- }
40
-
41
- async convertLead(id: string, options?: RequestOptions): Promise<{ clientId: string }> {
42
- return this.client.post<{ clientId: string }>(
43
- `${this.basePath}/${id}/convert`,
44
- undefined,
45
- options
46
- );
47
- }
48
- }