@vitalfit/sdk 0.1.3 → 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 CHANGED
@@ -721,6 +721,11 @@ var MarketingService = class {
721
721
  this.getBannerByID = this.getBannerByID.bind(this);
722
722
  this.updateBanner = this.updateBanner.bind(this);
723
723
  this.deleteBanner = this.deleteBanner.bind(this);
724
+ this.createPromotion = this.createPromotion.bind(this);
725
+ this.getPromotion = this.getPromotion.bind(this);
726
+ this.getPromotionByID = this.getPromotionByID.bind(this);
727
+ this.updatePromotion = this.updatePromotion.bind(this);
728
+ this.deletePromotion = this.deletePromotion.bind(this);
724
729
  }
725
730
  async createBanners(BannerData, jwt) {
726
731
  await this.client.post({
@@ -756,6 +761,46 @@ var MarketingService = class {
756
761
  jwt
757
762
  });
758
763
  }
764
+ async createPromotion(promotionData, jwt) {
765
+ await this.client.post({
766
+ url: "/marketing/promotions",
767
+ jwt,
768
+ data: promotionData
769
+ });
770
+ }
771
+ async getPromotion(jwt, { page = 10, limit = 10, sort = "desc", search }) {
772
+ const response = await this.client.get({
773
+ url: "/marketing/promotions",
774
+ jwt,
775
+ params: {
776
+ page,
777
+ limit,
778
+ sort,
779
+ search
780
+ }
781
+ });
782
+ return response;
783
+ }
784
+ async getPromotionByID(promotionId, jwt) {
785
+ const response = await this.client.get({
786
+ url: `/marketing/promotions/${promotionId}`,
787
+ jwt
788
+ });
789
+ return response;
790
+ }
791
+ async updatePromotion(promotionId, promotionData, jwt) {
792
+ await this.client.put({
793
+ url: `/marketing/promotions/${promotionId}`,
794
+ jwt,
795
+ data: promotionData
796
+ });
797
+ }
798
+ async deletePromotion(promotionId, jwt) {
799
+ await this.client.delete({
800
+ url: `/marketing/promotions/${promotionId}`,
801
+ jwt
802
+ });
803
+ }
759
804
  };
760
805
 
761
806
  // src/services/memberships.ts
@@ -773,6 +818,10 @@ var MembershipService = class {
773
818
  this.getClientMemberships = this.getClientMemberships.bind(this);
774
819
  this.getClientMembershipByID = this.getClientMembershipByID.bind(this);
775
820
  this.updateClientMembership = this.updateClientMembership.bind(this);
821
+ this.createCancelReason = this.createCancelReason.bind(this);
822
+ this.getCancelReasons = this.getCancelReasons.bind(this);
823
+ this.updateCancelReason = this.updateCancelReason.bind(this);
824
+ this.deleteCancelReason = this.deleteCancelReason.bind(this);
776
825
  }
777
826
  async createMembershipType(data, jwt) {
778
827
  await this.client.post({
@@ -862,6 +911,39 @@ var MembershipService = class {
862
911
  data
863
912
  });
864
913
  }
914
+ async createCancelReason(data, jwt) {
915
+ await this.client.post({
916
+ url: "/memberships/cancellation-reasons",
917
+ jwt,
918
+ data
919
+ });
920
+ }
921
+ async getCancelReasons(jwt, { page = 10, limit = 10, sort = "desc", search }) {
922
+ const response = await this.client.get({
923
+ url: "/memberships/cancellation-reasons",
924
+ jwt,
925
+ params: {
926
+ page,
927
+ limit,
928
+ sort,
929
+ search
930
+ }
931
+ });
932
+ return response;
933
+ }
934
+ async updateCancelReason(reasonId, data, jwt) {
935
+ await this.client.put({
936
+ url: `/memberships/cancellation-reasons/${reasonId}`,
937
+ jwt,
938
+ data
939
+ });
940
+ }
941
+ async deleteCancelReason(reasonId, jwt) {
942
+ await this.client.delete({
943
+ url: `/memberships/cancellation-reasons/${reasonId}`,
944
+ jwt
945
+ });
946
+ }
865
947
  };
866
948
 
867
949
  // src/services/public.ts
@@ -1335,7 +1417,7 @@ var BillingService = class {
1335
1417
  sort = "desc",
1336
1418
  search,
1337
1419
  status
1338
- }) {
1420
+ }, branchID) {
1339
1421
  const response = await this.client.get({
1340
1422
  url: "/billing/invoices",
1341
1423
  jwt,
@@ -1344,7 +1426,8 @@ var BillingService = class {
1344
1426
  limit,
1345
1427
  sort,
1346
1428
  search,
1347
- status
1429
+ status,
1430
+ branch_id: branchID
1348
1431
  }
1349
1432
  });
1350
1433
  return response;
@@ -1360,6 +1443,7 @@ var BookingService = class {
1360
1443
  this.cancelBooking = this.cancelBooking.bind(this);
1361
1444
  this.getClientBooking = this.getClientBooking.bind(this);
1362
1445
  this.getClientBranchBooking = this.getClientBranchBooking.bind(this);
1446
+ this.getClassBookingCount = this.getClassBookingCount.bind(this);
1363
1447
  }
1364
1448
  async bookClass(data, classID, jwt) {
1365
1449
  await this.client.post({
@@ -1388,6 +1472,13 @@ var BookingService = class {
1388
1472
  });
1389
1473
  return response;
1390
1474
  }
1475
+ async getClassBookingCount(classID, jwt) {
1476
+ const response = await this.client.get({
1477
+ url: `/bookings/${classID}/count`,
1478
+ jwt
1479
+ });
1480
+ return response;
1481
+ }
1391
1482
  };
1392
1483
 
1393
1484
  // src/services/access.ts
@@ -1507,6 +1598,55 @@ var ReportService = class {
1507
1598
  }
1508
1599
  };
1509
1600
 
1601
+ // src/services/staff.ts
1602
+ var StaffService = class {
1603
+ client;
1604
+ constructor(client) {
1605
+ this.client = client;
1606
+ this.getStaffBranches = this.getStaffBranches.bind(this);
1607
+ this.getManagedBranches = this.getManagedBranches.bind(this);
1608
+ this.getBranchstaff = this.getBranchstaff.bind(this);
1609
+ this.AssignBranchStaff = this.AssignBranchStaff.bind(this);
1610
+ this.RemoveBranchStaff = this.RemoveBranchStaff.bind(this);
1611
+ }
1612
+ async getStaffBranches(jwt) {
1613
+ const response = await this.client.get({
1614
+ url: "/staff/branches",
1615
+ jwt
1616
+ });
1617
+ return response;
1618
+ }
1619
+ async getManagedBranches(jwt) {
1620
+ const response = await this.client.get({
1621
+ url: "/staff/managed-branches",
1622
+ jwt
1623
+ });
1624
+ return response;
1625
+ }
1626
+ async getBranchstaff(branchId, jwt) {
1627
+ const response = await this.client.get({
1628
+ url: `/branches/${branchId}/staff`,
1629
+ jwt
1630
+ });
1631
+ return response;
1632
+ }
1633
+ async AssignBranchStaff(branchId, staffIds, jwt) {
1634
+ await this.client.post({
1635
+ url: `/branches/${branchId}/staff`,
1636
+ jwt,
1637
+ data: {
1638
+ staff: staffIds
1639
+ }
1640
+ });
1641
+ }
1642
+ async RemoveBranchStaff(branchId, staffId, jwt) {
1643
+ await this.client.delete({
1644
+ url: `/branches/${branchId}/staff/${staffId}`,
1645
+ jwt
1646
+ });
1647
+ }
1648
+ };
1649
+
1510
1650
  // src/types/auth.ts
1511
1651
  var UserGender = /* @__PURE__ */ ((UserGender2) => {
1512
1652
  UserGender2["male"] = "male";
@@ -1628,6 +1768,7 @@ var VitalFit = class _VitalFit {
1628
1768
  booking;
1629
1769
  access;
1630
1770
  report;
1771
+ staff;
1631
1772
  constructor(isDevMode, origin) {
1632
1773
  this.client = new Client(isDevMode, origin);
1633
1774
  this.auth = new AuthService(this.client);
@@ -1647,6 +1788,7 @@ var VitalFit = class _VitalFit {
1647
1788
  this.booking = new BookingService(this.client);
1648
1789
  this.access = new AccessService(this.client);
1649
1790
  this.report = new ReportService(this.client);
1791
+ this.staff = new StaffService(this.client);
1650
1792
  }
1651
1793
  static getInstance(isDevMode = false) {
1652
1794
  if (!_VitalFit.instance) {
@@ -1655,7 +1797,7 @@ var VitalFit = class _VitalFit {
1655
1797
  return _VitalFit.instance;
1656
1798
  }
1657
1799
  version() {
1658
- return "0.1.3";
1800
+ return "0.1.5";
1659
1801
  }
1660
1802
  };
1661
1803
  // Annotate the CommonJS export names for ESM import in node: