@vitalfit/sdk 0.1.4 → 0.1.5
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 +63 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +63 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -794,6 +794,9 @@ type BranchScheduleResponse = {
|
|
|
794
794
|
type BookClassRequest = {
|
|
795
795
|
user_id: string;
|
|
796
796
|
};
|
|
797
|
+
type ClassBookingCount = {
|
|
798
|
+
count: number;
|
|
799
|
+
};
|
|
797
800
|
|
|
798
801
|
type CreateInvoiceItem = {
|
|
799
802
|
item_id: string;
|
|
@@ -904,6 +907,19 @@ type GlobalStat = {
|
|
|
904
907
|
trend: string;
|
|
905
908
|
};
|
|
906
909
|
|
|
910
|
+
type BranchStaff = {
|
|
911
|
+
id: string;
|
|
912
|
+
name: string;
|
|
913
|
+
};
|
|
914
|
+
type Staff = {
|
|
915
|
+
email: string;
|
|
916
|
+
first_name: string;
|
|
917
|
+
last_name: string;
|
|
918
|
+
phone: string;
|
|
919
|
+
role: string;
|
|
920
|
+
user_id: string;
|
|
921
|
+
};
|
|
922
|
+
|
|
907
923
|
declare class AuthService {
|
|
908
924
|
private client;
|
|
909
925
|
constructor(client: Client);
|
|
@@ -1096,7 +1112,7 @@ declare class BillingService {
|
|
|
1096
1112
|
getPaymentByID(paymentId: string, jwt: string): Promise<DataResponse<PaymentDetail>>;
|
|
1097
1113
|
updatePaymentStatus(paymentId: string, status: string, jwt: string): Promise<void>;
|
|
1098
1114
|
getClientInvoices(jwt: string, { page, limit, sort, search }: PaginationRequest, userID?: string): Promise<PaginatedTotal<ClientInvoice[]>>;
|
|
1099
|
-
getInvoices(jwt: string, { page, limit, sort, search, status, }: PaginationWithStatus): Promise<PaginatedTotal<InvoiceList[]>>;
|
|
1115
|
+
getInvoices(jwt: string, { page, limit, sort, search, status, }: PaginationWithStatus, branchID?: string): Promise<PaginatedTotal<InvoiceList[]>>;
|
|
1100
1116
|
}
|
|
1101
1117
|
|
|
1102
1118
|
declare class BookingService {
|
|
@@ -1106,6 +1122,7 @@ declare class BookingService {
|
|
|
1106
1122
|
cancelBooking(bookingId: string, jwt: string): Promise<void>;
|
|
1107
1123
|
getClientBooking(userID: string, jwt: string): Promise<DataResponse<ClientBookingResponse[]>>;
|
|
1108
1124
|
getClientBranchBooking(branchID: string, userID: string, jwt: string): Promise<DataResponse<BranchScheduleResponse[]>>;
|
|
1125
|
+
getClassBookingCount(classID: string, jwt: string): Promise<ClassBookingCount>;
|
|
1109
1126
|
}
|
|
1110
1127
|
|
|
1111
1128
|
declare class AccessService {
|
|
@@ -1128,6 +1145,16 @@ declare class ReportService {
|
|
|
1128
1145
|
totalClients(jwt: string): Promise<DataResponse<number>>;
|
|
1129
1146
|
}
|
|
1130
1147
|
|
|
1148
|
+
declare class StaffService {
|
|
1149
|
+
private client;
|
|
1150
|
+
constructor(client: Client);
|
|
1151
|
+
getStaffBranches(jwt: string): Promise<DataResponse<BranchStaff[]>>;
|
|
1152
|
+
getManagedBranches(jwt: string): Promise<DataResponse<BranchStaff[]>>;
|
|
1153
|
+
getBranchstaff(branchId: string, jwt: string): Promise<DataResponse<Staff[]>>;
|
|
1154
|
+
AssignBranchStaff(branchId: string, staffIds: string[], jwt: string): Promise<void>;
|
|
1155
|
+
RemoveBranchStaff(branchId: string, staffId: string, jwt: string): Promise<void>;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1131
1158
|
declare class APIError extends Error {
|
|
1132
1159
|
status: number;
|
|
1133
1160
|
messages: string[];
|
|
@@ -1155,9 +1182,10 @@ declare class VitalFit {
|
|
|
1155
1182
|
booking: BookingService;
|
|
1156
1183
|
access: AccessService;
|
|
1157
1184
|
report: ReportService;
|
|
1185
|
+
staff: StaffService;
|
|
1158
1186
|
constructor(isDevMode: boolean, origin?: string);
|
|
1159
1187
|
static getInstance(isDevMode?: boolean): VitalFit;
|
|
1160
1188
|
version(): string;
|
|
1161
1189
|
}
|
|
1162
1190
|
|
|
1163
|
-
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 ChartData, 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 CreateCancellationReason, type CreateClassPayload, type CreateEquipment, 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 GetUserResponse, type GlobalStat, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoiceList, 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 PaginationWithStatus, type PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type Promotion, 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 TopBranch, 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 };
|
|
1191
|
+
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 BranchStaff, type BranchStatusCount, type CancellationReason, type ChartData, type CheckIn, type CheckInResponse, type ClassBookingCount, type ClientBookingResponse, type ClientInvoice, type ClientMembership, type ClientMembershipDetail, type ClientMembershipItem, type ClientMembershipUser, type ClientProfile, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateCancellationReason, type CreateClassPayload, type CreateEquipment, 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 GetUserResponse, type GlobalStat, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoiceList, 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 PaginationWithStatus, type PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type Promotion, 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 Staff, type TopBranch, 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
|
@@ -794,6 +794,9 @@ type BranchScheduleResponse = {
|
|
|
794
794
|
type BookClassRequest = {
|
|
795
795
|
user_id: string;
|
|
796
796
|
};
|
|
797
|
+
type ClassBookingCount = {
|
|
798
|
+
count: number;
|
|
799
|
+
};
|
|
797
800
|
|
|
798
801
|
type CreateInvoiceItem = {
|
|
799
802
|
item_id: string;
|
|
@@ -904,6 +907,19 @@ type GlobalStat = {
|
|
|
904
907
|
trend: string;
|
|
905
908
|
};
|
|
906
909
|
|
|
910
|
+
type BranchStaff = {
|
|
911
|
+
id: string;
|
|
912
|
+
name: string;
|
|
913
|
+
};
|
|
914
|
+
type Staff = {
|
|
915
|
+
email: string;
|
|
916
|
+
first_name: string;
|
|
917
|
+
last_name: string;
|
|
918
|
+
phone: string;
|
|
919
|
+
role: string;
|
|
920
|
+
user_id: string;
|
|
921
|
+
};
|
|
922
|
+
|
|
907
923
|
declare class AuthService {
|
|
908
924
|
private client;
|
|
909
925
|
constructor(client: Client);
|
|
@@ -1096,7 +1112,7 @@ declare class BillingService {
|
|
|
1096
1112
|
getPaymentByID(paymentId: string, jwt: string): Promise<DataResponse<PaymentDetail>>;
|
|
1097
1113
|
updatePaymentStatus(paymentId: string, status: string, jwt: string): Promise<void>;
|
|
1098
1114
|
getClientInvoices(jwt: string, { page, limit, sort, search }: PaginationRequest, userID?: string): Promise<PaginatedTotal<ClientInvoice[]>>;
|
|
1099
|
-
getInvoices(jwt: string, { page, limit, sort, search, status, }: PaginationWithStatus): Promise<PaginatedTotal<InvoiceList[]>>;
|
|
1115
|
+
getInvoices(jwt: string, { page, limit, sort, search, status, }: PaginationWithStatus, branchID?: string): Promise<PaginatedTotal<InvoiceList[]>>;
|
|
1100
1116
|
}
|
|
1101
1117
|
|
|
1102
1118
|
declare class BookingService {
|
|
@@ -1106,6 +1122,7 @@ declare class BookingService {
|
|
|
1106
1122
|
cancelBooking(bookingId: string, jwt: string): Promise<void>;
|
|
1107
1123
|
getClientBooking(userID: string, jwt: string): Promise<DataResponse<ClientBookingResponse[]>>;
|
|
1108
1124
|
getClientBranchBooking(branchID: string, userID: string, jwt: string): Promise<DataResponse<BranchScheduleResponse[]>>;
|
|
1125
|
+
getClassBookingCount(classID: string, jwt: string): Promise<ClassBookingCount>;
|
|
1109
1126
|
}
|
|
1110
1127
|
|
|
1111
1128
|
declare class AccessService {
|
|
@@ -1128,6 +1145,16 @@ declare class ReportService {
|
|
|
1128
1145
|
totalClients(jwt: string): Promise<DataResponse<number>>;
|
|
1129
1146
|
}
|
|
1130
1147
|
|
|
1148
|
+
declare class StaffService {
|
|
1149
|
+
private client;
|
|
1150
|
+
constructor(client: Client);
|
|
1151
|
+
getStaffBranches(jwt: string): Promise<DataResponse<BranchStaff[]>>;
|
|
1152
|
+
getManagedBranches(jwt: string): Promise<DataResponse<BranchStaff[]>>;
|
|
1153
|
+
getBranchstaff(branchId: string, jwt: string): Promise<DataResponse<Staff[]>>;
|
|
1154
|
+
AssignBranchStaff(branchId: string, staffIds: string[], jwt: string): Promise<void>;
|
|
1155
|
+
RemoveBranchStaff(branchId: string, staffId: string, jwt: string): Promise<void>;
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1131
1158
|
declare class APIError extends Error {
|
|
1132
1159
|
status: number;
|
|
1133
1160
|
messages: string[];
|
|
@@ -1155,9 +1182,10 @@ declare class VitalFit {
|
|
|
1155
1182
|
booking: BookingService;
|
|
1156
1183
|
access: AccessService;
|
|
1157
1184
|
report: ReportService;
|
|
1185
|
+
staff: StaffService;
|
|
1158
1186
|
constructor(isDevMode: boolean, origin?: string);
|
|
1159
1187
|
static getInstance(isDevMode?: boolean): VitalFit;
|
|
1160
1188
|
version(): string;
|
|
1161
1189
|
}
|
|
1162
1190
|
|
|
1163
|
-
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 ChartData, 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 CreateCancellationReason, type CreateClassPayload, type CreateEquipment, 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 GetUserResponse, type GlobalStat, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoiceList, 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 PaginationWithStatus, type PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type Promotion, 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 TopBranch, 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 };
|
|
1191
|
+
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 BranchStaff, type BranchStatusCount, type CancellationReason, type ChartData, type CheckIn, type CheckInResponse, type ClassBookingCount, type ClientBookingResponse, type ClientInvoice, type ClientMembership, type ClientMembershipDetail, type ClientMembershipItem, type ClientMembershipUser, type ClientProfile, type CreateBanner, type CreateBranchEquipment, type CreateBranchRequest, type CreateBranchServicePriceItem, type CreateCancellationReason, type CreateClassPayload, type CreateEquipment, 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 GetUserResponse, type GlobalStat, type Instructor, type InstructorData, type InstructorDataList, type InstructorsSummary, type InvoiceDetail, type InvoiceItemDetail, type InvoiceList, 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 PaginationWithStatus, type PagoMovilConfig, type PaymentConfiguration, type PaymentDetail, type PaymentMethod, type PaymentMethodTypes, type Permission, type Promotion, 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 Staff, type TopBranch, 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
|
@@ -1377,7 +1377,7 @@ var BillingService = class {
|
|
|
1377
1377
|
sort = "desc",
|
|
1378
1378
|
search,
|
|
1379
1379
|
status
|
|
1380
|
-
}) {
|
|
1380
|
+
}, branchID) {
|
|
1381
1381
|
const response = await this.client.get({
|
|
1382
1382
|
url: "/billing/invoices",
|
|
1383
1383
|
jwt,
|
|
@@ -1386,7 +1386,8 @@ var BillingService = class {
|
|
|
1386
1386
|
limit,
|
|
1387
1387
|
sort,
|
|
1388
1388
|
search,
|
|
1389
|
-
status
|
|
1389
|
+
status,
|
|
1390
|
+
branch_id: branchID
|
|
1390
1391
|
}
|
|
1391
1392
|
});
|
|
1392
1393
|
return response;
|
|
@@ -1402,6 +1403,7 @@ var BookingService = class {
|
|
|
1402
1403
|
this.cancelBooking = this.cancelBooking.bind(this);
|
|
1403
1404
|
this.getClientBooking = this.getClientBooking.bind(this);
|
|
1404
1405
|
this.getClientBranchBooking = this.getClientBranchBooking.bind(this);
|
|
1406
|
+
this.getClassBookingCount = this.getClassBookingCount.bind(this);
|
|
1405
1407
|
}
|
|
1406
1408
|
async bookClass(data, classID, jwt) {
|
|
1407
1409
|
await this.client.post({
|
|
@@ -1430,6 +1432,13 @@ var BookingService = class {
|
|
|
1430
1432
|
});
|
|
1431
1433
|
return response;
|
|
1432
1434
|
}
|
|
1435
|
+
async getClassBookingCount(classID, jwt) {
|
|
1436
|
+
const response = await this.client.get({
|
|
1437
|
+
url: `/bookings/${classID}/count`,
|
|
1438
|
+
jwt
|
|
1439
|
+
});
|
|
1440
|
+
return response;
|
|
1441
|
+
}
|
|
1433
1442
|
};
|
|
1434
1443
|
|
|
1435
1444
|
// src/services/access.ts
|
|
@@ -1549,6 +1558,55 @@ var ReportService = class {
|
|
|
1549
1558
|
}
|
|
1550
1559
|
};
|
|
1551
1560
|
|
|
1561
|
+
// src/services/staff.ts
|
|
1562
|
+
var StaffService = class {
|
|
1563
|
+
client;
|
|
1564
|
+
constructor(client) {
|
|
1565
|
+
this.client = client;
|
|
1566
|
+
this.getStaffBranches = this.getStaffBranches.bind(this);
|
|
1567
|
+
this.getManagedBranches = this.getManagedBranches.bind(this);
|
|
1568
|
+
this.getBranchstaff = this.getBranchstaff.bind(this);
|
|
1569
|
+
this.AssignBranchStaff = this.AssignBranchStaff.bind(this);
|
|
1570
|
+
this.RemoveBranchStaff = this.RemoveBranchStaff.bind(this);
|
|
1571
|
+
}
|
|
1572
|
+
async getStaffBranches(jwt) {
|
|
1573
|
+
const response = await this.client.get({
|
|
1574
|
+
url: "/staff/branches",
|
|
1575
|
+
jwt
|
|
1576
|
+
});
|
|
1577
|
+
return response;
|
|
1578
|
+
}
|
|
1579
|
+
async getManagedBranches(jwt) {
|
|
1580
|
+
const response = await this.client.get({
|
|
1581
|
+
url: "/staff/managed-branches",
|
|
1582
|
+
jwt
|
|
1583
|
+
});
|
|
1584
|
+
return response;
|
|
1585
|
+
}
|
|
1586
|
+
async getBranchstaff(branchId, jwt) {
|
|
1587
|
+
const response = await this.client.get({
|
|
1588
|
+
url: `/branches/${branchId}/staff`,
|
|
1589
|
+
jwt
|
|
1590
|
+
});
|
|
1591
|
+
return response;
|
|
1592
|
+
}
|
|
1593
|
+
async AssignBranchStaff(branchId, staffIds, jwt) {
|
|
1594
|
+
await this.client.post({
|
|
1595
|
+
url: `/branches/${branchId}/staff`,
|
|
1596
|
+
jwt,
|
|
1597
|
+
data: {
|
|
1598
|
+
staff: staffIds
|
|
1599
|
+
}
|
|
1600
|
+
});
|
|
1601
|
+
}
|
|
1602
|
+
async RemoveBranchStaff(branchId, staffId, jwt) {
|
|
1603
|
+
await this.client.delete({
|
|
1604
|
+
url: `/branches/${branchId}/staff/${staffId}`,
|
|
1605
|
+
jwt
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
};
|
|
1609
|
+
|
|
1552
1610
|
// src/types/auth.ts
|
|
1553
1611
|
var UserGender = /* @__PURE__ */ ((UserGender2) => {
|
|
1554
1612
|
UserGender2["male"] = "male";
|
|
@@ -1670,6 +1728,7 @@ var VitalFit = class _VitalFit {
|
|
|
1670
1728
|
booking;
|
|
1671
1729
|
access;
|
|
1672
1730
|
report;
|
|
1731
|
+
staff;
|
|
1673
1732
|
constructor(isDevMode, origin) {
|
|
1674
1733
|
this.client = new Client(isDevMode, origin);
|
|
1675
1734
|
this.auth = new AuthService(this.client);
|
|
@@ -1689,6 +1748,7 @@ var VitalFit = class _VitalFit {
|
|
|
1689
1748
|
this.booking = new BookingService(this.client);
|
|
1690
1749
|
this.access = new AccessService(this.client);
|
|
1691
1750
|
this.report = new ReportService(this.client);
|
|
1751
|
+
this.staff = new StaffService(this.client);
|
|
1692
1752
|
}
|
|
1693
1753
|
static getInstance(isDevMode = false) {
|
|
1694
1754
|
if (!_VitalFit.instance) {
|
|
@@ -1697,7 +1757,7 @@ var VitalFit = class _VitalFit {
|
|
|
1697
1757
|
return _VitalFit.instance;
|
|
1698
1758
|
}
|
|
1699
1759
|
version() {
|
|
1700
|
-
return "0.1.
|
|
1760
|
+
return "0.1.5";
|
|
1701
1761
|
}
|
|
1702
1762
|
};
|
|
1703
1763
|
export {
|