@vitalfit/sdk 0.0.70 → 0.0.71
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 +120 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +96 -3
- package/dist/index.d.ts +96 -3
- package/dist/index.js +120 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -70,13 +70,14 @@ type SignUpRequest = {
|
|
|
70
70
|
profile_picture_url?: string | null;
|
|
71
71
|
role_name?: string | null;
|
|
72
72
|
};
|
|
73
|
+
type Oauth = {
|
|
74
|
+
session_token: string;
|
|
75
|
+
};
|
|
73
76
|
|
|
74
77
|
type ClientProfile = {
|
|
75
78
|
user_id: string;
|
|
76
79
|
qr_code: string;
|
|
77
80
|
scoring: number;
|
|
78
|
-
status: string;
|
|
79
|
-
block_justification: string;
|
|
80
81
|
category: string;
|
|
81
82
|
created_at: string;
|
|
82
83
|
updated_at: string;
|
|
@@ -89,6 +90,15 @@ type Role = {
|
|
|
89
90
|
created_at: string;
|
|
90
91
|
updated_at: string;
|
|
91
92
|
};
|
|
93
|
+
type ClientMembership = {
|
|
94
|
+
client_membership_id: string;
|
|
95
|
+
user_id: string;
|
|
96
|
+
membership_type_id: string;
|
|
97
|
+
start_date: string;
|
|
98
|
+
end_date: string;
|
|
99
|
+
status: string;
|
|
100
|
+
invoice_id: string;
|
|
101
|
+
};
|
|
92
102
|
type User = {
|
|
93
103
|
user_id: string;
|
|
94
104
|
first_name: string;
|
|
@@ -98,11 +108,14 @@ type User = {
|
|
|
98
108
|
identity_document: string;
|
|
99
109
|
birth_date: string;
|
|
100
110
|
gender: string;
|
|
111
|
+
status: string;
|
|
112
|
+
block_justification: string;
|
|
101
113
|
profile_picture_url: string;
|
|
102
114
|
is_validated: boolean;
|
|
103
115
|
ClientProfile: ClientProfile;
|
|
104
116
|
role_id: string;
|
|
105
117
|
role: Role;
|
|
118
|
+
client_membership?: ClientMembership;
|
|
106
119
|
created_at: string;
|
|
107
120
|
updated_at: string;
|
|
108
121
|
deleted_at: string | null;
|
|
@@ -143,6 +156,9 @@ type UserPaginationOptions = {
|
|
|
143
156
|
search?: string;
|
|
144
157
|
role?: string;
|
|
145
158
|
};
|
|
159
|
+
type QrToken = {
|
|
160
|
+
token: string;
|
|
161
|
+
};
|
|
146
162
|
|
|
147
163
|
type PaginatedBranch = {
|
|
148
164
|
branch_id: string;
|
|
@@ -417,6 +433,42 @@ type PublicMembershipResponse = {
|
|
|
417
433
|
ref_currency: string;
|
|
418
434
|
is_active: boolean;
|
|
419
435
|
};
|
|
436
|
+
type ClientMembershipUser = {
|
|
437
|
+
user_id: string;
|
|
438
|
+
first_name: string;
|
|
439
|
+
last_name: string;
|
|
440
|
+
email: string;
|
|
441
|
+
};
|
|
442
|
+
type MembershipTypeDetail = MembershipType & {
|
|
443
|
+
created_at: string;
|
|
444
|
+
updated_at: string;
|
|
445
|
+
};
|
|
446
|
+
type ClientMembershipItem = {
|
|
447
|
+
client_membership_id: string;
|
|
448
|
+
user_id: string;
|
|
449
|
+
membership_type_id: string;
|
|
450
|
+
start_date: string;
|
|
451
|
+
end_date: string;
|
|
452
|
+
status: string;
|
|
453
|
+
invoice_id: string;
|
|
454
|
+
cancellation_reason_id?: string;
|
|
455
|
+
cancellation_notes?: string;
|
|
456
|
+
user: ClientMembershipUser;
|
|
457
|
+
membership_type: MembershipTypeDetail;
|
|
458
|
+
};
|
|
459
|
+
type CancellationReason = {
|
|
460
|
+
reason_id: string;
|
|
461
|
+
description: string;
|
|
462
|
+
is_active: boolean;
|
|
463
|
+
};
|
|
464
|
+
type ClientMembershipDetail = ClientMembershipItem & {
|
|
465
|
+
cancellation_reason?: CancellationReason;
|
|
466
|
+
};
|
|
467
|
+
type UpdateClientMembershipRequest = {
|
|
468
|
+
status?: string;
|
|
469
|
+
cancel_notes?: string;
|
|
470
|
+
cancel_reason_id?: string;
|
|
471
|
+
};
|
|
420
472
|
|
|
421
473
|
type BranchInfo = {
|
|
422
474
|
address: string;
|
|
@@ -677,6 +729,13 @@ declare const mainCurrencies: {
|
|
|
677
729
|
name: string;
|
|
678
730
|
symbol: string;
|
|
679
731
|
}[];
|
|
732
|
+
type ClientInvoice = {
|
|
733
|
+
invoice_id: string;
|
|
734
|
+
branch_id: string;
|
|
735
|
+
issue_date: string;
|
|
736
|
+
total_amount: string;
|
|
737
|
+
status: string;
|
|
738
|
+
};
|
|
680
739
|
|
|
681
740
|
type ClientBookingResponse = {
|
|
682
741
|
booking_id: string;
|
|
@@ -783,6 +842,17 @@ type PaymentDetail = {
|
|
|
783
842
|
receipt_url: string;
|
|
784
843
|
};
|
|
785
844
|
|
|
845
|
+
type CheckIn = {
|
|
846
|
+
branch_id: string;
|
|
847
|
+
qr_jwt: string;
|
|
848
|
+
};
|
|
849
|
+
type CheckInResponse = {
|
|
850
|
+
access_type: string;
|
|
851
|
+
check_in_time: string;
|
|
852
|
+
message: string;
|
|
853
|
+
service_name: string;
|
|
854
|
+
};
|
|
855
|
+
|
|
786
856
|
declare class AuthService {
|
|
787
857
|
private client;
|
|
788
858
|
constructor(client: Client);
|
|
@@ -796,6 +866,7 @@ declare class AuthService {
|
|
|
796
866
|
validateResetToken(token: string): Promise<void>;
|
|
797
867
|
verifyEmail(otp: string): Promise<void>;
|
|
798
868
|
verifyStaff(token: string, password: string, repeatPassword: string): Promise<void>;
|
|
869
|
+
oAuthLogin(data: Oauth): Promise<void>;
|
|
799
870
|
}
|
|
800
871
|
|
|
801
872
|
declare class UserService {
|
|
@@ -810,6 +881,7 @@ declare class UserService {
|
|
|
810
881
|
updateUserStaff(userId: string, data: UpdateUserStaffRequest, jwt: string): Promise<void>;
|
|
811
882
|
deleteUser(userId: string, jwt: string): Promise<void>;
|
|
812
883
|
getUserByEmail(email: string, jwt: string): Promise<DataResponse<User>>;
|
|
884
|
+
QrToken(jwt: string): Promise<QrToken>;
|
|
813
885
|
}
|
|
814
886
|
|
|
815
887
|
declare class BranchService {
|
|
@@ -887,6 +959,9 @@ declare class MembershipService {
|
|
|
887
959
|
updateMembershipType(membershipTypeId: string, data: UpdateMembershipType, jwt: string): Promise<void>;
|
|
888
960
|
deleteMembershipType(membershipTypeId: string, jwt: string): Promise<void>;
|
|
889
961
|
publicGetMemberships(jwt: string, { page, limit, sort, search }: PaginationRequest, currency: string): Promise<PaginatedTotal<PublicMembershipResponse[]>>;
|
|
962
|
+
getClientMemberships(jwt: string, { page, limit, sort, search }: PaginationRequest): Promise<PaginatedTotal<ClientMembershipItem>>;
|
|
963
|
+
getClientMembershipByID(membershipId: string, jwt: string): Promise<DataResponse<ClientMembershipDetail>>;
|
|
964
|
+
updateClientMembership(membershipId: string, data: UpdateClientMembershipRequest, jwt: string): Promise<void>;
|
|
890
965
|
}
|
|
891
966
|
|
|
892
967
|
declare class PublicService {
|
|
@@ -958,6 +1033,22 @@ declare class BillingService {
|
|
|
958
1033
|
AddPaymentToInvoice(data: AddPaymentToInvoicePayload, jwt: string): Promise<AddPaymentToInvoiceResponse>;
|
|
959
1034
|
getPaymentByID(paymentId: string, jwt: string): Promise<DataResponse<PaymentDetail>>;
|
|
960
1035
|
updatePaymentStatus(paymentId: string, status: string, jwt: string): Promise<void>;
|
|
1036
|
+
getClientInvoices(jwt: string, { page, limit, sort, search }: PaginationRequest, userID?: string): Promise<PaginatedTotal<ClientInvoice>>;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
declare class BookingService {
|
|
1040
|
+
private client;
|
|
1041
|
+
constructor(client: Client);
|
|
1042
|
+
bookClass(data: BookClassRequest, classID: string, jwt: string): Promise<void>;
|
|
1043
|
+
cancelBooking(bookingId: string, jwt: string): Promise<void>;
|
|
1044
|
+
getClientBooking(userID: string, jwt: string): Promise<DataResponse<ClientBookingResponse[]>>;
|
|
1045
|
+
getClientBranchBooking(branchID: string, userID: string, jwt: string): Promise<DataResponse<BranchScheduleResponse[]>>;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
declare class AccessService {
|
|
1049
|
+
private client;
|
|
1050
|
+
constructor(client: Client);
|
|
1051
|
+
checkIn(jwt: string, data: CheckIn): Promise<CheckInResponse>;
|
|
961
1052
|
}
|
|
962
1053
|
|
|
963
1054
|
declare class APIError extends Error {
|
|
@@ -984,9 +1075,11 @@ declare class VitalFit {
|
|
|
984
1075
|
schedule: ScheduleService;
|
|
985
1076
|
packages: PackagesService;
|
|
986
1077
|
billing: BillingService;
|
|
1078
|
+
booking: BookingService;
|
|
1079
|
+
access: AccessService;
|
|
987
1080
|
constructor(isDevMode: boolean, origin?: string);
|
|
988
1081
|
static getInstance(isDevMode?: boolean): VitalFit;
|
|
989
1082
|
version(): string;
|
|
990
1083
|
}
|
|
991
1084
|
|
|
992
|
-
export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type BankTransferConfig, type Banner, type BannerResponse, type BaseModel, type BookClassRequest, type BranchClassInfo, type BranchDetails, type BranchEquipmentInventory, type BranchInfo, type BranchInstructorInfo, type BranchPaymentMethod, type BranchPaymentMethodInfo, type BranchPaymentVisibility, type BranchScheduleResponse, type BranchServicePrice, type BranchStatusCount, type ClientBookingResponse, type ClientProfile, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateClassPayload, type CreateEquipment, type CreateInvoiceItem, type CreateInvoicePayload, type CreateInvoiceResponse, type CreateMembershipType, type CreatePackagePayload, type CreatePaymentMethod, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type EquipmentInfo, type EquipmentStatus, type GetUserResponse, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoicePaymentDetail, type LoginRequest, type LoginResponse, type MembershipType, type MembershipsSummary, 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 PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type PublicMembershipResponse, type PublicPaginatedPackage, type PublicPaginationService, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type ServicePublicItem, type ServicesSummary, type SignUpRequest, type Specialty, type UUIDModel, type UpdateBanner, type UpdateBranchEquipmentDetails, type UpdateBranchPaymentMethod, type UpdateBranchRequest, type UpdateBranchServicePrice, type UpdateClassPayload, type UpdateEquipment, type UpdateMembershipType, type UpdateOperatingHour, type UpdatePackagePayload, type UpdateServiceImageManual, type UpdateServiceManual, type UpdateUserRequest, type UpdateUserStaffRequest, type User, type UserApiResponse, UserGender, type UserPaginationOptions, VitalFit, type ZelleConfig, isAPIError, mainCurrencies };
|
|
1085
|
+
export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type BankTransferConfig, type Banner, type BannerResponse, type BaseModel, type BookClassRequest, type BranchClassInfo, type BranchDetails, type BranchEquipmentInventory, type BranchInfo, type BranchInstructorInfo, type BranchPaymentMethod, type BranchPaymentMethodInfo, type BranchPaymentVisibility, type BranchScheduleResponse, type BranchServicePrice, type BranchStatusCount, type CancellationReason, type CheckIn, type CheckInResponse, type ClientBookingResponse, type ClientInvoice, type ClientMembership, type ClientMembershipDetail, type ClientMembershipItem, type ClientMembershipUser, type ClientProfile, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateClassPayload, type CreateEquipment, type CreateInvoiceItem, type CreateInvoicePayload, type CreateInvoiceResponse, type CreateMembershipType, type CreatePackagePayload, type CreatePaymentMethod, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type EquipmentInfo, type EquipmentStatus, type GetUserResponse, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoicePaymentDetail, type LoginRequest, type LoginResponse, type MembershipType, type MembershipTypeDetail, type MembershipsSummary, 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 PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type PublicMembershipResponse, type PublicPaginatedPackage, type PublicPaginationService, type QrToken, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type ServicePublicItem, type ServicesSummary, type SignUpRequest, type Specialty, type UUIDModel, 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, VitalFit, type ZelleConfig, isAPIError, mainCurrencies };
|
package/dist/index.d.ts
CHANGED
|
@@ -70,13 +70,14 @@ type SignUpRequest = {
|
|
|
70
70
|
profile_picture_url?: string | null;
|
|
71
71
|
role_name?: string | null;
|
|
72
72
|
};
|
|
73
|
+
type Oauth = {
|
|
74
|
+
session_token: string;
|
|
75
|
+
};
|
|
73
76
|
|
|
74
77
|
type ClientProfile = {
|
|
75
78
|
user_id: string;
|
|
76
79
|
qr_code: string;
|
|
77
80
|
scoring: number;
|
|
78
|
-
status: string;
|
|
79
|
-
block_justification: string;
|
|
80
81
|
category: string;
|
|
81
82
|
created_at: string;
|
|
82
83
|
updated_at: string;
|
|
@@ -89,6 +90,15 @@ type Role = {
|
|
|
89
90
|
created_at: string;
|
|
90
91
|
updated_at: string;
|
|
91
92
|
};
|
|
93
|
+
type ClientMembership = {
|
|
94
|
+
client_membership_id: string;
|
|
95
|
+
user_id: string;
|
|
96
|
+
membership_type_id: string;
|
|
97
|
+
start_date: string;
|
|
98
|
+
end_date: string;
|
|
99
|
+
status: string;
|
|
100
|
+
invoice_id: string;
|
|
101
|
+
};
|
|
92
102
|
type User = {
|
|
93
103
|
user_id: string;
|
|
94
104
|
first_name: string;
|
|
@@ -98,11 +108,14 @@ type User = {
|
|
|
98
108
|
identity_document: string;
|
|
99
109
|
birth_date: string;
|
|
100
110
|
gender: string;
|
|
111
|
+
status: string;
|
|
112
|
+
block_justification: string;
|
|
101
113
|
profile_picture_url: string;
|
|
102
114
|
is_validated: boolean;
|
|
103
115
|
ClientProfile: ClientProfile;
|
|
104
116
|
role_id: string;
|
|
105
117
|
role: Role;
|
|
118
|
+
client_membership?: ClientMembership;
|
|
106
119
|
created_at: string;
|
|
107
120
|
updated_at: string;
|
|
108
121
|
deleted_at: string | null;
|
|
@@ -143,6 +156,9 @@ type UserPaginationOptions = {
|
|
|
143
156
|
search?: string;
|
|
144
157
|
role?: string;
|
|
145
158
|
};
|
|
159
|
+
type QrToken = {
|
|
160
|
+
token: string;
|
|
161
|
+
};
|
|
146
162
|
|
|
147
163
|
type PaginatedBranch = {
|
|
148
164
|
branch_id: string;
|
|
@@ -417,6 +433,42 @@ type PublicMembershipResponse = {
|
|
|
417
433
|
ref_currency: string;
|
|
418
434
|
is_active: boolean;
|
|
419
435
|
};
|
|
436
|
+
type ClientMembershipUser = {
|
|
437
|
+
user_id: string;
|
|
438
|
+
first_name: string;
|
|
439
|
+
last_name: string;
|
|
440
|
+
email: string;
|
|
441
|
+
};
|
|
442
|
+
type MembershipTypeDetail = MembershipType & {
|
|
443
|
+
created_at: string;
|
|
444
|
+
updated_at: string;
|
|
445
|
+
};
|
|
446
|
+
type ClientMembershipItem = {
|
|
447
|
+
client_membership_id: string;
|
|
448
|
+
user_id: string;
|
|
449
|
+
membership_type_id: string;
|
|
450
|
+
start_date: string;
|
|
451
|
+
end_date: string;
|
|
452
|
+
status: string;
|
|
453
|
+
invoice_id: string;
|
|
454
|
+
cancellation_reason_id?: string;
|
|
455
|
+
cancellation_notes?: string;
|
|
456
|
+
user: ClientMembershipUser;
|
|
457
|
+
membership_type: MembershipTypeDetail;
|
|
458
|
+
};
|
|
459
|
+
type CancellationReason = {
|
|
460
|
+
reason_id: string;
|
|
461
|
+
description: string;
|
|
462
|
+
is_active: boolean;
|
|
463
|
+
};
|
|
464
|
+
type ClientMembershipDetail = ClientMembershipItem & {
|
|
465
|
+
cancellation_reason?: CancellationReason;
|
|
466
|
+
};
|
|
467
|
+
type UpdateClientMembershipRequest = {
|
|
468
|
+
status?: string;
|
|
469
|
+
cancel_notes?: string;
|
|
470
|
+
cancel_reason_id?: string;
|
|
471
|
+
};
|
|
420
472
|
|
|
421
473
|
type BranchInfo = {
|
|
422
474
|
address: string;
|
|
@@ -677,6 +729,13 @@ declare const mainCurrencies: {
|
|
|
677
729
|
name: string;
|
|
678
730
|
symbol: string;
|
|
679
731
|
}[];
|
|
732
|
+
type ClientInvoice = {
|
|
733
|
+
invoice_id: string;
|
|
734
|
+
branch_id: string;
|
|
735
|
+
issue_date: string;
|
|
736
|
+
total_amount: string;
|
|
737
|
+
status: string;
|
|
738
|
+
};
|
|
680
739
|
|
|
681
740
|
type ClientBookingResponse = {
|
|
682
741
|
booking_id: string;
|
|
@@ -783,6 +842,17 @@ type PaymentDetail = {
|
|
|
783
842
|
receipt_url: string;
|
|
784
843
|
};
|
|
785
844
|
|
|
845
|
+
type CheckIn = {
|
|
846
|
+
branch_id: string;
|
|
847
|
+
qr_jwt: string;
|
|
848
|
+
};
|
|
849
|
+
type CheckInResponse = {
|
|
850
|
+
access_type: string;
|
|
851
|
+
check_in_time: string;
|
|
852
|
+
message: string;
|
|
853
|
+
service_name: string;
|
|
854
|
+
};
|
|
855
|
+
|
|
786
856
|
declare class AuthService {
|
|
787
857
|
private client;
|
|
788
858
|
constructor(client: Client);
|
|
@@ -796,6 +866,7 @@ declare class AuthService {
|
|
|
796
866
|
validateResetToken(token: string): Promise<void>;
|
|
797
867
|
verifyEmail(otp: string): Promise<void>;
|
|
798
868
|
verifyStaff(token: string, password: string, repeatPassword: string): Promise<void>;
|
|
869
|
+
oAuthLogin(data: Oauth): Promise<void>;
|
|
799
870
|
}
|
|
800
871
|
|
|
801
872
|
declare class UserService {
|
|
@@ -810,6 +881,7 @@ declare class UserService {
|
|
|
810
881
|
updateUserStaff(userId: string, data: UpdateUserStaffRequest, jwt: string): Promise<void>;
|
|
811
882
|
deleteUser(userId: string, jwt: string): Promise<void>;
|
|
812
883
|
getUserByEmail(email: string, jwt: string): Promise<DataResponse<User>>;
|
|
884
|
+
QrToken(jwt: string): Promise<QrToken>;
|
|
813
885
|
}
|
|
814
886
|
|
|
815
887
|
declare class BranchService {
|
|
@@ -887,6 +959,9 @@ declare class MembershipService {
|
|
|
887
959
|
updateMembershipType(membershipTypeId: string, data: UpdateMembershipType, jwt: string): Promise<void>;
|
|
888
960
|
deleteMembershipType(membershipTypeId: string, jwt: string): Promise<void>;
|
|
889
961
|
publicGetMemberships(jwt: string, { page, limit, sort, search }: PaginationRequest, currency: string): Promise<PaginatedTotal<PublicMembershipResponse[]>>;
|
|
962
|
+
getClientMemberships(jwt: string, { page, limit, sort, search }: PaginationRequest): Promise<PaginatedTotal<ClientMembershipItem>>;
|
|
963
|
+
getClientMembershipByID(membershipId: string, jwt: string): Promise<DataResponse<ClientMembershipDetail>>;
|
|
964
|
+
updateClientMembership(membershipId: string, data: UpdateClientMembershipRequest, jwt: string): Promise<void>;
|
|
890
965
|
}
|
|
891
966
|
|
|
892
967
|
declare class PublicService {
|
|
@@ -958,6 +1033,22 @@ declare class BillingService {
|
|
|
958
1033
|
AddPaymentToInvoice(data: AddPaymentToInvoicePayload, jwt: string): Promise<AddPaymentToInvoiceResponse>;
|
|
959
1034
|
getPaymentByID(paymentId: string, jwt: string): Promise<DataResponse<PaymentDetail>>;
|
|
960
1035
|
updatePaymentStatus(paymentId: string, status: string, jwt: string): Promise<void>;
|
|
1036
|
+
getClientInvoices(jwt: string, { page, limit, sort, search }: PaginationRequest, userID?: string): Promise<PaginatedTotal<ClientInvoice>>;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
declare class BookingService {
|
|
1040
|
+
private client;
|
|
1041
|
+
constructor(client: Client);
|
|
1042
|
+
bookClass(data: BookClassRequest, classID: string, jwt: string): Promise<void>;
|
|
1043
|
+
cancelBooking(bookingId: string, jwt: string): Promise<void>;
|
|
1044
|
+
getClientBooking(userID: string, jwt: string): Promise<DataResponse<ClientBookingResponse[]>>;
|
|
1045
|
+
getClientBranchBooking(branchID: string, userID: string, jwt: string): Promise<DataResponse<BranchScheduleResponse[]>>;
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
declare class AccessService {
|
|
1049
|
+
private client;
|
|
1050
|
+
constructor(client: Client);
|
|
1051
|
+
checkIn(jwt: string, data: CheckIn): Promise<CheckInResponse>;
|
|
961
1052
|
}
|
|
962
1053
|
|
|
963
1054
|
declare class APIError extends Error {
|
|
@@ -984,9 +1075,11 @@ declare class VitalFit {
|
|
|
984
1075
|
schedule: ScheduleService;
|
|
985
1076
|
packages: PackagesService;
|
|
986
1077
|
billing: BillingService;
|
|
1078
|
+
booking: BookingService;
|
|
1079
|
+
access: AccessService;
|
|
987
1080
|
constructor(isDevMode: boolean, origin?: string);
|
|
988
1081
|
static getInstance(isDevMode?: boolean): VitalFit;
|
|
989
1082
|
version(): string;
|
|
990
1083
|
}
|
|
991
1084
|
|
|
992
|
-
export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type BankTransferConfig, type Banner, type BannerResponse, type BaseModel, type BookClassRequest, type BranchClassInfo, type BranchDetails, type BranchEquipmentInventory, type BranchInfo, type BranchInstructorInfo, type BranchPaymentMethod, type BranchPaymentMethodInfo, type BranchPaymentVisibility, type BranchScheduleResponse, type BranchServicePrice, type BranchStatusCount, type ClientBookingResponse, type ClientProfile, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateClassPayload, type CreateEquipment, type CreateInvoiceItem, type CreateInvoicePayload, type CreateInvoiceResponse, type CreateMembershipType, type CreatePackagePayload, type CreatePaymentMethod, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type EquipmentInfo, type EquipmentStatus, type GetUserResponse, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoicePaymentDetail, type LoginRequest, type LoginResponse, type MembershipType, type MembershipsSummary, 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 PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type PublicMembershipResponse, type PublicPaginatedPackage, type PublicPaginationService, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type ServicePublicItem, type ServicesSummary, type SignUpRequest, type Specialty, type UUIDModel, type UpdateBanner, type UpdateBranchEquipmentDetails, type UpdateBranchPaymentMethod, type UpdateBranchRequest, type UpdateBranchServicePrice, type UpdateClassPayload, type UpdateEquipment, type UpdateMembershipType, type UpdateOperatingHour, type UpdatePackagePayload, type UpdateServiceImageManual, type UpdateServiceManual, type UpdateUserRequest, type UpdateUserStaffRequest, type User, type UserApiResponse, UserGender, type UserPaginationOptions, VitalFit, type ZelleConfig, isAPIError, mainCurrencies };
|
|
1085
|
+
export { APIError, type AddPaymentToInvoicePayload, type AddPaymentToInvoiceResponse, type BankTransferConfig, type Banner, type BannerResponse, type BaseModel, type BookClassRequest, type BranchClassInfo, type BranchDetails, type BranchEquipmentInventory, type BranchInfo, type BranchInstructorInfo, type BranchPaymentMethod, type BranchPaymentMethodInfo, type BranchPaymentVisibility, type BranchScheduleResponse, type BranchServicePrice, type BranchStatusCount, type CancellationReason, type CheckIn, type CheckInResponse, type ClientBookingResponse, type ClientInvoice, type ClientMembership, type ClientMembershipDetail, type ClientMembershipItem, type ClientMembershipUser, type ClientProfile, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateClassPayload, type CreateEquipment, type CreateInvoiceItem, type CreateInvoicePayload, type CreateInvoiceResponse, type CreateMembershipType, type CreatePackagePayload, type CreatePaymentMethod, type CreateRole, type CreateService, type CreateServiceImage, type DataResponse, type Equipment, type EquipmentCategory, type EquipmentInfo, type EquipmentStatus, type GetUserResponse, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoicePaymentDetail, type LoginRequest, type LoginResponse, type MembershipType, type MembershipTypeDetail, type MembershipsSummary, 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 PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type PublicMembershipResponse, type PublicPaginatedPackage, type PublicPaginationService, type QrToken, type Role, type RoleResponse, type ServiceCategoryInfo, type ServiceFullDetail, type ServiceImageResponse, type ServicePublicItem, type ServicesSummary, type SignUpRequest, type Specialty, type UUIDModel, 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, VitalFit, type ZelleConfig, isAPIError, mainCurrencies };
|
package/dist/index.js
CHANGED
|
@@ -124,6 +124,7 @@ var AuthService = class {
|
|
|
124
124
|
this.validateResetToken = this.validateResetToken.bind(this);
|
|
125
125
|
this.verifyEmail = this.verifyEmail.bind(this);
|
|
126
126
|
this.verifyStaff = this.verifyStaff.bind(this);
|
|
127
|
+
this.oAuthLogin = this.oAuthLogin.bind(this);
|
|
127
128
|
this.logout = this.logout.bind(this);
|
|
128
129
|
this.saveJWT = this.saveJWT.bind(this);
|
|
129
130
|
}
|
|
@@ -208,6 +209,12 @@ var AuthService = class {
|
|
|
208
209
|
}
|
|
209
210
|
});
|
|
210
211
|
}
|
|
212
|
+
async oAuthLogin(data) {
|
|
213
|
+
await this.client.post({
|
|
214
|
+
url: "/auth/oauth-login",
|
|
215
|
+
data
|
|
216
|
+
});
|
|
217
|
+
}
|
|
211
218
|
};
|
|
212
219
|
|
|
213
220
|
// src/services/user.ts
|
|
@@ -220,6 +227,7 @@ var UserService = class {
|
|
|
220
227
|
this.getClientUsers = this.getClientUsers.bind(this);
|
|
221
228
|
this.getStaffUsers = this.getStaffUsers.bind(this);
|
|
222
229
|
this.getUserByEmail = this.getUserByEmail.bind(this);
|
|
230
|
+
this.QrToken = this.QrToken.bind(this);
|
|
223
231
|
this.GetUserByID = this.GetUserByID.bind(this);
|
|
224
232
|
this.updateUserClient = this.updateUserClient.bind(this);
|
|
225
233
|
this.updateUserStaff = this.updateUserStaff.bind(this);
|
|
@@ -295,6 +303,13 @@ var UserService = class {
|
|
|
295
303
|
});
|
|
296
304
|
return response;
|
|
297
305
|
}
|
|
306
|
+
async QrToken(jwt) {
|
|
307
|
+
const response = await this.client.get({
|
|
308
|
+
url: `/user/qr-token`,
|
|
309
|
+
jwt
|
|
310
|
+
});
|
|
311
|
+
return response;
|
|
312
|
+
}
|
|
298
313
|
};
|
|
299
314
|
|
|
300
315
|
// src/services/branch.ts
|
|
@@ -691,6 +706,9 @@ var MembershipService = class {
|
|
|
691
706
|
this.updateMembershipType = this.updateMembershipType.bind(this);
|
|
692
707
|
this.deleteMembershipType = this.deleteMembershipType.bind(this);
|
|
693
708
|
this.publicGetMemberships = this.publicGetMemberships.bind(this);
|
|
709
|
+
this.getClientMemberships = this.getClientMemberships.bind(this);
|
|
710
|
+
this.getClientMembershipByID = this.getClientMembershipByID.bind(this);
|
|
711
|
+
this.updateClientMembership = this.updateClientMembership.bind(this);
|
|
694
712
|
}
|
|
695
713
|
async createMembershipType(data, jwt) {
|
|
696
714
|
await this.client.post({
|
|
@@ -753,6 +771,33 @@ var MembershipService = class {
|
|
|
753
771
|
});
|
|
754
772
|
return response;
|
|
755
773
|
}
|
|
774
|
+
async getClientMemberships(jwt, { page = 10, limit = 10, sort = "desc", search }) {
|
|
775
|
+
const response = await this.client.get({
|
|
776
|
+
url: "/client-memberships",
|
|
777
|
+
jwt,
|
|
778
|
+
params: {
|
|
779
|
+
page,
|
|
780
|
+
limit,
|
|
781
|
+
sort,
|
|
782
|
+
search
|
|
783
|
+
}
|
|
784
|
+
});
|
|
785
|
+
return response;
|
|
786
|
+
}
|
|
787
|
+
async getClientMembershipByID(membershipId, jwt) {
|
|
788
|
+
const response = await this.client.get({
|
|
789
|
+
url: `/client-memberships/${membershipId}`,
|
|
790
|
+
jwt
|
|
791
|
+
});
|
|
792
|
+
return response;
|
|
793
|
+
}
|
|
794
|
+
async updateClientMembership(membershipId, data, jwt) {
|
|
795
|
+
await this.client.put({
|
|
796
|
+
url: `/client-memberships/${membershipId}`,
|
|
797
|
+
jwt,
|
|
798
|
+
data
|
|
799
|
+
});
|
|
800
|
+
}
|
|
756
801
|
};
|
|
757
802
|
|
|
758
803
|
// src/services/public.ts
|
|
@@ -1165,6 +1210,7 @@ var BillingService = class {
|
|
|
1165
1210
|
this.getInvoiceByID = this.getInvoiceByID.bind(this);
|
|
1166
1211
|
this.getPaymentByID = this.getPaymentByID.bind(this);
|
|
1167
1212
|
this.updatePaymentStatus = this.updatePaymentStatus.bind(this);
|
|
1213
|
+
this.getClientInvoices = this.getClientInvoices.bind(this);
|
|
1168
1214
|
}
|
|
1169
1215
|
async createInvoice(data, jwt) {
|
|
1170
1216
|
const response = await this.client.post({
|
|
@@ -1205,6 +1251,75 @@ var BillingService = class {
|
|
|
1205
1251
|
}
|
|
1206
1252
|
});
|
|
1207
1253
|
}
|
|
1254
|
+
async getClientInvoices(jwt, { page = 1, limit = 10, sort = "desc", search }, userID) {
|
|
1255
|
+
const response = await this.client.get({
|
|
1256
|
+
url: `/billing/invoices/client/${userID}`,
|
|
1257
|
+
jwt,
|
|
1258
|
+
params: {
|
|
1259
|
+
page,
|
|
1260
|
+
limit,
|
|
1261
|
+
sort,
|
|
1262
|
+
search
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
return response;
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1268
|
+
|
|
1269
|
+
// src/services/booking.ts
|
|
1270
|
+
var BookingService = class {
|
|
1271
|
+
client;
|
|
1272
|
+
constructor(client) {
|
|
1273
|
+
this.client = client;
|
|
1274
|
+
this.bookClass = this.bookClass.bind(this);
|
|
1275
|
+
this.cancelBooking = this.cancelBooking.bind(this);
|
|
1276
|
+
this.getClientBooking = this.getClientBooking.bind(this);
|
|
1277
|
+
this.getClientBranchBooking = this.getClientBranchBooking.bind(this);
|
|
1278
|
+
}
|
|
1279
|
+
async bookClass(data, classID, jwt) {
|
|
1280
|
+
await this.client.post({
|
|
1281
|
+
url: `/bookings/${classID}/book`,
|
|
1282
|
+
jwt,
|
|
1283
|
+
data
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
async cancelBooking(bookingId, jwt) {
|
|
1287
|
+
await this.client.delete({
|
|
1288
|
+
url: `/booking/${bookingId}/cancel`,
|
|
1289
|
+
jwt
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1292
|
+
async getClientBooking(userID, jwt) {
|
|
1293
|
+
const response = await this.client.get({
|
|
1294
|
+
url: `/bookings/client/${userID}`,
|
|
1295
|
+
jwt
|
|
1296
|
+
});
|
|
1297
|
+
return response;
|
|
1298
|
+
}
|
|
1299
|
+
async getClientBranchBooking(branchID, userID, jwt) {
|
|
1300
|
+
const response = await this.client.get({
|
|
1301
|
+
url: `/schedule/branch/${branchID}/client/${userID}`,
|
|
1302
|
+
jwt
|
|
1303
|
+
});
|
|
1304
|
+
return response;
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
|
|
1308
|
+
// src/services/access.ts
|
|
1309
|
+
var AccessService = class {
|
|
1310
|
+
client;
|
|
1311
|
+
constructor(client) {
|
|
1312
|
+
this.client = client;
|
|
1313
|
+
this.checkIn = this.checkIn.bind(this);
|
|
1314
|
+
}
|
|
1315
|
+
async checkIn(jwt, data) {
|
|
1316
|
+
const response = await this.client.post({
|
|
1317
|
+
url: "/access/check-in",
|
|
1318
|
+
jwt,
|
|
1319
|
+
data
|
|
1320
|
+
});
|
|
1321
|
+
return response;
|
|
1322
|
+
}
|
|
1208
1323
|
};
|
|
1209
1324
|
|
|
1210
1325
|
// src/types/auth.ts
|
|
@@ -1325,6 +1440,8 @@ var VitalFit = class _VitalFit {
|
|
|
1325
1440
|
schedule;
|
|
1326
1441
|
packages;
|
|
1327
1442
|
billing;
|
|
1443
|
+
booking;
|
|
1444
|
+
access;
|
|
1328
1445
|
constructor(isDevMode, origin) {
|
|
1329
1446
|
this.client = new Client(isDevMode, origin);
|
|
1330
1447
|
this.auth = new AuthService(this.client);
|
|
@@ -1341,6 +1458,8 @@ var VitalFit = class _VitalFit {
|
|
|
1341
1458
|
this.schedule = new ScheduleService(this.client);
|
|
1342
1459
|
this.packages = new PackagesService(this.client);
|
|
1343
1460
|
this.billing = new BillingService(this.client);
|
|
1461
|
+
this.booking = new BookingService(this.client);
|
|
1462
|
+
this.access = new AccessService(this.client);
|
|
1344
1463
|
}
|
|
1345
1464
|
static getInstance(isDevMode = false) {
|
|
1346
1465
|
if (!_VitalFit.instance) {
|
|
@@ -1349,7 +1468,7 @@ var VitalFit = class _VitalFit {
|
|
|
1349
1468
|
return _VitalFit.instance;
|
|
1350
1469
|
}
|
|
1351
1470
|
version() {
|
|
1352
|
-
return "0.0.
|
|
1471
|
+
return "0.0.71";
|
|
1353
1472
|
}
|
|
1354
1473
|
};
|
|
1355
1474
|
export {
|