@vitalfit/sdk 0.3.3 → 0.3.6
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 +86 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +56 -1
- package/dist/index.d.ts +56 -1
- package/dist/index.js +86 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -871,6 +871,7 @@ var MarketingService = class {
|
|
|
871
871
|
this.getPromotionByID = this.getPromotionByID.bind(this);
|
|
872
872
|
this.updatePromotion = this.updatePromotion.bind(this);
|
|
873
873
|
this.deletePromotion = this.deletePromotion.bind(this);
|
|
874
|
+
this.getRandomBanner = this.getRandomBanner.bind(this);
|
|
874
875
|
}
|
|
875
876
|
async createBanners(BannerData, jwt) {
|
|
876
877
|
await this.client.post({
|
|
@@ -946,6 +947,12 @@ var MarketingService = class {
|
|
|
946
947
|
jwt
|
|
947
948
|
});
|
|
948
949
|
}
|
|
950
|
+
async getRandomBanner() {
|
|
951
|
+
const response = await this.client.get({
|
|
952
|
+
url: "/marketing/banners/random"
|
|
953
|
+
});
|
|
954
|
+
return response;
|
|
955
|
+
}
|
|
949
956
|
};
|
|
950
957
|
|
|
951
958
|
// src/services/memberships.ts
|
|
@@ -1714,6 +1721,8 @@ var AccessService = class {
|
|
|
1714
1721
|
constructor(client) {
|
|
1715
1722
|
this.client = client;
|
|
1716
1723
|
this.checkIn = this.checkIn.bind(this);
|
|
1724
|
+
this.getClientAttendanceHistory = this.getClientAttendanceHistory.bind(this);
|
|
1725
|
+
this.getClientServiceUsage = this.getClientServiceUsage.bind(this);
|
|
1717
1726
|
}
|
|
1718
1727
|
async checkIn(jwt, data) {
|
|
1719
1728
|
const response = await this.client.post({
|
|
@@ -1723,6 +1732,34 @@ var AccessService = class {
|
|
|
1723
1732
|
});
|
|
1724
1733
|
return response;
|
|
1725
1734
|
}
|
|
1735
|
+
async getClientAttendanceHistory(jwt, userId, start, end, { page = 1, limit = 10, sort = "desc" } = {}) {
|
|
1736
|
+
const response = await this.client.get({
|
|
1737
|
+
url: `/clients/${userId}/attendance-history`,
|
|
1738
|
+
jwt,
|
|
1739
|
+
params: {
|
|
1740
|
+
start_date: start,
|
|
1741
|
+
end_date: end,
|
|
1742
|
+
page,
|
|
1743
|
+
limit,
|
|
1744
|
+
sort
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
return response;
|
|
1748
|
+
}
|
|
1749
|
+
async getClientServiceUsage(jwt, userId, start, end, { page = 1, limit = 10, sort = "desc" } = {}) {
|
|
1750
|
+
const response = await this.client.get({
|
|
1751
|
+
url: `/clients/${userId}/service-usage`,
|
|
1752
|
+
jwt,
|
|
1753
|
+
params: {
|
|
1754
|
+
start_date: start,
|
|
1755
|
+
end_date: end,
|
|
1756
|
+
page,
|
|
1757
|
+
limit,
|
|
1758
|
+
sort
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
return response;
|
|
1762
|
+
}
|
|
1726
1763
|
};
|
|
1727
1764
|
|
|
1728
1765
|
// src/services/reports.ts
|
|
@@ -2292,6 +2329,52 @@ var AuditService = class {
|
|
|
2292
2329
|
}
|
|
2293
2330
|
};
|
|
2294
2331
|
|
|
2332
|
+
// src/services/notifications.ts
|
|
2333
|
+
var NotificationService = class {
|
|
2334
|
+
client;
|
|
2335
|
+
constructor(client) {
|
|
2336
|
+
this.client = client;
|
|
2337
|
+
this.getNotifications = this.getNotifications.bind(this);
|
|
2338
|
+
this.getUnreadCount = this.getUnreadCount.bind(this);
|
|
2339
|
+
this.markAsRead = this.markAsRead.bind(this);
|
|
2340
|
+
this.markAllAsRead = this.markAllAsRead.bind(this);
|
|
2341
|
+
this.sendBroadcast = this.sendBroadcast.bind(this);
|
|
2342
|
+
}
|
|
2343
|
+
async getNotifications(jwt) {
|
|
2344
|
+
const response = await this.client.get({
|
|
2345
|
+
url: "/notifications",
|
|
2346
|
+
jwt
|
|
2347
|
+
});
|
|
2348
|
+
return response;
|
|
2349
|
+
}
|
|
2350
|
+
async getUnreadCount(jwt) {
|
|
2351
|
+
const response = await this.client.get({
|
|
2352
|
+
url: "/notifications/unread-count",
|
|
2353
|
+
jwt
|
|
2354
|
+
});
|
|
2355
|
+
return response;
|
|
2356
|
+
}
|
|
2357
|
+
async markAsRead(notificationId, jwt) {
|
|
2358
|
+
await this.client.patch({
|
|
2359
|
+
url: `/notifications/${notificationId}/read`,
|
|
2360
|
+
jwt
|
|
2361
|
+
});
|
|
2362
|
+
}
|
|
2363
|
+
async markAllAsRead(jwt) {
|
|
2364
|
+
await this.client.patch({
|
|
2365
|
+
url: "/notifications/read-all",
|
|
2366
|
+
jwt
|
|
2367
|
+
});
|
|
2368
|
+
}
|
|
2369
|
+
async sendBroadcast(data, jwt) {
|
|
2370
|
+
await this.client.post({
|
|
2371
|
+
url: "/notifications/broadcast",
|
|
2372
|
+
jwt,
|
|
2373
|
+
data
|
|
2374
|
+
});
|
|
2375
|
+
}
|
|
2376
|
+
};
|
|
2377
|
+
|
|
2295
2378
|
// src/types/auth.ts
|
|
2296
2379
|
var UserGender = /* @__PURE__ */ ((UserGender2) => {
|
|
2297
2380
|
UserGender2["male"] = "male";
|
|
@@ -2417,6 +2500,7 @@ var VitalFit = class _VitalFit {
|
|
|
2417
2500
|
wishList;
|
|
2418
2501
|
policy;
|
|
2419
2502
|
audit;
|
|
2503
|
+
notification;
|
|
2420
2504
|
constructor(isDevMode, origin) {
|
|
2421
2505
|
this.client = new Client(isDevMode, origin);
|
|
2422
2506
|
this.auth = new AuthService(this.client);
|
|
@@ -2440,6 +2524,7 @@ var VitalFit = class _VitalFit {
|
|
|
2440
2524
|
this.wishList = new WishListService(this.client);
|
|
2441
2525
|
this.policy = new PolicyService(this.client);
|
|
2442
2526
|
this.audit = new AuditService(this.client);
|
|
2527
|
+
this.notification = new NotificationService(this.client);
|
|
2443
2528
|
}
|
|
2444
2529
|
static getInstance(isDevMode = false) {
|
|
2445
2530
|
if (!_VitalFit.instance) {
|
|
@@ -2448,7 +2533,7 @@ var VitalFit = class _VitalFit {
|
|
|
2448
2533
|
return _VitalFit.instance;
|
|
2449
2534
|
}
|
|
2450
2535
|
version() {
|
|
2451
|
-
return "0.3.
|
|
2536
|
+
return "0.3.6";
|
|
2452
2537
|
}
|
|
2453
2538
|
};
|
|
2454
2539
|
// Annotate the CommonJS export names for ESM import in node:
|