@vitalfit/sdk 0.0.69 → 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 +131 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +97 -3
- package/dist/index.d.ts +97 -3
- package/dist/index.js +131 -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 {
|
|
@@ -809,6 +880,8 @@ declare class UserService {
|
|
|
809
880
|
updateUserClient(userId: string, data: UpdateUserRequest, jwt: string): Promise<void>;
|
|
810
881
|
updateUserStaff(userId: string, data: UpdateUserStaffRequest, jwt: string): Promise<void>;
|
|
811
882
|
deleteUser(userId: string, jwt: string): Promise<void>;
|
|
883
|
+
getUserByEmail(email: string, jwt: string): Promise<DataResponse<User>>;
|
|
884
|
+
QrToken(jwt: string): Promise<QrToken>;
|
|
812
885
|
}
|
|
813
886
|
|
|
814
887
|
declare class BranchService {
|
|
@@ -886,6 +959,9 @@ declare class MembershipService {
|
|
|
886
959
|
updateMembershipType(membershipTypeId: string, data: UpdateMembershipType, jwt: string): Promise<void>;
|
|
887
960
|
deleteMembershipType(membershipTypeId: string, jwt: string): Promise<void>;
|
|
888
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>;
|
|
889
965
|
}
|
|
890
966
|
|
|
891
967
|
declare class PublicService {
|
|
@@ -957,6 +1033,22 @@ declare class BillingService {
|
|
|
957
1033
|
AddPaymentToInvoice(data: AddPaymentToInvoicePayload, jwt: string): Promise<AddPaymentToInvoiceResponse>;
|
|
958
1034
|
getPaymentByID(paymentId: string, jwt: string): Promise<DataResponse<PaymentDetail>>;
|
|
959
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>;
|
|
960
1052
|
}
|
|
961
1053
|
|
|
962
1054
|
declare class APIError extends Error {
|
|
@@ -983,9 +1075,11 @@ declare class VitalFit {
|
|
|
983
1075
|
schedule: ScheduleService;
|
|
984
1076
|
packages: PackagesService;
|
|
985
1077
|
billing: BillingService;
|
|
1078
|
+
booking: BookingService;
|
|
1079
|
+
access: AccessService;
|
|
986
1080
|
constructor(isDevMode: boolean, origin?: string);
|
|
987
1081
|
static getInstance(isDevMode?: boolean): VitalFit;
|
|
988
1082
|
version(): string;
|
|
989
1083
|
}
|
|
990
1084
|
|
|
991
|
-
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 {
|
|
@@ -809,6 +880,8 @@ declare class UserService {
|
|
|
809
880
|
updateUserClient(userId: string, data: UpdateUserRequest, jwt: string): Promise<void>;
|
|
810
881
|
updateUserStaff(userId: string, data: UpdateUserStaffRequest, jwt: string): Promise<void>;
|
|
811
882
|
deleteUser(userId: string, jwt: string): Promise<void>;
|
|
883
|
+
getUserByEmail(email: string, jwt: string): Promise<DataResponse<User>>;
|
|
884
|
+
QrToken(jwt: string): Promise<QrToken>;
|
|
812
885
|
}
|
|
813
886
|
|
|
814
887
|
declare class BranchService {
|
|
@@ -886,6 +959,9 @@ declare class MembershipService {
|
|
|
886
959
|
updateMembershipType(membershipTypeId: string, data: UpdateMembershipType, jwt: string): Promise<void>;
|
|
887
960
|
deleteMembershipType(membershipTypeId: string, jwt: string): Promise<void>;
|
|
888
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>;
|
|
889
965
|
}
|
|
890
966
|
|
|
891
967
|
declare class PublicService {
|
|
@@ -957,6 +1033,22 @@ declare class BillingService {
|
|
|
957
1033
|
AddPaymentToInvoice(data: AddPaymentToInvoicePayload, jwt: string): Promise<AddPaymentToInvoiceResponse>;
|
|
958
1034
|
getPaymentByID(paymentId: string, jwt: string): Promise<DataResponse<PaymentDetail>>;
|
|
959
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>;
|
|
960
1052
|
}
|
|
961
1053
|
|
|
962
1054
|
declare class APIError extends Error {
|
|
@@ -983,9 +1075,11 @@ declare class VitalFit {
|
|
|
983
1075
|
schedule: ScheduleService;
|
|
984
1076
|
packages: PackagesService;
|
|
985
1077
|
billing: BillingService;
|
|
1078
|
+
booking: BookingService;
|
|
1079
|
+
access: AccessService;
|
|
986
1080
|
constructor(isDevMode: boolean, origin?: string);
|
|
987
1081
|
static getInstance(isDevMode?: boolean): VitalFit;
|
|
988
1082
|
version(): string;
|
|
989
1083
|
}
|
|
990
1084
|
|
|
991
|
-
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
|
|
@@ -219,6 +226,8 @@ var UserService = class {
|
|
|
219
226
|
this.getBranchAdmins = this.getBranchAdmins.bind(this);
|
|
220
227
|
this.getClientUsers = this.getClientUsers.bind(this);
|
|
221
228
|
this.getStaffUsers = this.getStaffUsers.bind(this);
|
|
229
|
+
this.getUserByEmail = this.getUserByEmail.bind(this);
|
|
230
|
+
this.QrToken = this.QrToken.bind(this);
|
|
222
231
|
this.GetUserByID = this.GetUserByID.bind(this);
|
|
223
232
|
this.updateUserClient = this.updateUserClient.bind(this);
|
|
224
233
|
this.updateUserStaff = this.updateUserStaff.bind(this);
|
|
@@ -284,6 +293,23 @@ var UserService = class {
|
|
|
284
293
|
jwt
|
|
285
294
|
});
|
|
286
295
|
}
|
|
296
|
+
async getUserByEmail(email, jwt) {
|
|
297
|
+
const response = await this.client.post({
|
|
298
|
+
url: `/user/by-email`,
|
|
299
|
+
jwt,
|
|
300
|
+
data: {
|
|
301
|
+
email
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
return response;
|
|
305
|
+
}
|
|
306
|
+
async QrToken(jwt) {
|
|
307
|
+
const response = await this.client.get({
|
|
308
|
+
url: `/user/qr-token`,
|
|
309
|
+
jwt
|
|
310
|
+
});
|
|
311
|
+
return response;
|
|
312
|
+
}
|
|
287
313
|
};
|
|
288
314
|
|
|
289
315
|
// src/services/branch.ts
|
|
@@ -680,6 +706,9 @@ var MembershipService = class {
|
|
|
680
706
|
this.updateMembershipType = this.updateMembershipType.bind(this);
|
|
681
707
|
this.deleteMembershipType = this.deleteMembershipType.bind(this);
|
|
682
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);
|
|
683
712
|
}
|
|
684
713
|
async createMembershipType(data, jwt) {
|
|
685
714
|
await this.client.post({
|
|
@@ -742,6 +771,33 @@ var MembershipService = class {
|
|
|
742
771
|
});
|
|
743
772
|
return response;
|
|
744
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
|
+
}
|
|
745
801
|
};
|
|
746
802
|
|
|
747
803
|
// src/services/public.ts
|
|
@@ -1154,6 +1210,7 @@ var BillingService = class {
|
|
|
1154
1210
|
this.getInvoiceByID = this.getInvoiceByID.bind(this);
|
|
1155
1211
|
this.getPaymentByID = this.getPaymentByID.bind(this);
|
|
1156
1212
|
this.updatePaymentStatus = this.updatePaymentStatus.bind(this);
|
|
1213
|
+
this.getClientInvoices = this.getClientInvoices.bind(this);
|
|
1157
1214
|
}
|
|
1158
1215
|
async createInvoice(data, jwt) {
|
|
1159
1216
|
const response = await this.client.post({
|
|
@@ -1194,6 +1251,75 @@ var BillingService = class {
|
|
|
1194
1251
|
}
|
|
1195
1252
|
});
|
|
1196
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
|
+
}
|
|
1197
1323
|
};
|
|
1198
1324
|
|
|
1199
1325
|
// src/types/auth.ts
|
|
@@ -1314,6 +1440,8 @@ var VitalFit = class _VitalFit {
|
|
|
1314
1440
|
schedule;
|
|
1315
1441
|
packages;
|
|
1316
1442
|
billing;
|
|
1443
|
+
booking;
|
|
1444
|
+
access;
|
|
1317
1445
|
constructor(isDevMode, origin) {
|
|
1318
1446
|
this.client = new Client(isDevMode, origin);
|
|
1319
1447
|
this.auth = new AuthService(this.client);
|
|
@@ -1330,6 +1458,8 @@ var VitalFit = class _VitalFit {
|
|
|
1330
1458
|
this.schedule = new ScheduleService(this.client);
|
|
1331
1459
|
this.packages = new PackagesService(this.client);
|
|
1332
1460
|
this.billing = new BillingService(this.client);
|
|
1461
|
+
this.booking = new BookingService(this.client);
|
|
1462
|
+
this.access = new AccessService(this.client);
|
|
1333
1463
|
}
|
|
1334
1464
|
static getInstance(isDevMode = false) {
|
|
1335
1465
|
if (!_VitalFit.instance) {
|
|
@@ -1338,7 +1468,7 @@ var VitalFit = class _VitalFit {
|
|
|
1338
1468
|
return _VitalFit.instance;
|
|
1339
1469
|
}
|
|
1340
1470
|
version() {
|
|
1341
|
-
return "0.0.
|
|
1471
|
+
return "0.0.71";
|
|
1342
1472
|
}
|
|
1343
1473
|
};
|
|
1344
1474
|
export {
|