@glissandoo/lib 1.102.19 → 1.102.20

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.
@@ -159,6 +159,8 @@ export declare enum FbFunctionName {
159
159
  UserRemove = "user-remove",
160
160
  UserSendYearWrapped = "user-sendYearWrapped",
161
161
  UserGroupOnDelete = "userGroup-onDelete",
162
+ UserNotificationMarkAllAsReadedByGroup = "userNotification-markAllAsReadedByGroup",
163
+ UserNotificationRemoveAllByGroup = "userNotification-removeAllByGroup",
162
164
  WebhookEventOnCreate = "webhookEvent-onCreate",
163
165
  WebhookGocardless = "webhook-gocardless",
164
166
  WebhookMessagebird = "webhook-messagebird",
@@ -163,6 +163,8 @@ var FbFunctionName;
163
163
  FbFunctionName["UserRemove"] = "user-remove";
164
164
  FbFunctionName["UserSendYearWrapped"] = "user-sendYearWrapped";
165
165
  FbFunctionName["UserGroupOnDelete"] = "userGroup-onDelete";
166
+ FbFunctionName["UserNotificationMarkAllAsReadedByGroup"] = "userNotification-markAllAsReadedByGroup";
167
+ FbFunctionName["UserNotificationRemoveAllByGroup"] = "userNotification-removeAllByGroup";
166
168
  FbFunctionName["WebhookEventOnCreate"] = "webhookEvent-onCreate";
167
169
  FbFunctionName["WebhookGocardless"] = "webhook-gocardless";
168
170
  FbFunctionName["WebhookMessagebird"] = "webhook-messagebird";
@@ -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.UserNotificationRemoveAllByGroup]: GCloudRegions.EuropeWest6,
174
+ [index_1.FbFunctionName.UserNotificationMarkAllAsReadedByGroup]: 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.20",
4
4
  "description": "Glissandoo library js",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",