@glissandoo/lib 1.102.19 → 1.102.21

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.
@@ -102,6 +102,8 @@ export declare enum FbFunctionName {
102
102
  MiscScheduledFirestoreExport = "misc-scheduledFirestoreExport",
103
103
  MiscValidateUsername = "misc-validateUsername",
104
104
  NotificationMarkAllAsReaded = "notification-markAllAsReaded",
105
+ NotificationMarkAllAsReadedByGroup = "notification-markAllAsReadedByGroup",
106
+ NotificationRemoveAllByGroup = "notification-removeAllByGroup",
105
107
  OfferApplicantAdd = "offerApplicant-add",
106
108
  OfferApplicantEdit = "offerApplicant-edit",
107
109
  OfferApplicantRemove = "offerApplicant-remove",
@@ -106,6 +106,8 @@ var FbFunctionName;
106
106
  FbFunctionName["MiscScheduledFirestoreExport"] = "misc-scheduledFirestoreExport";
107
107
  FbFunctionName["MiscValidateUsername"] = "misc-validateUsername";
108
108
  FbFunctionName["NotificationMarkAllAsReaded"] = "notification-markAllAsReaded";
109
+ FbFunctionName["NotificationMarkAllAsReadedByGroup"] = "notification-markAllAsReadedByGroup";
110
+ FbFunctionName["NotificationRemoveAllByGroup"] = "notification-removeAllByGroup";
109
111
  FbFunctionName["OfferApplicantAdd"] = "offerApplicant-add";
110
112
  FbFunctionName["OfferApplicantEdit"] = "offerApplicant-edit";
111
113
  FbFunctionName["OfferApplicantRemove"] = "offerApplicant-remove";
@@ -170,6 +170,8 @@ const regionByFunctions = {
170
170
  [index_1.FbFunctionName.UserRemove]: GCloudRegions.EuropeWest6,
171
171
  [index_1.FbFunctionName.UserGroupOnDelete]: GCloudRegions.EuropeWest6,
172
172
  [index_1.FbFunctionName.UserSendYearWrapped]: GCloudRegions.EuropeWest6,
173
+ [index_1.FbFunctionName.NotificationRemoveAllByGroup]: GCloudRegions.EuropeWest6,
174
+ [index_1.FbFunctionName.NotificationMarkAllAsReadedByGroup]: GCloudRegions.EuropeWest6,
173
175
  [index_1.FbFunctionName.WebhookEventOnCreate]: GCloudRegions.EuropeWest6,
174
176
  [index_1.FbFunctionName.WebhookGocardless]: GCloudRegions.EuropeWest6,
175
177
  [index_1.FbFunctionName.WebhookMessagebird]: GCloudRegions.EuropeWest6,
@@ -0,0 +1,10 @@
1
+ export declare namespace UserNotificationFbFunctionsTypes {
2
+ interface MarkAllAsReadedByGroupParams {
3
+ groupId: string;
4
+ }
5
+ type MarkAllAsReadedByGroupResult = void;
6
+ interface RemoveAllByGroupParams {
7
+ groupId: string;
8
+ }
9
+ type RemoveAllByGroupResult = void;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -14,8 +14,10 @@ export default class User extends UserExtended<UserData> {
14
14
  get federationId(): string | null;
15
15
  get pushToken(): string | null;
16
16
  get tokens(): string[];
17
+ /** @deprecated use totalNotifications instead */
17
18
  get notifications(): number;
18
19
  get notificationsByGroup(): Record<string, number>;
20
+ get totalNotifications(): number;
19
21
  get language(): LanguagesTypes;
20
22
  get createdAt(): FirebaseFirestore.Timestamp;
21
23
  get intercomId(): string | null;
@@ -43,12 +43,16 @@ class User extends extended_1.default {
43
43
  get tokens() {
44
44
  return this.data.tokens || [];
45
45
  }
46
+ /** @deprecated use totalNotifications instead */
46
47
  get notifications() {
47
48
  return this.data.notifications || 0;
48
49
  }
49
50
  get notificationsByGroup() {
50
51
  return this.data.notificationsByGroup || {};
51
52
  }
53
+ get totalNotifications() {
54
+ return Object.values(this.notificationsByGroup).reduce((acc, value) => acc + value, 0);
55
+ }
52
56
  get language() {
53
57
  return this.data.language || lang_1.defaultLocale;
54
58
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glissandoo/lib",
3
- "version": "1.102.19",
3
+ "version": "1.102.21",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",