@vitalfit/sdk 0.3.7 → 0.3.8

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/dist/index.d.cts CHANGED
@@ -1,8 +1,11 @@
1
+ import { ResponseType } from 'axios';
2
+
1
3
  type ClientConfig = {
2
4
  url: string;
3
5
  jwt?: string;
4
6
  data?: object;
5
7
  params?: object;
8
+ responseType?: ResponseType;
6
9
  };
7
10
  declare class Client {
8
11
  private client;
@@ -24,6 +27,10 @@ declare class Client {
24
27
  put(config: ClientConfig): Promise<any>;
25
28
  patch(config: ClientConfig): Promise<any>;
26
29
  delete(config: ClientConfig): Promise<any>;
30
+ download(config: ClientConfig): Promise<{
31
+ blob: Blob;
32
+ filename?: string;
33
+ }>;
27
34
  }
28
35
 
29
36
  type PaginationRequest = {
@@ -141,6 +148,8 @@ type User = {
141
148
  ClientProfile: ClientProfile;
142
149
  role_id: string;
143
150
  role: Role;
151
+ category?: string;
152
+ has_active_membership?: boolean;
144
153
  client_membership?: ClientMembership;
145
154
  created_at: string;
146
155
  updated_at: string;
@@ -194,6 +203,9 @@ type MedicalProfile = {
194
203
  medications: string;
195
204
  warnings: string;
196
205
  };
206
+ type BlockUserRequest = {
207
+ block_justification: string;
208
+ };
197
209
 
198
210
  type PaginatedBranch = {
199
211
  branch_id: string;
@@ -1146,7 +1158,7 @@ declare class AuthService {
1146
1158
  revokeSessionByID(sessionId: string, jwt: string): Promise<void>;
1147
1159
  getUserSessions(jwt: string): Promise<DataResponse<UserSession[]>>;
1148
1160
  getUserSessionByID(userId: string, jwt: string): Promise<DataResponse<UserSession[]>>;
1149
- login({ email, password, context, }: LoginRequest): Promise<LoginResponse>;
1161
+ login({ email, password, context, device_token, }: LoginRequest): Promise<LoginResponse>;
1150
1162
  logout(): void;
1151
1163
  saveJWT(jwt: string): void;
1152
1164
  saveTokens(access: string, refresh: string): void;
@@ -1175,6 +1187,7 @@ declare class UserService {
1175
1187
  QrToken(jwt: string): Promise<QrToken>;
1176
1188
  resendActivateOtp(email: string): Promise<void>;
1177
1189
  UpgradePassword(jwt: string, currentPassword: string, newPassword: string, confirmPassword: string): Promise<void>;
1190
+ blockUser(userId: string, data: BlockUserRequest, jwt: string): Promise<void>;
1178
1191
  createMedicalProfile(userId: string, data: MedicalProfile, jwt: string): Promise<void>;
1179
1192
  getMedicalProfile(userId: string, jwt: string): Promise<DataResponse<MedicalProfile>>;
1180
1193
  updateMedicalProfile(userId: string, data: MedicalProfile, jwt: string): Promise<void>;
@@ -1315,11 +1328,12 @@ declare class EquipmentService {
1315
1328
  declare class ScheduleService {
1316
1329
  private client;
1317
1330
  constructor(client: Client);
1318
- ListBranchesClass(branchID: string, jwt: string): Promise<DataResponse<BranchClassInfo[]>>;
1331
+ ListBranchesClass(branchID: string, jwt: string, month?: number, year?: number): Promise<DataResponse<BranchClassInfo[]>>;
1319
1332
  CreateClass(branchID: string, data: CreateClassPayload, jwt: string): Promise<void>;
1320
1333
  GetClassByID(classID: string, jwt: string): Promise<DataResponse<BranchClassInfo>>;
1321
1334
  UpdateClass(classID: string, data: UpdateClassPayload, jwt: string): Promise<void>;
1322
1335
  DeleteClass(classID: string, jwt: string): Promise<void>;
1336
+ GetClassesByInstructor(jwt: string, userId?: string, month?: number, year?: number): Promise<DataResponse<BranchClassInfo[]>>;
1323
1337
  }
1324
1338
 
1325
1339
  declare class PackagesService {
@@ -1368,6 +1382,7 @@ declare class AccessService {
1368
1382
  checkIn(jwt: string, data: CheckIn): Promise<CheckInResponse>;
1369
1383
  getClientAttendanceHistory(jwt: string, userId: string, start?: string, end?: string, { page, limit, sort }?: PaginationRequest): Promise<PaginatedTotal<AttendanceHistory[]>>;
1370
1384
  getClientServiceUsage(jwt: string, userId: string, start?: string, end?: string, { page, limit, sort }?: PaginationRequest): Promise<PaginatedTotal<ServiceUsage[]>>;
1385
+ getClassAttendanceHistory(jwt: string, classId: string, start?: string, end?: string, status?: 'Attended' | 'NoShow' | 'Cancelled'): Promise<DataResponse<AttendanceHistory[]>>;
1371
1386
  }
1372
1387
 
1373
1388
  declare class ReportService {
@@ -1460,6 +1475,28 @@ declare class NotificationService {
1460
1475
  sendBroadcast(data: BroadcastRequest, jwt: string): Promise<void>;
1461
1476
  }
1462
1477
 
1478
+ type DownloadResponse = {
1479
+ blob: Blob;
1480
+ filename?: string;
1481
+ };
1482
+ declare class ExportsService {
1483
+ private client;
1484
+ constructor(client: Client);
1485
+ exportFinancialReport(jwt: string, start?: string, end?: string, branchId?: string): Promise<DownloadResponse>;
1486
+ exportClientsReport(jwt: string, start?: string, end?: string, branchId?: string): Promise<DownloadResponse>;
1487
+ exportSalesReport(jwt: string, start?: string, end?: string, branchId?: string): Promise<DownloadResponse>;
1488
+ exportClients(jwt: string): Promise<DownloadResponse>;
1489
+ exportStaff(jwt: string): Promise<DownloadResponse>;
1490
+ exportInstructors(jwt: string): Promise<DownloadResponse>;
1491
+ exportEquipmentTypes(jwt: string): Promise<DownloadResponse>;
1492
+ exportBranchEquipment(branchId: string, jwt: string): Promise<DownloadResponse>;
1493
+ exportServices(jwt: string): Promise<DownloadResponse>;
1494
+ exportBranchServices(branchId: string, jwt: string): Promise<DownloadResponse>;
1495
+ exportMembershipPlans(jwt: string): Promise<DownloadResponse>;
1496
+ exportPackages(jwt: string): Promise<DownloadResponse>;
1497
+ exportPaymentMethods(jwt: string): Promise<DownloadResponse>;
1498
+ }
1499
+
1463
1500
  declare class APIError extends Error {
1464
1501
  status: number;
1465
1502
  messages: string[];
@@ -1492,9 +1529,10 @@ declare class VitalFit {
1492
1529
  policy: PolicyService;
1493
1530
  audit: AuditService;
1494
1531
  notification: NotificationService;
1532
+ exports: ExportsService;
1495
1533
  constructor(isDevMode: boolean, origin?: string);
1496
1534
  static getInstance(isDevMode?: boolean): VitalFit;
1497
1535
  version(): string;
1498
1536
  }
1499
1537
 
1500
- export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type AddToWishlistRequest, type AttendanceHistory, type AuditLog, type BankTransferConfig, type Banner, type BannerResponse, type BaseModel, type BillingMatrix, type BillingMatrixRow, type BookClassRequest, type BookingParticipant, type BranchClassInfo, type BranchDetails, type BranchEquipmentInventory, type BranchInfo, type BranchInstructorInfo, type BranchPaymentMethod, type BranchPaymentMethodInfo, type BranchPaymentVisibility, type BranchPerformance, type BranchScheduleResponse, type BranchServicePrice, type BranchStaff, type BranchStatusCount, type BroadcastRequest, type CancellationReason, type ChartData, type CheckIn, type CheckInResponse, type ClassBookingCount, type ClassCapacityStats, type ClassScheduleItem, type ClientBookingResponse, type ClientInvoice, type ClientMembership, type ClientMembershipDetail, type ClientMembershipItem, type ClientMembershipUser, type ClientProfile, type CohortRetention, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateCancellationReason, type CreateClassPayload, type CreateEquipment, type CreateFiscalDocumentRequest, type CreateInvoiceItem, type CreateInvoicePayload, type CreateInvoiceResponse, type CreateMembershipType, type CreatePackagePayload, type CreatePaymentMethod, type CreatePromotion, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type EquipmentInfo, type EquipmentStatus, type ExchangeRateResponse, type FinancialSummary, type FinancialSummaryItem, type FiscalDocument, type GetUserResponse, type GlobalSalesStats, type GlobalStat, type HeatmapPoint, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoiceList, type InvoicePaymentDetail, type KPICard, type LoginRequest, type LoginResponse, type MedicalProfile, type MembershipType, type MembershipTypeDetail, type MembershipsSummary, type NotificationResponse, type Oauth, type OperatingHour, type PackageDetail, type PackageItemDetail, type PackageItemInput, type PackageListItem, type PackagePublicItem, type PaginatedBranch, type PaginatedEquipmentRequest, type PaginatedInstructor, type PaginatedServiceRequest, type PaginatedTotal, type Pagination, type PaginationBranchRequest, type PaginationRequest, type PaginationWithStatus, type PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type Policy, type Promotion, type PublicMembershipResponse, type PublicPaginatedPackage, type PublicPaginationService, type QrToken, type RandomBanner, type RecentAttendanceItem, type RenewTokenRequest, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type ServicePublicItem, type ServiceUsage, type ServicesSummary, type SignUpRequest, type Specialty, type StackedChartData, type Staff, type TaxRate, type TopBranch, type TotalSalesStats, type UUIDModel, type UnreadCountResponse, type UpdateBanner, type UpdateBranchEquipmentDetails, type UpdateBranchPaymentMethod, type UpdateBranchRequest, type UpdateBranchServicePrice, type UpdateClassPayload, type UpdateClientMembershipRequest, type UpdateEquipment, type UpdateMembershipType, type UpdateOperatingHour, type UpdatePackagePayload, type UpdateServiceImageManual, type UpdateServiceManual, type UpdateUserRequest, type UpdateUserStaffRequest, type User, type UserApiResponse, UserGender, type UserPaginationOptions, type UserSession, VitalFit, type WishlistItemResponse, type ZelleConfig, isAPIError, mainCurrencies, type updatePolicy };
1538
+ export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type AddToWishlistRequest, type AttendanceHistory, type AuditLog, type BankTransferConfig, type Banner, type BannerResponse, type BaseModel, type BillingMatrix, type BillingMatrixRow, type BlockUserRequest, type BookClassRequest, type BookingParticipant, type BranchClassInfo, type BranchDetails, type BranchEquipmentInventory, type BranchInfo, type BranchInstructorInfo, type BranchPaymentMethod, type BranchPaymentMethodInfo, type BranchPaymentVisibility, type BranchPerformance, type BranchScheduleResponse, type BranchServicePrice, type BranchStaff, type BranchStatusCount, type BroadcastRequest, type CancellationReason, type ChartData, type CheckIn, type CheckInResponse, type ClassBookingCount, type ClassCapacityStats, type ClassScheduleItem, type ClientBookingResponse, type ClientInvoice, type ClientMembership, type ClientMembershipDetail, type ClientMembershipItem, type ClientMembershipUser, type ClientProfile, type CohortRetention, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateCancellationReason, type CreateClassPayload, type CreateEquipment, type CreateFiscalDocumentRequest, type CreateInvoiceItem, type CreateInvoicePayload, type CreateInvoiceResponse, type CreateMembershipType, type CreatePackagePayload, type CreatePaymentMethod, type CreatePromotion, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type EquipmentInfo, type EquipmentStatus, type ExchangeRateResponse, type FinancialSummary, type FinancialSummaryItem, type FiscalDocument, type GetUserResponse, type GlobalSalesStats, type GlobalStat, type HeatmapPoint, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoiceList, type InvoicePaymentDetail, type KPICard, type LoginRequest, type LoginResponse, type MedicalProfile, type MembershipType, type MembershipTypeDetail, type MembershipsSummary, type NotificationResponse, type Oauth, type OperatingHour, type PackageDetail, type PackageItemDetail, type PackageItemInput, type PackageListItem, type PackagePublicItem, type PaginatedBranch, type PaginatedEquipmentRequest, type PaginatedInstructor, type PaginatedServiceRequest, type PaginatedTotal, type Pagination, type PaginationBranchRequest, type PaginationRequest, type PaginationWithStatus, type PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type Policy, type Promotion, type PublicMembershipResponse, type PublicPaginatedPackage, type PublicPaginationService, type QrToken, type RandomBanner, type RecentAttendanceItem, type RenewTokenRequest, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type ServicePublicItem, type ServiceUsage, type ServicesSummary, type SignUpRequest, type Specialty, type StackedChartData, type Staff, type TaxRate, type TopBranch, type TotalSalesStats, type UUIDModel, type UnreadCountResponse, type UpdateBanner, type UpdateBranchEquipmentDetails, type UpdateBranchPaymentMethod, type UpdateBranchRequest, type UpdateBranchServicePrice, type UpdateClassPayload, type UpdateClientMembershipRequest, type UpdateEquipment, type UpdateMembershipType, type UpdateOperatingHour, type UpdatePackagePayload, type UpdateServiceImageManual, type UpdateServiceManual, type UpdateUserRequest, type UpdateUserStaffRequest, type User, type UserApiResponse, UserGender, type UserPaginationOptions, type UserSession, VitalFit, type WishlistItemResponse, type ZelleConfig, isAPIError, mainCurrencies, type updatePolicy };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,11 @@
1
+ import { ResponseType } from 'axios';
2
+
1
3
  type ClientConfig = {
2
4
  url: string;
3
5
  jwt?: string;
4
6
  data?: object;
5
7
  params?: object;
8
+ responseType?: ResponseType;
6
9
  };
7
10
  declare class Client {
8
11
  private client;
@@ -24,6 +27,10 @@ declare class Client {
24
27
  put(config: ClientConfig): Promise<any>;
25
28
  patch(config: ClientConfig): Promise<any>;
26
29
  delete(config: ClientConfig): Promise<any>;
30
+ download(config: ClientConfig): Promise<{
31
+ blob: Blob;
32
+ filename?: string;
33
+ }>;
27
34
  }
28
35
 
29
36
  type PaginationRequest = {
@@ -141,6 +148,8 @@ type User = {
141
148
  ClientProfile: ClientProfile;
142
149
  role_id: string;
143
150
  role: Role;
151
+ category?: string;
152
+ has_active_membership?: boolean;
144
153
  client_membership?: ClientMembership;
145
154
  created_at: string;
146
155
  updated_at: string;
@@ -194,6 +203,9 @@ type MedicalProfile = {
194
203
  medications: string;
195
204
  warnings: string;
196
205
  };
206
+ type BlockUserRequest = {
207
+ block_justification: string;
208
+ };
197
209
 
198
210
  type PaginatedBranch = {
199
211
  branch_id: string;
@@ -1146,7 +1158,7 @@ declare class AuthService {
1146
1158
  revokeSessionByID(sessionId: string, jwt: string): Promise<void>;
1147
1159
  getUserSessions(jwt: string): Promise<DataResponse<UserSession[]>>;
1148
1160
  getUserSessionByID(userId: string, jwt: string): Promise<DataResponse<UserSession[]>>;
1149
- login({ email, password, context, }: LoginRequest): Promise<LoginResponse>;
1161
+ login({ email, password, context, device_token, }: LoginRequest): Promise<LoginResponse>;
1150
1162
  logout(): void;
1151
1163
  saveJWT(jwt: string): void;
1152
1164
  saveTokens(access: string, refresh: string): void;
@@ -1175,6 +1187,7 @@ declare class UserService {
1175
1187
  QrToken(jwt: string): Promise<QrToken>;
1176
1188
  resendActivateOtp(email: string): Promise<void>;
1177
1189
  UpgradePassword(jwt: string, currentPassword: string, newPassword: string, confirmPassword: string): Promise<void>;
1190
+ blockUser(userId: string, data: BlockUserRequest, jwt: string): Promise<void>;
1178
1191
  createMedicalProfile(userId: string, data: MedicalProfile, jwt: string): Promise<void>;
1179
1192
  getMedicalProfile(userId: string, jwt: string): Promise<DataResponse<MedicalProfile>>;
1180
1193
  updateMedicalProfile(userId: string, data: MedicalProfile, jwt: string): Promise<void>;
@@ -1315,11 +1328,12 @@ declare class EquipmentService {
1315
1328
  declare class ScheduleService {
1316
1329
  private client;
1317
1330
  constructor(client: Client);
1318
- ListBranchesClass(branchID: string, jwt: string): Promise<DataResponse<BranchClassInfo[]>>;
1331
+ ListBranchesClass(branchID: string, jwt: string, month?: number, year?: number): Promise<DataResponse<BranchClassInfo[]>>;
1319
1332
  CreateClass(branchID: string, data: CreateClassPayload, jwt: string): Promise<void>;
1320
1333
  GetClassByID(classID: string, jwt: string): Promise<DataResponse<BranchClassInfo>>;
1321
1334
  UpdateClass(classID: string, data: UpdateClassPayload, jwt: string): Promise<void>;
1322
1335
  DeleteClass(classID: string, jwt: string): Promise<void>;
1336
+ GetClassesByInstructor(jwt: string, userId?: string, month?: number, year?: number): Promise<DataResponse<BranchClassInfo[]>>;
1323
1337
  }
1324
1338
 
1325
1339
  declare class PackagesService {
@@ -1368,6 +1382,7 @@ declare class AccessService {
1368
1382
  checkIn(jwt: string, data: CheckIn): Promise<CheckInResponse>;
1369
1383
  getClientAttendanceHistory(jwt: string, userId: string, start?: string, end?: string, { page, limit, sort }?: PaginationRequest): Promise<PaginatedTotal<AttendanceHistory[]>>;
1370
1384
  getClientServiceUsage(jwt: string, userId: string, start?: string, end?: string, { page, limit, sort }?: PaginationRequest): Promise<PaginatedTotal<ServiceUsage[]>>;
1385
+ getClassAttendanceHistory(jwt: string, classId: string, start?: string, end?: string, status?: 'Attended' | 'NoShow' | 'Cancelled'): Promise<DataResponse<AttendanceHistory[]>>;
1371
1386
  }
1372
1387
 
1373
1388
  declare class ReportService {
@@ -1460,6 +1475,28 @@ declare class NotificationService {
1460
1475
  sendBroadcast(data: BroadcastRequest, jwt: string): Promise<void>;
1461
1476
  }
1462
1477
 
1478
+ type DownloadResponse = {
1479
+ blob: Blob;
1480
+ filename?: string;
1481
+ };
1482
+ declare class ExportsService {
1483
+ private client;
1484
+ constructor(client: Client);
1485
+ exportFinancialReport(jwt: string, start?: string, end?: string, branchId?: string): Promise<DownloadResponse>;
1486
+ exportClientsReport(jwt: string, start?: string, end?: string, branchId?: string): Promise<DownloadResponse>;
1487
+ exportSalesReport(jwt: string, start?: string, end?: string, branchId?: string): Promise<DownloadResponse>;
1488
+ exportClients(jwt: string): Promise<DownloadResponse>;
1489
+ exportStaff(jwt: string): Promise<DownloadResponse>;
1490
+ exportInstructors(jwt: string): Promise<DownloadResponse>;
1491
+ exportEquipmentTypes(jwt: string): Promise<DownloadResponse>;
1492
+ exportBranchEquipment(branchId: string, jwt: string): Promise<DownloadResponse>;
1493
+ exportServices(jwt: string): Promise<DownloadResponse>;
1494
+ exportBranchServices(branchId: string, jwt: string): Promise<DownloadResponse>;
1495
+ exportMembershipPlans(jwt: string): Promise<DownloadResponse>;
1496
+ exportPackages(jwt: string): Promise<DownloadResponse>;
1497
+ exportPaymentMethods(jwt: string): Promise<DownloadResponse>;
1498
+ }
1499
+
1463
1500
  declare class APIError extends Error {
1464
1501
  status: number;
1465
1502
  messages: string[];
@@ -1492,9 +1529,10 @@ declare class VitalFit {
1492
1529
  policy: PolicyService;
1493
1530
  audit: AuditService;
1494
1531
  notification: NotificationService;
1532
+ exports: ExportsService;
1495
1533
  constructor(isDevMode: boolean, origin?: string);
1496
1534
  static getInstance(isDevMode?: boolean): VitalFit;
1497
1535
  version(): string;
1498
1536
  }
1499
1537
 
1500
- export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type AddToWishlistRequest, type AttendanceHistory, type AuditLog, type BankTransferConfig, type Banner, type BannerResponse, type BaseModel, type BillingMatrix, type BillingMatrixRow, type BookClassRequest, type BookingParticipant, type BranchClassInfo, type BranchDetails, type BranchEquipmentInventory, type BranchInfo, type BranchInstructorInfo, type BranchPaymentMethod, type BranchPaymentMethodInfo, type BranchPaymentVisibility, type BranchPerformance, type BranchScheduleResponse, type BranchServicePrice, type BranchStaff, type BranchStatusCount, type BroadcastRequest, type CancellationReason, type ChartData, type CheckIn, type CheckInResponse, type ClassBookingCount, type ClassCapacityStats, type ClassScheduleItem, type ClientBookingResponse, type ClientInvoice, type ClientMembership, type ClientMembershipDetail, type ClientMembershipItem, type ClientMembershipUser, type ClientProfile, type CohortRetention, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateCancellationReason, type CreateClassPayload, type CreateEquipment, type CreateFiscalDocumentRequest, type CreateInvoiceItem, type CreateInvoicePayload, type CreateInvoiceResponse, type CreateMembershipType, type CreatePackagePayload, type CreatePaymentMethod, type CreatePromotion, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type EquipmentInfo, type EquipmentStatus, type ExchangeRateResponse, type FinancialSummary, type FinancialSummaryItem, type FiscalDocument, type GetUserResponse, type GlobalSalesStats, type GlobalStat, type HeatmapPoint, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoiceList, type InvoicePaymentDetail, type KPICard, type LoginRequest, type LoginResponse, type MedicalProfile, type MembershipType, type MembershipTypeDetail, type MembershipsSummary, type NotificationResponse, type Oauth, type OperatingHour, type PackageDetail, type PackageItemDetail, type PackageItemInput, type PackageListItem, type PackagePublicItem, type PaginatedBranch, type PaginatedEquipmentRequest, type PaginatedInstructor, type PaginatedServiceRequest, type PaginatedTotal, type Pagination, type PaginationBranchRequest, type PaginationRequest, type PaginationWithStatus, type PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type Policy, type Promotion, type PublicMembershipResponse, type PublicPaginatedPackage, type PublicPaginationService, type QrToken, type RandomBanner, type RecentAttendanceItem, type RenewTokenRequest, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type ServicePublicItem, type ServiceUsage, type ServicesSummary, type SignUpRequest, type Specialty, type StackedChartData, type Staff, type TaxRate, type TopBranch, type TotalSalesStats, type UUIDModel, type UnreadCountResponse, type UpdateBanner, type UpdateBranchEquipmentDetails, type UpdateBranchPaymentMethod, type UpdateBranchRequest, type UpdateBranchServicePrice, type UpdateClassPayload, type UpdateClientMembershipRequest, type UpdateEquipment, type UpdateMembershipType, type UpdateOperatingHour, type UpdatePackagePayload, type UpdateServiceImageManual, type UpdateServiceManual, type UpdateUserRequest, type UpdateUserStaffRequest, type User, type UserApiResponse, UserGender, type UserPaginationOptions, type UserSession, VitalFit, type WishlistItemResponse, type ZelleConfig, isAPIError, mainCurrencies, type updatePolicy };
1538
+ export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type AddToWishlistRequest, type AttendanceHistory, type AuditLog, type BankTransferConfig, type Banner, type BannerResponse, type BaseModel, type BillingMatrix, type BillingMatrixRow, type BlockUserRequest, type BookClassRequest, type BookingParticipant, type BranchClassInfo, type BranchDetails, type BranchEquipmentInventory, type BranchInfo, type BranchInstructorInfo, type BranchPaymentMethod, type BranchPaymentMethodInfo, type BranchPaymentVisibility, type BranchPerformance, type BranchScheduleResponse, type BranchServicePrice, type BranchStaff, type BranchStatusCount, type BroadcastRequest, type CancellationReason, type ChartData, type CheckIn, type CheckInResponse, type ClassBookingCount, type ClassCapacityStats, type ClassScheduleItem, type ClientBookingResponse, type ClientInvoice, type ClientMembership, type ClientMembershipDetail, type ClientMembershipItem, type ClientMembershipUser, type ClientProfile, type CohortRetention, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateCancellationReason, type CreateClassPayload, type CreateEquipment, type CreateFiscalDocumentRequest, type CreateInvoiceItem, type CreateInvoicePayload, type CreateInvoiceResponse, type CreateMembershipType, type CreatePackagePayload, type CreatePaymentMethod, type CreatePromotion, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type EquipmentInfo, type EquipmentStatus, type ExchangeRateResponse, type FinancialSummary, type FinancialSummaryItem, type FiscalDocument, type GetUserResponse, type GlobalSalesStats, type GlobalStat, type HeatmapPoint, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoiceList, type InvoicePaymentDetail, type KPICard, type LoginRequest, type LoginResponse, type MedicalProfile, type MembershipType, type MembershipTypeDetail, type MembershipsSummary, type NotificationResponse, type Oauth, type OperatingHour, type PackageDetail, type PackageItemDetail, type PackageItemInput, type PackageListItem, type PackagePublicItem, type PaginatedBranch, type PaginatedEquipmentRequest, type PaginatedInstructor, type PaginatedServiceRequest, type PaginatedTotal, type Pagination, type PaginationBranchRequest, type PaginationRequest, type PaginationWithStatus, type PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type Policy, type Promotion, type PublicMembershipResponse, type PublicPaginatedPackage, type PublicPaginationService, type QrToken, type RandomBanner, type RecentAttendanceItem, type RenewTokenRequest, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type ServicePublicItem, type ServiceUsage, type ServicesSummary, type SignUpRequest, type Specialty, type StackedChartData, type Staff, type TaxRate, type TopBranch, type TotalSalesStats, type UUIDModel, type UnreadCountResponse, type UpdateBanner, type UpdateBranchEquipmentDetails, type UpdateBranchPaymentMethod, type UpdateBranchRequest, type UpdateBranchServicePrice, type UpdateClassPayload, type UpdateClientMembershipRequest, type UpdateEquipment, type UpdateMembershipType, type UpdateOperatingHour, type UpdatePackagePayload, type UpdateServiceImageManual, type UpdateServiceManual, type UpdateUserRequest, type UpdateUserStaffRequest, type User, type UserApiResponse, UserGender, type UserPaginationOptions, type UserSession, VitalFit, type WishlistItemResponse, type ZelleConfig, isAPIError, mainCurrencies, type updatePolicy };
package/dist/index.js CHANGED
@@ -117,7 +117,8 @@ var Client = class {
117
117
  url: config.url,
118
118
  data: config.data,
119
119
  params: config.params,
120
- headers: {}
120
+ headers: {},
121
+ responseType: config.responseType
121
122
  };
122
123
  if (tokenToUse && axiosConfig.headers) {
123
124
  axiosConfig.headers["Authorization"] = `Bearer ${tokenToUse}`;
@@ -171,6 +172,48 @@ var Client = class {
171
172
  async delete(config) {
172
173
  return this.call("delete", config);
173
174
  }
175
+ async download(config) {
176
+ const tokenToUse = config.jwt || this.accessToken;
177
+ const axiosConfig = {
178
+ method: "get",
179
+ url: config.url,
180
+ params: config.params,
181
+ headers: {},
182
+ responseType: "blob"
183
+ };
184
+ if (tokenToUse && axiosConfig.headers) {
185
+ axiosConfig.headers["Authorization"] = `Bearer ${tokenToUse}`;
186
+ }
187
+ try {
188
+ const response = await this.client.request(axiosConfig);
189
+ let filename;
190
+ const disposition = response.headers["content-disposition"];
191
+ if (disposition) {
192
+ const matches = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/.exec(
193
+ disposition
194
+ );
195
+ if (matches != null && matches[1]) {
196
+ filename = matches[1].replace(/['"]/g, "");
197
+ }
198
+ }
199
+ return { blob: response.data, filename };
200
+ } catch (error) {
201
+ if (axios.isAxiosError(error) && error.response?.data instanceof Blob) {
202
+ const errorText = await error.response.data.text();
203
+ try {
204
+ const errorJson = JSON.parse(errorText);
205
+ const errorMessage = errorJson.error || "Ocurri\xF3 un error inesperado";
206
+ throw new APIError([errorMessage], error.response.status);
207
+ } catch (e) {
208
+ throw new APIError(
209
+ ["Error en la descarga del archivo"],
210
+ error.response.status
211
+ );
212
+ }
213
+ }
214
+ throw new Error(error);
215
+ }
216
+ }
174
217
  };
175
218
 
176
219
  // src/services/auth.ts
@@ -248,14 +291,16 @@ var AuthService = class {
248
291
  async login({
249
292
  email,
250
293
  password,
251
- context
294
+ context,
295
+ device_token
252
296
  }) {
253
297
  const response = await this.client.post({
254
298
  url: "/auth/login",
255
299
  data: {
256
300
  email,
257
301
  password,
258
- context
302
+ context,
303
+ device_token
259
304
  }
260
305
  });
261
306
  return response;
@@ -357,6 +402,7 @@ var UserService = class {
357
402
  this.deleteUser = this.deleteUser.bind(this);
358
403
  this.resendActivateOtp = this.resendActivateOtp.bind(this);
359
404
  this.UpgradePassword = this.UpgradePassword.bind(this);
405
+ this.blockUser = this.blockUser.bind(this);
360
406
  this.createMedicalProfile = this.createMedicalProfile.bind(this);
361
407
  this.getMedicalProfile = this.getMedicalProfile.bind(this);
362
408
  this.updateMedicalProfile = this.updateMedicalProfile.bind(this);
@@ -457,6 +503,13 @@ var UserService = class {
457
503
  }
458
504
  });
459
505
  }
506
+ async blockUser(userId, data, jwt) {
507
+ await this.client.put({
508
+ url: `/user/${userId}/block`,
509
+ jwt,
510
+ data
511
+ });
512
+ }
460
513
  //medical
461
514
  async createMedicalProfile(userId, data, jwt) {
462
515
  await this.client.post({
@@ -1376,11 +1429,16 @@ var ScheduleService = class {
1376
1429
  this.UpdateClass = this.UpdateClass.bind(this);
1377
1430
  this.DeleteClass = this.DeleteClass.bind(this);
1378
1431
  this.GetClassByID = this.GetClassByID.bind(this);
1432
+ this.GetClassesByInstructor = this.GetClassesByInstructor.bind(this);
1379
1433
  }
1380
- async ListBranchesClass(branchID, jwt) {
1434
+ async ListBranchesClass(branchID, jwt, month, year) {
1381
1435
  const response = await this.client.get({
1382
1436
  url: `/branches/${branchID}/schedule`,
1383
- jwt
1437
+ jwt,
1438
+ params: {
1439
+ month,
1440
+ year
1441
+ }
1384
1442
  });
1385
1443
  return response;
1386
1444
  }
@@ -1411,6 +1469,18 @@ var ScheduleService = class {
1411
1469
  jwt
1412
1470
  });
1413
1471
  }
1472
+ async GetClassesByInstructor(jwt, userId, month, year) {
1473
+ const response = await this.client.get({
1474
+ url: "/schedule/instructor",
1475
+ jwt,
1476
+ params: {
1477
+ user_id: userId,
1478
+ month,
1479
+ year
1480
+ }
1481
+ });
1482
+ return response;
1483
+ }
1414
1484
  };
1415
1485
 
1416
1486
  // src/services/packages.ts
@@ -1683,6 +1753,7 @@ var AccessService = class {
1683
1753
  this.checkIn = this.checkIn.bind(this);
1684
1754
  this.getClientAttendanceHistory = this.getClientAttendanceHistory.bind(this);
1685
1755
  this.getClientServiceUsage = this.getClientServiceUsage.bind(this);
1756
+ this.getClassAttendanceHistory = this.getClassAttendanceHistory.bind(this);
1686
1757
  }
1687
1758
  async checkIn(jwt, data) {
1688
1759
  const response = await this.client.post({
@@ -1720,6 +1791,18 @@ var AccessService = class {
1720
1791
  });
1721
1792
  return response;
1722
1793
  }
1794
+ async getClassAttendanceHistory(jwt, classId, start, end, status) {
1795
+ const response = await this.client.get({
1796
+ url: `/access/classes/${classId}/attendance`,
1797
+ jwt,
1798
+ params: {
1799
+ start_date: start,
1800
+ end_date: end,
1801
+ status
1802
+ }
1803
+ });
1804
+ return response;
1805
+ }
1723
1806
  };
1724
1807
 
1725
1808
  // src/services/reports.ts
@@ -2340,6 +2423,126 @@ var NotificationService = class {
2340
2423
  }
2341
2424
  };
2342
2425
 
2426
+ // src/services/exports.ts
2427
+ var ExportsService = class {
2428
+ client;
2429
+ constructor(client) {
2430
+ this.client = client;
2431
+ this.exportFinancialReport = this.exportFinancialReport.bind(this);
2432
+ this.exportClientsReport = this.exportClientsReport.bind(this);
2433
+ this.exportSalesReport = this.exportSalesReport.bind(this);
2434
+ this.exportClients = this.exportClients.bind(this);
2435
+ this.exportStaff = this.exportStaff.bind(this);
2436
+ this.exportInstructors = this.exportInstructors.bind(this);
2437
+ this.exportEquipmentTypes = this.exportEquipmentTypes.bind(this);
2438
+ this.exportBranchEquipment = this.exportBranchEquipment.bind(this);
2439
+ this.exportServices = this.exportServices.bind(this);
2440
+ this.exportBranchServices = this.exportBranchServices.bind(this);
2441
+ this.exportMembershipPlans = this.exportMembershipPlans.bind(this);
2442
+ this.exportPackages = this.exportPackages.bind(this);
2443
+ this.exportPaymentMethods = this.exportPaymentMethods.bind(this);
2444
+ }
2445
+ // Reports
2446
+ async exportFinancialReport(jwt, start, end, branchId) {
2447
+ return await this.client.download({
2448
+ url: "/reports/export/financial",
2449
+ jwt,
2450
+ params: {
2451
+ start,
2452
+ end,
2453
+ branch_id: branchId
2454
+ }
2455
+ });
2456
+ }
2457
+ async exportClientsReport(jwt, start, end, branchId) {
2458
+ return await this.client.download({
2459
+ url: "/reports/export/clients",
2460
+ jwt,
2461
+ params: {
2462
+ start,
2463
+ end,
2464
+ branch_id: branchId
2465
+ }
2466
+ });
2467
+ }
2468
+ async exportSalesReport(jwt, start, end, branchId) {
2469
+ return await this.client.download({
2470
+ url: "/reports/export/sales",
2471
+ jwt,
2472
+ params: {
2473
+ start,
2474
+ end,
2475
+ branch_id: branchId
2476
+ }
2477
+ });
2478
+ }
2479
+ // Users & Staff
2480
+ async exportClients(jwt) {
2481
+ return await this.client.download({
2482
+ url: "/user/export/clients",
2483
+ jwt
2484
+ });
2485
+ }
2486
+ async exportStaff(jwt) {
2487
+ return await this.client.download({
2488
+ url: "/user/export/users",
2489
+ jwt
2490
+ });
2491
+ }
2492
+ async exportInstructors(jwt) {
2493
+ return await this.client.download({
2494
+ url: "/instructor/export",
2495
+ jwt
2496
+ });
2497
+ }
2498
+ // Inventory & Equipment
2499
+ async exportEquipmentTypes(jwt) {
2500
+ return await this.client.download({
2501
+ url: "/equipment-types/export",
2502
+ jwt
2503
+ });
2504
+ }
2505
+ async exportBranchEquipment(branchId, jwt) {
2506
+ return await this.client.download({
2507
+ url: `/branches/${branchId}/equipment/export`,
2508
+ jwt
2509
+ });
2510
+ }
2511
+ // Services & Products
2512
+ async exportServices(jwt) {
2513
+ return await this.client.download({
2514
+ url: "/services/export",
2515
+ jwt
2516
+ });
2517
+ }
2518
+ async exportBranchServices(branchId, jwt) {
2519
+ return await this.client.download({
2520
+ url: `/branches/${branchId}/services/export`,
2521
+ jwt
2522
+ });
2523
+ }
2524
+ // Memberships & Packages
2525
+ async exportMembershipPlans(jwt) {
2526
+ return await this.client.download({
2527
+ url: "/membership-plans/export",
2528
+ jwt
2529
+ });
2530
+ }
2531
+ async exportPackages(jwt) {
2532
+ return await this.client.download({
2533
+ url: "/packages/export",
2534
+ jwt
2535
+ });
2536
+ }
2537
+ // Billing
2538
+ async exportPaymentMethods(jwt) {
2539
+ return await this.client.download({
2540
+ url: "/billing/payment-methods/export",
2541
+ jwt
2542
+ });
2543
+ }
2544
+ };
2545
+
2343
2546
  // src/types/auth.ts
2344
2547
  var UserGender = /* @__PURE__ */ ((UserGender2) => {
2345
2548
  UserGender2["male"] = "male";
@@ -2466,6 +2669,7 @@ var VitalFit = class _VitalFit {
2466
2669
  policy;
2467
2670
  audit;
2468
2671
  notification;
2672
+ exports;
2469
2673
  constructor(isDevMode, origin) {
2470
2674
  this.client = new Client(isDevMode, origin);
2471
2675
  this.auth = new AuthService(this.client);
@@ -2490,6 +2694,7 @@ var VitalFit = class _VitalFit {
2490
2694
  this.policy = new PolicyService(this.client);
2491
2695
  this.audit = new AuditService(this.client);
2492
2696
  this.notification = new NotificationService(this.client);
2697
+ this.exports = new ExportsService(this.client);
2493
2698
  }
2494
2699
  static getInstance(isDevMode = false) {
2495
2700
  if (!_VitalFit.instance) {
@@ -2498,7 +2703,7 @@ var VitalFit = class _VitalFit {
2498
2703
  return _VitalFit.instance;
2499
2704
  }
2500
2705
  version() {
2501
- return "0.3.7";
2706
+ return "0.3.8";
2502
2707
  }
2503
2708
  };
2504
2709
  export {