@pulsecharterconnect/types 0.2.92 → 0.2.94

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.
@@ -186,7 +186,7 @@ export interface IParticipantGroup {
186
186
  id: string;
187
187
  name: string;
188
188
  description?: string;
189
- organizationid: string;
189
+ organizationId: string;
190
190
  participantIds: string[];
191
191
  }
192
192
  export interface ITripParticipant {
@@ -3,6 +3,7 @@ export type NotificationSettings = {
3
3
  text: boolean;
4
4
  voice: boolean;
5
5
  inApp: boolean;
6
+ snoozeUntil?: number;
6
7
  };
7
8
  export declare enum Role {
8
9
  SUPER_ADMIN = "Super Admin",
@@ -90,6 +91,7 @@ export declare class User implements IUser {
90
91
  createdAt?: number;
91
92
  updatedAt?: number;
92
93
  constructor({ id, workOsId, primaryEmail, secondaryEmail, firstName, lastName, title, primaryPhoneNumber, secondaryPhoneNumber, privacyAgreedOnDate, termsAgreedOnDate, organizationId, role, addedByUserId, addedOnDate, lastLoginDate, notificationSettings, verifiedEmail, status, chatToken, chatUserId, sidebarItems, createdAt, updatedAt, }: IUser);
94
+ isAvailableForNotifications(): boolean;
93
95
  }
94
96
  export declare class ResetPassword {
95
97
  token: string;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ResetPassword = exports.User = exports.UserStatus = exports.SidebarItemType = exports.UserPermissions = exports.Role = void 0;
4
+ const luxon_1 = require("luxon");
4
5
  var Role;
5
6
  (function (Role) {
6
7
  Role["SUPER_ADMIN"] = "Super Admin";
@@ -57,6 +58,7 @@ class User {
57
58
  text: notificationSettings.text || false,
58
59
  voice: notificationSettings.voice || false,
59
60
  inApp: notificationSettings.inApp || true,
61
+ snoozeUntil: notificationSettings.snoozeUntil || 0,
60
62
  };
61
63
  this.verifiedEmail = verifiedEmail || false;
62
64
  this.status = status || UserStatus.CREATED;
@@ -66,6 +68,12 @@ class User {
66
68
  this.createdAt = createdAt;
67
69
  this.updatedAt = updatedAt;
68
70
  }
71
+ isAvailableForNotifications() {
72
+ const now = luxon_1.DateTime.now().toMillis();
73
+ return (this.status === UserStatus.ACTIVE &&
74
+ (!this.notificationSettings.snoozeUntil ||
75
+ this.notificationSettings.snoozeUntil < now));
76
+ }
69
77
  }
70
78
  exports.User = User;
71
79
  class ResetPassword {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pulsecharterconnect/types",
3
- "version": "0.2.92",
3
+ "version": "0.2.94",
4
4
  "description": "A TypeScript library for enhanced type safety.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",