@vitalfit/sdk 0.2.1 → 0.2.3
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 +49 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -1
- package/dist/index.d.ts +24 -1
- package/dist/index.js +49 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1571,6 +1571,7 @@ var ReportService = class {
|
|
|
1571
1571
|
this.activityHeatmap = this.activityHeatmap.bind(this);
|
|
1572
1572
|
this.classOccupancyChart = this.classOccupancyChart.bind(this);
|
|
1573
1573
|
this.financialSummary = this.financialSummary.bind(this);
|
|
1574
|
+
this.salesByDemography = this.salesByDemography.bind(this);
|
|
1574
1575
|
}
|
|
1575
1576
|
async mostUsedServices(jwt, start, end) {
|
|
1576
1577
|
const response = await this.client.get({
|
|
@@ -1894,6 +1895,19 @@ var ReportService = class {
|
|
|
1894
1895
|
});
|
|
1895
1896
|
return response;
|
|
1896
1897
|
}
|
|
1898
|
+
async salesByDemography(jwt, branchId, dimension, start, end) {
|
|
1899
|
+
const response = await this.client.get({
|
|
1900
|
+
url: "/reports/charts/sales-by-demographics",
|
|
1901
|
+
jwt,
|
|
1902
|
+
params: {
|
|
1903
|
+
dimension,
|
|
1904
|
+
...start ? { start } : {},
|
|
1905
|
+
...end ? { end } : {},
|
|
1906
|
+
...branchId ? { branch_id: branchId } : {}
|
|
1907
|
+
}
|
|
1908
|
+
});
|
|
1909
|
+
return response;
|
|
1910
|
+
}
|
|
1897
1911
|
};
|
|
1898
1912
|
|
|
1899
1913
|
// src/services/staff.ts
|
|
@@ -2003,6 +2017,38 @@ var WishListService = class {
|
|
|
2003
2017
|
}
|
|
2004
2018
|
};
|
|
2005
2019
|
|
|
2020
|
+
// src/services/policies.ts
|
|
2021
|
+
var PolicyService = class {
|
|
2022
|
+
client;
|
|
2023
|
+
constructor(client) {
|
|
2024
|
+
this.client = client;
|
|
2025
|
+
this.getPolicies = this.getPolicies.bind(this);
|
|
2026
|
+
this.getPolicyByID = this.getPolicyByID.bind(this);
|
|
2027
|
+
this.updatePolicy = this.updatePolicy.bind(this);
|
|
2028
|
+
}
|
|
2029
|
+
async getPolicies(jwt) {
|
|
2030
|
+
const response = await this.client.get({
|
|
2031
|
+
url: "/policies",
|
|
2032
|
+
jwt
|
|
2033
|
+
});
|
|
2034
|
+
return response;
|
|
2035
|
+
}
|
|
2036
|
+
async getPolicyByID(policyId, jwt) {
|
|
2037
|
+
const response = await this.client.get({
|
|
2038
|
+
url: `/policies/${policyId}`,
|
|
2039
|
+
jwt
|
|
2040
|
+
});
|
|
2041
|
+
return response;
|
|
2042
|
+
}
|
|
2043
|
+
async updatePolicy(policyId, data, jwt) {
|
|
2044
|
+
await this.client.put({
|
|
2045
|
+
url: `/policies/${policyId}`,
|
|
2046
|
+
jwt,
|
|
2047
|
+
data
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
};
|
|
2051
|
+
|
|
2006
2052
|
// src/types/auth.ts
|
|
2007
2053
|
var UserGender = /* @__PURE__ */ ((UserGender2) => {
|
|
2008
2054
|
UserGender2["male"] = "male";
|
|
@@ -2126,6 +2172,7 @@ var VitalFit = class _VitalFit {
|
|
|
2126
2172
|
report;
|
|
2127
2173
|
staff;
|
|
2128
2174
|
wishList;
|
|
2175
|
+
policy;
|
|
2129
2176
|
constructor(isDevMode, origin) {
|
|
2130
2177
|
this.client = new Client(isDevMode, origin);
|
|
2131
2178
|
this.auth = new AuthService(this.client);
|
|
@@ -2147,6 +2194,7 @@ var VitalFit = class _VitalFit {
|
|
|
2147
2194
|
this.report = new ReportService(this.client);
|
|
2148
2195
|
this.staff = new StaffService(this.client);
|
|
2149
2196
|
this.wishList = new WishListService(this.client);
|
|
2197
|
+
this.policy = new PolicyService(this.client);
|
|
2150
2198
|
}
|
|
2151
2199
|
static getInstance(isDevMode = false) {
|
|
2152
2200
|
if (!_VitalFit.instance) {
|
|
@@ -2155,7 +2203,7 @@ var VitalFit = class _VitalFit {
|
|
|
2155
2203
|
return _VitalFit.instance;
|
|
2156
2204
|
}
|
|
2157
2205
|
version() {
|
|
2158
|
-
return "0.2.
|
|
2206
|
+
return "0.2.3";
|
|
2159
2207
|
}
|
|
2160
2208
|
};
|
|
2161
2209
|
// Annotate the CommonJS export names for ESM import in node:
|