@vitalfit/sdk 0.3.13 → 0.4.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/dist/index.cjs +71 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +71 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -27,6 +27,7 @@ declare class Client {
|
|
|
27
27
|
put(config: ClientConfig): Promise<any>;
|
|
28
28
|
patch(config: ClientConfig): Promise<any>;
|
|
29
29
|
delete(config: ClientConfig): Promise<any>;
|
|
30
|
+
upload(config: ClientConfig): Promise<any>;
|
|
30
31
|
download(config: ClientConfig): Promise<{
|
|
31
32
|
blob: Blob;
|
|
32
33
|
filename?: string;
|
|
@@ -259,6 +260,7 @@ type User = {
|
|
|
259
260
|
role: Role;
|
|
260
261
|
category?: string;
|
|
261
262
|
has_active_membership?: boolean;
|
|
263
|
+
face_auth_enabled: boolean;
|
|
262
264
|
client_membership?: ClientMembership;
|
|
263
265
|
created_at: string;
|
|
264
266
|
updated_at: string;
|
|
@@ -979,6 +981,7 @@ type CheckInResponse = {
|
|
|
979
981
|
check_in_time: string;
|
|
980
982
|
message: string;
|
|
981
983
|
service_name: string;
|
|
984
|
+
user_id: string;
|
|
982
985
|
};
|
|
983
986
|
type ServiceUsage = {
|
|
984
987
|
attendance_id: string;
|
|
@@ -1098,6 +1101,19 @@ type CohortRetention = {
|
|
|
1098
1101
|
cohort_size: number;
|
|
1099
1102
|
retention: number[];
|
|
1100
1103
|
};
|
|
1104
|
+
type RFMMetric = {
|
|
1105
|
+
user_id: string;
|
|
1106
|
+
name: string;
|
|
1107
|
+
email: string;
|
|
1108
|
+
last_purchase: string | null;
|
|
1109
|
+
recency_days: number;
|
|
1110
|
+
frequency: number;
|
|
1111
|
+
monetary_total: number;
|
|
1112
|
+
r_score: number;
|
|
1113
|
+
f_score: number;
|
|
1114
|
+
m_score: number;
|
|
1115
|
+
segment: string;
|
|
1116
|
+
};
|
|
1101
1117
|
|
|
1102
1118
|
type BranchStaff = {
|
|
1103
1119
|
id: string;
|
|
@@ -1205,6 +1221,10 @@ declare class UserService {
|
|
|
1205
1221
|
resendActivateOtp(email: string): Promise<void>;
|
|
1206
1222
|
UpgradePassword(jwt: string, currentPassword: string, newPassword: string, confirmPassword: string): Promise<void>;
|
|
1207
1223
|
blockUser(userId: string, data: BlockUserRequest, jwt: string): Promise<void>;
|
|
1224
|
+
unblockUser(userId: string, jwt: string): Promise<void>;
|
|
1225
|
+
enrollFace(jwt: string, photo: File | Blob): Promise<{
|
|
1226
|
+
message: string;
|
|
1227
|
+
}>;
|
|
1208
1228
|
createMedicalProfile(userId: string, data: MedicalProfile, jwt: string): Promise<void>;
|
|
1209
1229
|
getMedicalProfile(userId: string, jwt: string): Promise<DataResponse<MedicalProfile>>;
|
|
1210
1230
|
updateMedicalProfile(userId: string, data: MedicalProfile, jwt: string): Promise<void>;
|
|
@@ -1400,6 +1420,7 @@ declare class AccessService {
|
|
|
1400
1420
|
constructor(client: Client);
|
|
1401
1421
|
checkIn(jwt: string, data: CheckIn): Promise<CheckInResponse>;
|
|
1402
1422
|
checkInManual(jwt: string, data: CheckIn): Promise<CheckInResponse>;
|
|
1423
|
+
checkInFace(jwt: string, branchId: string, photo: File | Blob): Promise<CheckInResponse>;
|
|
1403
1424
|
getClientAttendanceHistory(jwt: string, userId: string, start?: string, end?: string, { page, limit, sort }?: PaginationRequest): Promise<PaginatedTotal<AttendanceHistory[]>>;
|
|
1404
1425
|
getClientServiceUsage(jwt: string, userId: string, start?: string, end?: string, { page, limit, sort }?: PaginationRequest): Promise<PaginatedTotal<ServiceUsage[]>>;
|
|
1405
1426
|
getClassAttendanceHistory(jwt: string, classId: string, start?: string, end?: string, status?: 'Attended' | 'NoShow' | 'Cancelled'): Promise<DataResponse<AttendanceHistory[]>>;
|
|
@@ -1451,6 +1472,7 @@ declare class ReportService {
|
|
|
1451
1472
|
financialSummary(jwt: string, branchId?: string): Promise<DataResponse<FinancialSummary>>;
|
|
1452
1473
|
salesByDemography(jwt: string, branchId: string | undefined, dimension: 'age' | 'gender', start?: string, end?: string): Promise<DataResponse<ChartData[]>>;
|
|
1453
1474
|
churnRateKPI(jwt: string, branchId?: string): Promise<DataResponse<KPICard>>;
|
|
1475
|
+
rfmAnalysis(jwt: string, branchId?: string): Promise<DataResponse<RFMMetric[]>>;
|
|
1454
1476
|
}
|
|
1455
1477
|
|
|
1456
1478
|
declare class StaffService {
|
|
@@ -1557,4 +1579,4 @@ declare class VitalFit {
|
|
|
1557
1579
|
version(): string;
|
|
1558
1580
|
}
|
|
1559
1581
|
|
|
1560
|
-
export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type AddToWishlistRequest, type AssignedClientResponse, 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 ClientBalance, 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 };
|
|
1582
|
+
export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type AddToWishlistRequest, type AssignedClientResponse, 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 ClientBalance, 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 RFMMetric, 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
|
@@ -27,6 +27,7 @@ declare class Client {
|
|
|
27
27
|
put(config: ClientConfig): Promise<any>;
|
|
28
28
|
patch(config: ClientConfig): Promise<any>;
|
|
29
29
|
delete(config: ClientConfig): Promise<any>;
|
|
30
|
+
upload(config: ClientConfig): Promise<any>;
|
|
30
31
|
download(config: ClientConfig): Promise<{
|
|
31
32
|
blob: Blob;
|
|
32
33
|
filename?: string;
|
|
@@ -259,6 +260,7 @@ type User = {
|
|
|
259
260
|
role: Role;
|
|
260
261
|
category?: string;
|
|
261
262
|
has_active_membership?: boolean;
|
|
263
|
+
face_auth_enabled: boolean;
|
|
262
264
|
client_membership?: ClientMembership;
|
|
263
265
|
created_at: string;
|
|
264
266
|
updated_at: string;
|
|
@@ -979,6 +981,7 @@ type CheckInResponse = {
|
|
|
979
981
|
check_in_time: string;
|
|
980
982
|
message: string;
|
|
981
983
|
service_name: string;
|
|
984
|
+
user_id: string;
|
|
982
985
|
};
|
|
983
986
|
type ServiceUsage = {
|
|
984
987
|
attendance_id: string;
|
|
@@ -1098,6 +1101,19 @@ type CohortRetention = {
|
|
|
1098
1101
|
cohort_size: number;
|
|
1099
1102
|
retention: number[];
|
|
1100
1103
|
};
|
|
1104
|
+
type RFMMetric = {
|
|
1105
|
+
user_id: string;
|
|
1106
|
+
name: string;
|
|
1107
|
+
email: string;
|
|
1108
|
+
last_purchase: string | null;
|
|
1109
|
+
recency_days: number;
|
|
1110
|
+
frequency: number;
|
|
1111
|
+
monetary_total: number;
|
|
1112
|
+
r_score: number;
|
|
1113
|
+
f_score: number;
|
|
1114
|
+
m_score: number;
|
|
1115
|
+
segment: string;
|
|
1116
|
+
};
|
|
1101
1117
|
|
|
1102
1118
|
type BranchStaff = {
|
|
1103
1119
|
id: string;
|
|
@@ -1205,6 +1221,10 @@ declare class UserService {
|
|
|
1205
1221
|
resendActivateOtp(email: string): Promise<void>;
|
|
1206
1222
|
UpgradePassword(jwt: string, currentPassword: string, newPassword: string, confirmPassword: string): Promise<void>;
|
|
1207
1223
|
blockUser(userId: string, data: BlockUserRequest, jwt: string): Promise<void>;
|
|
1224
|
+
unblockUser(userId: string, jwt: string): Promise<void>;
|
|
1225
|
+
enrollFace(jwt: string, photo: File | Blob): Promise<{
|
|
1226
|
+
message: string;
|
|
1227
|
+
}>;
|
|
1208
1228
|
createMedicalProfile(userId: string, data: MedicalProfile, jwt: string): Promise<void>;
|
|
1209
1229
|
getMedicalProfile(userId: string, jwt: string): Promise<DataResponse<MedicalProfile>>;
|
|
1210
1230
|
updateMedicalProfile(userId: string, data: MedicalProfile, jwt: string): Promise<void>;
|
|
@@ -1400,6 +1420,7 @@ declare class AccessService {
|
|
|
1400
1420
|
constructor(client: Client);
|
|
1401
1421
|
checkIn(jwt: string, data: CheckIn): Promise<CheckInResponse>;
|
|
1402
1422
|
checkInManual(jwt: string, data: CheckIn): Promise<CheckInResponse>;
|
|
1423
|
+
checkInFace(jwt: string, branchId: string, photo: File | Blob): Promise<CheckInResponse>;
|
|
1403
1424
|
getClientAttendanceHistory(jwt: string, userId: string, start?: string, end?: string, { page, limit, sort }?: PaginationRequest): Promise<PaginatedTotal<AttendanceHistory[]>>;
|
|
1404
1425
|
getClientServiceUsage(jwt: string, userId: string, start?: string, end?: string, { page, limit, sort }?: PaginationRequest): Promise<PaginatedTotal<ServiceUsage[]>>;
|
|
1405
1426
|
getClassAttendanceHistory(jwt: string, classId: string, start?: string, end?: string, status?: 'Attended' | 'NoShow' | 'Cancelled'): Promise<DataResponse<AttendanceHistory[]>>;
|
|
@@ -1451,6 +1472,7 @@ declare class ReportService {
|
|
|
1451
1472
|
financialSummary(jwt: string, branchId?: string): Promise<DataResponse<FinancialSummary>>;
|
|
1452
1473
|
salesByDemography(jwt: string, branchId: string | undefined, dimension: 'age' | 'gender', start?: string, end?: string): Promise<DataResponse<ChartData[]>>;
|
|
1453
1474
|
churnRateKPI(jwt: string, branchId?: string): Promise<DataResponse<KPICard>>;
|
|
1475
|
+
rfmAnalysis(jwt: string, branchId?: string): Promise<DataResponse<RFMMetric[]>>;
|
|
1454
1476
|
}
|
|
1455
1477
|
|
|
1456
1478
|
declare class StaffService {
|
|
@@ -1557,4 +1579,4 @@ declare class VitalFit {
|
|
|
1557
1579
|
version(): string;
|
|
1558
1580
|
}
|
|
1559
1581
|
|
|
1560
|
-
export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type AddToWishlistRequest, type AssignedClientResponse, 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 ClientBalance, 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 };
|
|
1582
|
+
export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type AddToWishlistRequest, type AssignedClientResponse, 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 ClientBalance, 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 RFMMetric, 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
|
@@ -172,6 +172,37 @@ var Client = class {
|
|
|
172
172
|
async delete(config) {
|
|
173
173
|
return this.call("delete", config);
|
|
174
174
|
}
|
|
175
|
+
async upload(config) {
|
|
176
|
+
const tokenToUse = config.jwt || this.accessToken;
|
|
177
|
+
const axiosConfig = {
|
|
178
|
+
method: "post",
|
|
179
|
+
url: config.url,
|
|
180
|
+
data: config.data,
|
|
181
|
+
params: config.params,
|
|
182
|
+
headers: {
|
|
183
|
+
"Content-Type": "multipart/form-data"
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
if (tokenToUse && axiosConfig.headers) {
|
|
187
|
+
axiosConfig.headers["Authorization"] = `Bearer ${tokenToUse}`;
|
|
188
|
+
}
|
|
189
|
+
try {
|
|
190
|
+
const response = await this.client.request(axiosConfig);
|
|
191
|
+
return response.data;
|
|
192
|
+
} catch (error) {
|
|
193
|
+
if (axios.isAxiosError(error)) {
|
|
194
|
+
const errorMessage = error.response?.data?.error;
|
|
195
|
+
if (typeof errorMessage === "string") {
|
|
196
|
+
throw new APIError([errorMessage], error.response?.status ?? 500);
|
|
197
|
+
}
|
|
198
|
+
throw new APIError(
|
|
199
|
+
["Ocurri\xF3 un error inesperado"],
|
|
200
|
+
error.response?.status ?? 500
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
throw new Error(error);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
175
206
|
async download(config) {
|
|
176
207
|
const tokenToUse = config.jwt || this.accessToken;
|
|
177
208
|
const axiosConfig = {
|
|
@@ -403,6 +434,8 @@ var UserService = class {
|
|
|
403
434
|
this.resendActivateOtp = this.resendActivateOtp.bind(this);
|
|
404
435
|
this.UpgradePassword = this.UpgradePassword.bind(this);
|
|
405
436
|
this.blockUser = this.blockUser.bind(this);
|
|
437
|
+
this.unblockUser = this.unblockUser.bind(this);
|
|
438
|
+
this.enrollFace = this.enrollFace.bind(this);
|
|
406
439
|
this.createMedicalProfile = this.createMedicalProfile.bind(this);
|
|
407
440
|
this.getMedicalProfile = this.getMedicalProfile.bind(this);
|
|
408
441
|
this.updateMedicalProfile = this.updateMedicalProfile.bind(this);
|
|
@@ -519,6 +552,22 @@ var UserService = class {
|
|
|
519
552
|
data
|
|
520
553
|
});
|
|
521
554
|
}
|
|
555
|
+
async unblockUser(userId, jwt) {
|
|
556
|
+
await this.client.put({
|
|
557
|
+
url: `/user/${userId}/unblock`,
|
|
558
|
+
jwt
|
|
559
|
+
});
|
|
560
|
+
}
|
|
561
|
+
async enrollFace(jwt, photo) {
|
|
562
|
+
const formData = new FormData();
|
|
563
|
+
formData.append("selfie", photo);
|
|
564
|
+
const response = await this.client.upload({
|
|
565
|
+
url: "/face-auth/enroll",
|
|
566
|
+
jwt,
|
|
567
|
+
data: formData
|
|
568
|
+
});
|
|
569
|
+
return response;
|
|
570
|
+
}
|
|
522
571
|
//medical
|
|
523
572
|
async createMedicalProfile(userId, data, jwt) {
|
|
524
573
|
await this.client.post({
|
|
@@ -1786,6 +1835,7 @@ var AccessService = class {
|
|
|
1786
1835
|
this.client = client;
|
|
1787
1836
|
this.checkIn = this.checkIn.bind(this);
|
|
1788
1837
|
this.checkInManual = this.checkInManual.bind(this);
|
|
1838
|
+
this.checkInFace = this.checkInFace.bind(this);
|
|
1789
1839
|
this.getClientAttendanceHistory = this.getClientAttendanceHistory.bind(this);
|
|
1790
1840
|
this.getClientServiceUsage = this.getClientServiceUsage.bind(this);
|
|
1791
1841
|
this.getClassAttendanceHistory = this.getClassAttendanceHistory.bind(this);
|
|
@@ -1806,6 +1856,17 @@ var AccessService = class {
|
|
|
1806
1856
|
});
|
|
1807
1857
|
return response;
|
|
1808
1858
|
}
|
|
1859
|
+
async checkInFace(jwt, branchId, photo) {
|
|
1860
|
+
const formData = new FormData();
|
|
1861
|
+
formData.append("branch_id", branchId);
|
|
1862
|
+
formData.append("checkin_photo", photo);
|
|
1863
|
+
const response = await this.client.upload({
|
|
1864
|
+
url: "/access/check-in/face",
|
|
1865
|
+
jwt,
|
|
1866
|
+
data: formData
|
|
1867
|
+
});
|
|
1868
|
+
return response;
|
|
1869
|
+
}
|
|
1809
1870
|
async getClientAttendanceHistory(jwt, userId, start, end, { page = 1, limit = 10, sort = "desc" } = {}) {
|
|
1810
1871
|
const response = await this.client.get({
|
|
1811
1872
|
url: `/clients/${userId}/attendance-history`,
|
|
@@ -1896,6 +1957,7 @@ var ReportService = class {
|
|
|
1896
1957
|
this.financialSummary = this.financialSummary.bind(this);
|
|
1897
1958
|
this.salesByDemography = this.salesByDemography.bind(this);
|
|
1898
1959
|
this.churnRateKPI = this.churnRateKPI.bind(this);
|
|
1960
|
+
this.rfmAnalysis = this.rfmAnalysis.bind(this);
|
|
1899
1961
|
}
|
|
1900
1962
|
async mostUsedServices(jwt, start, end) {
|
|
1901
1963
|
const response = await this.client.get({
|
|
@@ -2254,6 +2316,14 @@ var ReportService = class {
|
|
|
2254
2316
|
});
|
|
2255
2317
|
return response;
|
|
2256
2318
|
}
|
|
2319
|
+
async rfmAnalysis(jwt, branchId) {
|
|
2320
|
+
const response = await this.client.get({
|
|
2321
|
+
url: "/reports/analysis/rfm",
|
|
2322
|
+
jwt,
|
|
2323
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
2324
|
+
});
|
|
2325
|
+
return response;
|
|
2326
|
+
}
|
|
2257
2327
|
};
|
|
2258
2328
|
|
|
2259
2329
|
// src/services/staff.ts
|
|
@@ -2762,7 +2832,7 @@ var VitalFit = class _VitalFit {
|
|
|
2762
2832
|
return _VitalFit.instance;
|
|
2763
2833
|
}
|
|
2764
2834
|
version() {
|
|
2765
|
-
return "0.
|
|
2835
|
+
return "0.4.1";
|
|
2766
2836
|
}
|
|
2767
2837
|
};
|
|
2768
2838
|
export {
|