@vitalfit/sdk 0.4.0 → 0.4.2
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 +152 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +109 -3
- package/dist/index.d.ts +109 -3
- package/dist/index.js +152 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -474,6 +474,7 @@ var UserService = class {
|
|
|
474
474
|
this.resendActivateOtp = this.resendActivateOtp.bind(this);
|
|
475
475
|
this.UpgradePassword = this.UpgradePassword.bind(this);
|
|
476
476
|
this.blockUser = this.blockUser.bind(this);
|
|
477
|
+
this.unblockUser = this.unblockUser.bind(this);
|
|
477
478
|
this.enrollFace = this.enrollFace.bind(this);
|
|
478
479
|
this.createMedicalProfile = this.createMedicalProfile.bind(this);
|
|
479
480
|
this.getMedicalProfile = this.getMedicalProfile.bind(this);
|
|
@@ -591,6 +592,12 @@ var UserService = class {
|
|
|
591
592
|
data
|
|
592
593
|
});
|
|
593
594
|
}
|
|
595
|
+
async unblockUser(userId, jwt) {
|
|
596
|
+
await this.client.put({
|
|
597
|
+
url: `/user/${userId}/unblock`,
|
|
598
|
+
jwt
|
|
599
|
+
});
|
|
600
|
+
}
|
|
594
601
|
async enrollFace(jwt, photo) {
|
|
595
602
|
const formData = new FormData();
|
|
596
603
|
formData.append("selfie", photo);
|
|
@@ -1547,13 +1554,14 @@ var ScheduleService = class {
|
|
|
1547
1554
|
this.GetClassByID = this.GetClassByID.bind(this);
|
|
1548
1555
|
this.GetClassesByInstructor = this.GetClassesByInstructor.bind(this);
|
|
1549
1556
|
}
|
|
1550
|
-
async ListBranchesClass(branchID, jwt, month, year) {
|
|
1557
|
+
async ListBranchesClass(branchID, jwt, month, year, date) {
|
|
1551
1558
|
const response = await this.client.get({
|
|
1552
1559
|
url: `/branches/${branchID}/schedule`,
|
|
1553
1560
|
jwt,
|
|
1554
1561
|
params: {
|
|
1555
1562
|
month,
|
|
1556
|
-
year
|
|
1563
|
+
year,
|
|
1564
|
+
date
|
|
1557
1565
|
}
|
|
1558
1566
|
});
|
|
1559
1567
|
return response;
|
|
@@ -1585,14 +1593,15 @@ var ScheduleService = class {
|
|
|
1585
1593
|
jwt
|
|
1586
1594
|
});
|
|
1587
1595
|
}
|
|
1588
|
-
async GetClassesByInstructor(jwt, userId, month, year) {
|
|
1596
|
+
async GetClassesByInstructor(jwt, userId, month, year, date) {
|
|
1589
1597
|
const response = await this.client.get({
|
|
1590
1598
|
url: "/schedule/instructor",
|
|
1591
1599
|
jwt,
|
|
1592
1600
|
params: {
|
|
1593
1601
|
user_id: userId,
|
|
1594
1602
|
month,
|
|
1595
|
-
year
|
|
1603
|
+
year,
|
|
1604
|
+
date
|
|
1596
1605
|
}
|
|
1597
1606
|
});
|
|
1598
1607
|
return response;
|
|
@@ -1990,6 +1999,7 @@ var ReportService = class {
|
|
|
1990
1999
|
this.financialSummary = this.financialSummary.bind(this);
|
|
1991
2000
|
this.salesByDemography = this.salesByDemography.bind(this);
|
|
1992
2001
|
this.churnRateKPI = this.churnRateKPI.bind(this);
|
|
2002
|
+
this.rfmAnalysis = this.rfmAnalysis.bind(this);
|
|
1993
2003
|
}
|
|
1994
2004
|
async mostUsedServices(jwt, start, end) {
|
|
1995
2005
|
const response = await this.client.get({
|
|
@@ -2348,6 +2358,14 @@ var ReportService = class {
|
|
|
2348
2358
|
});
|
|
2349
2359
|
return response;
|
|
2350
2360
|
}
|
|
2361
|
+
async rfmAnalysis(jwt, branchId) {
|
|
2362
|
+
const response = await this.client.get({
|
|
2363
|
+
url: "/reports/analysis/rfm",
|
|
2364
|
+
jwt,
|
|
2365
|
+
params: branchId ? { branch_id: branchId } : void 0
|
|
2366
|
+
});
|
|
2367
|
+
return response;
|
|
2368
|
+
}
|
|
2351
2369
|
};
|
|
2352
2370
|
|
|
2353
2371
|
// src/services/staff.ts
|
|
@@ -2696,6 +2714,133 @@ var ExportsService = class {
|
|
|
2696
2714
|
}
|
|
2697
2715
|
};
|
|
2698
2716
|
|
|
2717
|
+
// src/services/routine.ts
|
|
2718
|
+
var RoutineService = class {
|
|
2719
|
+
client;
|
|
2720
|
+
constructor(client) {
|
|
2721
|
+
this.client = client;
|
|
2722
|
+
this.createRoutine = this.createRoutine.bind(this);
|
|
2723
|
+
this.assignRoutine = this.assignRoutine.bind(this);
|
|
2724
|
+
this.getMyRoutines = this.getMyRoutines.bind(this);
|
|
2725
|
+
this.deleteRoutine = this.deleteRoutine.bind(this);
|
|
2726
|
+
this.updateRoutine = this.updateRoutine.bind(this);
|
|
2727
|
+
this.createExercise = this.createExercise.bind(this);
|
|
2728
|
+
this.getExercises = this.getExercises.bind(this);
|
|
2729
|
+
this.getClientRoutines = this.getClientRoutines.bind(this);
|
|
2730
|
+
this.getInstructorRoutines = this.getInstructorRoutines.bind(this);
|
|
2731
|
+
this.getRoutineById = this.getRoutineById.bind(this);
|
|
2732
|
+
this.getAllRoutines = this.getAllRoutines.bind(this);
|
|
2733
|
+
}
|
|
2734
|
+
async createRoutine(data, jwt) {
|
|
2735
|
+
const response = await this.client.post({
|
|
2736
|
+
url: "/routines",
|
|
2737
|
+
jwt,
|
|
2738
|
+
data
|
|
2739
|
+
});
|
|
2740
|
+
return response;
|
|
2741
|
+
}
|
|
2742
|
+
async assignRoutine(data, jwt) {
|
|
2743
|
+
await this.client.post({
|
|
2744
|
+
url: "/routines/assign",
|
|
2745
|
+
jwt,
|
|
2746
|
+
data
|
|
2747
|
+
});
|
|
2748
|
+
}
|
|
2749
|
+
async getMyRoutines(jwt, { page = 1, limit = 10, sort = "desc", search }) {
|
|
2750
|
+
const response = await this.client.get({
|
|
2751
|
+
url: "/routines/my-routines",
|
|
2752
|
+
jwt,
|
|
2753
|
+
params: {
|
|
2754
|
+
page,
|
|
2755
|
+
limit,
|
|
2756
|
+
sort,
|
|
2757
|
+
search
|
|
2758
|
+
}
|
|
2759
|
+
});
|
|
2760
|
+
return response;
|
|
2761
|
+
}
|
|
2762
|
+
async deleteRoutine(routineId, jwt) {
|
|
2763
|
+
await this.client.delete({
|
|
2764
|
+
url: `/routines/${routineId}`,
|
|
2765
|
+
jwt
|
|
2766
|
+
});
|
|
2767
|
+
}
|
|
2768
|
+
async updateRoutine(routineId, data, jwt) {
|
|
2769
|
+
await this.client.put({
|
|
2770
|
+
url: `/routines/${routineId}`,
|
|
2771
|
+
jwt,
|
|
2772
|
+
data
|
|
2773
|
+
});
|
|
2774
|
+
}
|
|
2775
|
+
async createExercise(data, jwt) {
|
|
2776
|
+
const response = await this.client.post({
|
|
2777
|
+
url: "/exercises",
|
|
2778
|
+
jwt,
|
|
2779
|
+
data
|
|
2780
|
+
});
|
|
2781
|
+
return response;
|
|
2782
|
+
}
|
|
2783
|
+
async getExercises(jwt, { page = 1, limit = 10, sort = "asc", search }) {
|
|
2784
|
+
const response = await this.client.get({
|
|
2785
|
+
url: "/exercises",
|
|
2786
|
+
jwt,
|
|
2787
|
+
params: {
|
|
2788
|
+
page,
|
|
2789
|
+
limit,
|
|
2790
|
+
sort,
|
|
2791
|
+
search
|
|
2792
|
+
}
|
|
2793
|
+
});
|
|
2794
|
+
return response;
|
|
2795
|
+
}
|
|
2796
|
+
async getClientRoutines(clientId, jwt, { page = 1, limit = 10, sort = "desc", search }) {
|
|
2797
|
+
const response = await this.client.get({
|
|
2798
|
+
url: `/routines/client/${clientId}`,
|
|
2799
|
+
jwt,
|
|
2800
|
+
params: {
|
|
2801
|
+
page,
|
|
2802
|
+
limit,
|
|
2803
|
+
sort,
|
|
2804
|
+
search
|
|
2805
|
+
}
|
|
2806
|
+
});
|
|
2807
|
+
return response;
|
|
2808
|
+
}
|
|
2809
|
+
async getInstructorRoutines(jwt, { page = 1, limit = 10, sort = "desc", search }) {
|
|
2810
|
+
const response = await this.client.get({
|
|
2811
|
+
url: "/routines/my-created",
|
|
2812
|
+
jwt,
|
|
2813
|
+
params: {
|
|
2814
|
+
page,
|
|
2815
|
+
limit,
|
|
2816
|
+
sort,
|
|
2817
|
+
search
|
|
2818
|
+
}
|
|
2819
|
+
});
|
|
2820
|
+
return response;
|
|
2821
|
+
}
|
|
2822
|
+
async getRoutineById(routineId, jwt) {
|
|
2823
|
+
const response = await this.client.get({
|
|
2824
|
+
url: `/routines/${routineId}`,
|
|
2825
|
+
jwt
|
|
2826
|
+
});
|
|
2827
|
+
return response;
|
|
2828
|
+
}
|
|
2829
|
+
async getAllRoutines(jwt, { page = 1, limit = 10, sort = "desc", search }) {
|
|
2830
|
+
const response = await this.client.get({
|
|
2831
|
+
url: "/routines",
|
|
2832
|
+
jwt,
|
|
2833
|
+
params: {
|
|
2834
|
+
page,
|
|
2835
|
+
limit,
|
|
2836
|
+
sort,
|
|
2837
|
+
search
|
|
2838
|
+
}
|
|
2839
|
+
});
|
|
2840
|
+
return response;
|
|
2841
|
+
}
|
|
2842
|
+
};
|
|
2843
|
+
|
|
2699
2844
|
// src/types/auth.ts
|
|
2700
2845
|
var UserGender = /* @__PURE__ */ ((UserGender2) => {
|
|
2701
2846
|
UserGender2["male"] = "male";
|
|
@@ -2823,6 +2968,7 @@ var VitalFit = class _VitalFit {
|
|
|
2823
2968
|
audit;
|
|
2824
2969
|
notification;
|
|
2825
2970
|
exports;
|
|
2971
|
+
routine;
|
|
2826
2972
|
constructor(isDevMode, origin) {
|
|
2827
2973
|
this.client = new Client(isDevMode, origin);
|
|
2828
2974
|
this.auth = new AuthService(this.client);
|
|
@@ -2848,6 +2994,7 @@ var VitalFit = class _VitalFit {
|
|
|
2848
2994
|
this.audit = new AuditService(this.client);
|
|
2849
2995
|
this.notification = new NotificationService(this.client);
|
|
2850
2996
|
this.exports = new ExportsService(this.client);
|
|
2997
|
+
this.routine = new RoutineService(this.client);
|
|
2851
2998
|
}
|
|
2852
2999
|
static getInstance(isDevMode = false) {
|
|
2853
3000
|
if (!_VitalFit.instance) {
|
|
@@ -2856,7 +3003,7 @@ var VitalFit = class _VitalFit {
|
|
|
2856
3003
|
return _VitalFit.instance;
|
|
2857
3004
|
}
|
|
2858
3005
|
version() {
|
|
2859
|
-
return "0.4.
|
|
3006
|
+
return "0.4.2";
|
|
2860
3007
|
}
|
|
2861
3008
|
};
|
|
2862
3009
|
// Annotate the CommonJS export names for ESM import in node:
|