From 00a993f0c66095544b1169bb4123f3e3e33c013c Mon Sep 17 00:00:00 2001 From: Shawn Jackson Date: Wed, 12 Mar 2025 16:15:22 -0700 Subject: [PATCH] CU-8687aj3gt Working on more Novu push work --- Core/Resgrid.Config/ChatConfig.cs | 3 + .../Providers/Models/INovuProvider.cs | 3 + Core/Resgrid.Services/PushService.cs | 14 +- .../NovuProvider.cs | 53 +- .../Controllers/v4/DevicesController.cs | 9 +- .../Models/v4/Device/PushRegistrationInput.cs | 5 + .../Resgrid.Web.Services.xml | 1087 +++++++++-------- Web/Resgrid.WebCore/wwwroot/js/ng/vendor.js | 262 ++-- .../Logic/SystemQueueLogic.cs | 30 - 9 files changed, 758 insertions(+), 708 deletions(-) diff --git a/Core/Resgrid.Config/ChatConfig.cs b/Core/Resgrid.Config/ChatConfig.cs index 1df0898a8..1ccfdb2cf 100644 --- a/Core/Resgrid.Config/ChatConfig.cs +++ b/Core/Resgrid.Config/ChatConfig.cs @@ -9,5 +9,8 @@ public static class ChatConfig public static string NovuEnvironmentId = ""; public static string NovuApplicationId = ""; public static string NovuSecretKey = ""; + + public static string NovuUnitFcmProviderId = ""; + public static string NovuResponderFcmProviderId = ""; } } diff --git a/Core/Resgrid.Model/Providers/Models/INovuProvider.cs b/Core/Resgrid.Model/Providers/Models/INovuProvider.cs index c41f3b499..d7642228b 100644 --- a/Core/Resgrid.Model/Providers/Models/INovuProvider.cs +++ b/Core/Resgrid.Model/Providers/Models/INovuProvider.cs @@ -6,4 +6,7 @@ public interface INovuProvider { Task CreateUserSubscriber(string userId, string code, int departmentId, string email, string firstName, string lastName); Task CreateUnitSubscriber(int unitId, string code, int departmentId, string unitName); + Task UpdateUserSubscriberFcm(string userId, string code, string token); + Task UpdateUnitSubscriberFcm(int unitId, string code, string token); + } diff --git a/Core/Resgrid.Services/PushService.cs b/Core/Resgrid.Services/PushService.cs index b4e602b20..d457c8395 100644 --- a/Core/Resgrid.Services/PushService.cs +++ b/Core/Resgrid.Services/PushService.cs @@ -17,14 +17,17 @@ public class PushService : IPushService private readonly INotificationProvider _notificationProvider; private readonly IUnitNotificationProvider _unitNotificationProvider; private readonly IUserProfileService _userProfileService; + private readonly INovuProvider _novuProvider; public PushService(IPushLogsService pushLogsService, INotificationProvider notificationProvider, - IUserProfileService userProfileService, IUnitNotificationProvider unitNotificationProvider) + IUserProfileService userProfileService, IUnitNotificationProvider unitNotificationProvider, + INovuProvider novuProvider) { _pushLogsService = pushLogsService; _notificationProvider = notificationProvider; _userProfileService = userProfileService; _unitNotificationProvider = unitNotificationProvider; + _novuProvider = novuProvider; } public async Task Register(PushUri pushUri) @@ -37,7 +40,7 @@ public async Task Register(PushUri pushUri) // We just store the full Device Id in the PushUri object, the hashed version is for Azure //var existingPushUri = _pushUriService.GetPushUriByPlatformDeviceId((Platforms)pushUri.PlatformType, pushUri.DeviceId); List usersDevices = null; - + try { usersDevices = await _notificationProvider.GetRegistrationsByUserId(pushUri.UserId); @@ -78,6 +81,9 @@ public async Task RegisterUnit(PushUri pushUri) catch (TimeoutException) { } + if (pushUri.UnitId.HasValue) + await _novuProvider.UpdateUnitSubscriberFcm(pushUri.UnitId.Value, pushUri.PushLocation, pushUri.DeviceId); + if (usersDevices == null || !usersDevices.Any(x => x.Tags.Contains(string.Format("unitId:{0}", pushUri.UnitId.ToString())))) await _unitNotificationProvider.RegisterPush(pushUri); @@ -161,7 +167,7 @@ public async Task PushCall(StandardPushCall call, string userId, UserProfi if (profile != null && profile.SendPush) await _notificationProvider.SendAllNotifications(call.SubTitle, call.Title, userId, string.Format("C{0}", call.CallId), ConvertCallPriorityToSound((int)call.Priority, priority), true, call.ActiveCallCount, color); - + return true; } @@ -236,7 +242,7 @@ private byte[] ReadResource(string fileName) // var exception = (PushSharp.WindowsPhone.WindowsPhoneNotificationSendFailureException) notificationFailureException; // _pushLogsService.LogPushResult(exception.MessageStatus.DeviceConnectionStatus.ToString(), // exception.MessageStatus.HttpStatus.ToString(), exception.MessageStatus.MessageID.ToString(), - // exception.MessageStatus.NotificationStatus.ToString(), exception.MessageStatus.SubscriptionStatus.ToString(), + // exception.MessageStatus.NotificationStatus.ToString(), exception.MessageStatus.SubscriptionStatus.ToString(), // exception.MessageStatus.Notification.EndPointUrl, exception); // //Console.WriteLine("Failure: " + notification.Platform.ToString() + " -> " + notificationFailureException.Message + " -> " + notification.ToString()); diff --git a/Providers/Resgrid.Providers.Messaging/NovuProvider.cs b/Providers/Resgrid.Providers.Messaging/NovuProvider.cs index e46e52a5b..48538e357 100644 --- a/Providers/Resgrid.Providers.Messaging/NovuProvider.cs +++ b/Providers/Resgrid.Providers.Messaging/NovuProvider.cs @@ -1,5 +1,8 @@ -using Novu; +using System.Text; +using Newtonsoft.Json; +using Novu; using Novu.Domain.Models.Subscribers; +using Resgrid.Config; using Resgrid.Framework; using Resgrid.Model.Providers; using static Resgrid.Framework.Testing.TestData; @@ -55,5 +58,53 @@ public async Task CreateUnitSubscriber(int unitId, string code, int depart { return await CreateSubscriber($"{code}_Unit_{unitId}", departmentId, $"{code}_Unit_{unitId}@units.resgrid.net", unitName, ""); } + + private async Task UpdateSubscriberFcm(string id, string token, string fcmId) + { + try + { + using (HttpClient client = new HttpClient()) + { + var url = $"${ChatConfig.NovuBackendUrl}v1/subscribers/{id}/credentials"; + var request = new HttpRequestMessage(HttpMethod.Put, url); + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Authorization", $"ApiKey {ChatConfig.NovuSecretKey}"); + + var payload = new + { + providerId = "fcm", + credentials = new + { + deviceTokens = new string[] { token } + }, + integrationIdentifier = fcmId + }; + string jsonContent = JsonConvert.SerializeObject(payload); + + request.Content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); + HttpResponseMessage response = await client.SendAsync(request); + + if (response.IsSuccessStatusCode) + return true; + else + return false; + } + } + catch (Exception e) + { + Logging.LogException(e, "Failed to add fcm token to novu subscriber"); + return false; + } + } + + public async Task UpdateUserSubscriberFcm(string userId, string code, string token) + { + return await UpdateSubscriberFcm($"{code}_User_{userId}", token, ChatConfig.NovuResponderFcmProviderId); + } + + public async Task UpdateUnitSubscriberFcm(int unitId, string code, string token) + { + return await UpdateSubscriberFcm($"{code}_Unit_{unitId}", token, ChatConfig.NovuUnitFcmProviderId); + } } } diff --git a/Web/Resgrid.Web.ServicesCore/Controllers/v4/DevicesController.cs b/Web/Resgrid.Web.ServicesCore/Controllers/v4/DevicesController.cs index 2463745cb..bd0a731c7 100644 --- a/Web/Resgrid.Web.ServicesCore/Controllers/v4/DevicesController.cs +++ b/Web/Resgrid.Web.ServicesCore/Controllers/v4/DevicesController.cs @@ -53,11 +53,18 @@ public async Task> RegisterUnitDevice([From if (registrationInput == null) return BadRequest(); + + PushRegisterionEvent pushRegisterionEvent = new PushRegisterionEvent(); pushRegisterionEvent.PushUriId = 0; pushRegisterionEvent.UserId = UserId; pushRegisterionEvent.PlatformType = registrationInput.Platform; - pushRegisterionEvent.PushLocation = ""; + + if (!string.IsNullOrWhiteSpace(registrationInput.Prefix)) + pushRegisterionEvent.PushLocation = registrationInput.Prefix; + else + pushRegisterionEvent.PushLocation = ""; + pushRegisterionEvent.DepartmentId = DepartmentId; pushRegisterionEvent.DeviceId = registrationInput.Token; pushRegisterionEvent.Uuid = registrationInput.DeviceUuid; diff --git a/Web/Resgrid.Web.ServicesCore/Models/v4/Device/PushRegistrationInput.cs b/Web/Resgrid.Web.ServicesCore/Models/v4/Device/PushRegistrationInput.cs index 78f6a2ca3..847f0183f 100644 --- a/Web/Resgrid.Web.ServicesCore/Models/v4/Device/PushRegistrationInput.cs +++ b/Web/Resgrid.Web.ServicesCore/Models/v4/Device/PushRegistrationInput.cs @@ -24,5 +24,10 @@ public class PushRegistrationInput /// Device UDID /// public string DeviceUuid { get; set; } + + /// + /// Prefix + /// + public string Prefix { get; set; } } } diff --git a/Web/Resgrid.Web.ServicesCore/Resgrid.Web.Services.xml b/Web/Resgrid.Web.ServicesCore/Resgrid.Web.Services.xml index df703ed1f..f1b17795d 100644 --- a/Web/Resgrid.Web.ServicesCore/Resgrid.Web.Services.xml +++ b/Web/Resgrid.Web.ServicesCore/Resgrid.Web.Services.xml @@ -2425,6 +2425,52 @@ Is the user a group admin + + + UserId (GUID/UUID) of the User to set. This field will be ignored if the input is used on a + function that is setting status for the current user. + + + + + The state/staffing level of the user to set for the user. + + + + + Note for the staffing level + + + + + The result object for a state/staffing level request. + + + + + The UserId GUID/UUID for the user state/staffing level being return + + + + + The full name of the user for the state/staffing level being returned + + + + + The current staffing level (state) type for the user + + + + + The timestamp of the last state/staffing level. This is converted UTC to the departments, or users, TimeZone. + + + + + Staffing note for the User's staffing + + Input data to add a staffing schedule in the Resgrid system @@ -2530,52 +2576,6 @@ Note for this staffing schedule - - - UserId (GUID/UUID) of the User to set. This field will be ignored if the input is used on a - function that is setting status for the current user. - - - - - The state/staffing level of the user to set for the user. - - - - - Note for the staffing level - - - - - The result object for a state/staffing level request. - - - - - The UserId GUID/UUID for the user state/staffing level being return - - - - - The full name of the user for the state/staffing level being returned - - - - - The current staffing level (state) type for the user - - - - - The timestamp of the last state/staffing level. This is converted UTC to the departments, or users, TimeZone. - - - - - Staffing note for the User's staffing - - A resrouce in the system this could be a user or unit @@ -5493,6 +5493,11 @@ Device UDID + + + Prefix + + Depicts a request to register for push notifications @@ -6328,207 +6333,372 @@ Identifier of the new npte - + - A GPS location for a point in time of a specificed person + The result of getting all personnel filters for the system - + - PersonId of the person that the location is for + The Id value of the filter - + - The timestamp of the location in UTC + The type of the filter - + - GPS Latitude of the Person + The filters name - + - GPS Longitude of the Person + Result containing all the data required to populate the New Call form - + - GPS Latitude\Longitude Accuracy of the Person + Response Data - + - GPS Altitude of the Person + Result that contains all the options available to filter personnel against compatible Resgrid APIs - + - GPS Altitude Accuracy of the Person + Response Data - + - GPS Speed of the Person + Result containing all the data required to populate the New Call form - + - GPS Heading of the Person + Response Data - + - A unit location in the Resgrid system + Information about a User - + - Response Data + The UserId GUID/UUID for the user - + - The information about a specific unit's location + DepartmentId of the deparment the user belongs to - + - Id of the Person + Department specificed ID number for this user - + - The Timestamp for the location in UTC + The Users First Name - + - GPS Latitude of the Person + The Users Last Name - + - GPS Longitude of the Person + The Users Email Address - + - GPS Latitude\Longitude Accuracy of the Person + The Users Mobile Telephone Number - + - GPS Altitude of the Person + GroupId the user is assigned to (0 for no group) - + - GPS Altitude Accuracy of the Person + Name of the group the user is assigned to - + - GPS Speed of the Person + Enumeration/List of roles the user currently holds - + - GPS Heading of the Person + The current action/status type for the user - + - The result of getting the current staffing for a user + The current action/status string for the user - + - Response Data + The current action/status color hex string for the user - + - Information about a User staffing + The timestamp of the last action. This is converted UTC to the departments, or users, TimeZone. - + - The UserId GUID/UUID for the user status being return + The current action/status destination id for the user - + - DepartmentId of the deparment the user belongs to + The current action/status destination name for the user - + - The current staffing type for the user + The current staffing level (state) type for the user - + - The timestamp of the last staffing. This is converted UTC version of the timestamp. + The current staffing level (state) string for the user - + - The timestamp of the last staffing. This is converted UTC to the departments, or users, TimeZone. + The current staffing level (state) color hex string for the user - + - Note for this staffing + The timestamp of the last state/staffing level. This is converted UTC to the departments, or users, TimeZone. - + - Saves (sets) and Personnel Staffing in the system, for a single user + Users last known location - + - UnitId of the apparatus that the state is being set for + Sorting weight for the user - + - The UnitStateType of the Unit + A GPS location for a point in time of a specificed person - + - The timestamp of the status event in UTC + PersonId of the person that the location is for - + - The timestamp of the status event in the local time of the device + The timestamp of the location in UTC - + - User provided note for this event + GPS Latitude of the Person - + - The event id used for queuing on mobile applications + GPS Longitude of the Person - + - Depicts a result after saving a person status + GPS Latitude\Longitude Accuracy of the Person - + - Response Data + GPS Altitude of the Person - + + + GPS Altitude Accuracy of the Person + + + + + GPS Speed of the Person + + + + + GPS Heading of the Person + + + + + A unit location in the Resgrid system + + + + + Response Data + + + + + The information about a specific unit's location + + + + + Id of the Person + + + + + The Timestamp for the location in UTC + + + + + GPS Latitude of the Person + + + + + GPS Longitude of the Person + + + + + GPS Latitude\Longitude Accuracy of the Person + + + + + GPS Altitude of the Person + + + + + GPS Altitude Accuracy of the Person + + + + + GPS Speed of the Person + + + + + GPS Heading of the Person + + + + + The result of getting the current staffing for a user + + + + + Response Data + + + + + Information about a User staffing + + + + + The UserId GUID/UUID for the user status being return + + + + + DepartmentId of the deparment the user belongs to + + + + + The current staffing type for the user + + + + + The timestamp of the last staffing. This is converted UTC version of the timestamp. + + + + + The timestamp of the last staffing. This is converted UTC to the departments, or users, TimeZone. + + + + + Note for this staffing + + + + + Saves (sets) and Personnel Staffing in the system, for a single user + + + + + UnitId of the apparatus that the state is being set for + + + + + The UnitStateType of the Unit + + + + + The timestamp of the status event in UTC + + + + + The timestamp of the status event in the local time of the device + + + + + User provided note for this event + + + + + The event id used for queuing on mobile applications + + + + + Depicts a result after saving a person status + + + + + Response Data + + + Saves (sets) and Personnel Status in the system, for a single user @@ -6803,282 +6973,117 @@ Response Data - + - The result of getting all personnel filters for the system + Result containing all the data required to populate the New Call form - + - The Id value of the filter + Response Data - + - The type of the filter + Details of a protocol - + - The filters name + Protocol id - + - Result containing all the data required to populate the New Call form + Department id - + - Response Data + Name of the Protocol - + - Result that contains all the options available to filter personnel against compatible Resgrid APIs + Protocol code - + - Response Data + This this protocol disabled - + - Result containing all the data required to populate the New Call form + Protocol description - + - Response Data + Text of the protocol - + - Information about a User + UTC date and time when the Protocol was created - + - The UserId GUID/UUID for the user + UserId of the user who created the protocol - + - DepartmentId of the deparment the user belongs to + UTC timestamp of when the Protocol was updated - + - Department specificed ID number for this user + Minimum triggering Weight of the Protocol - + - The Users First Name + UserId that last updated the Protocol - + - The Users Last Name + Triggers used to activate this Protocol - + - The Users Email Address + Attachments for this Protocol - + - The Users Mobile Telephone Number + Questions used to determine if this Protocol needs to be used or not - + - GroupId the user is assigned to (0 for no group) + State type - + - Name of the group the user is assigned to + Result containing all the data required to populate the New Call form - + - Enumeration/List of roles the user currently holds + Response Data - + - The current action/status type for the user + A role in the Resgrid system - - - The current action/status string for the user - - - - - The current action/status color hex string for the user - - - - - The timestamp of the last action. This is converted UTC to the departments, or users, TimeZone. - - - - - The current action/status destination id for the user - - - - - The current action/status destination name for the user - - - - - The current staffing level (state) type for the user - - - - - The current staffing level (state) string for the user - - - - - The current staffing level (state) color hex string for the user - - - - - The timestamp of the last state/staffing level. This is converted UTC to the departments, or users, TimeZone. - - - - - Users last known location - - - - - Sorting weight for the user - - - - - Result containing all the data required to populate the New Call form - - - - - Response Data - - - - - Details of a protocol - - - - - Protocol id - - - - - Department id - - - - - Name of the Protocol - - - - - Protocol code - - - - - This this protocol disabled - - - - - Protocol description - - - - - Text of the protocol - - - - - UTC date and time when the Protocol was created - - - - - UserId of the user who created the protocol - - - - - UTC timestamp of when the Protocol was updated - - - - - Minimum triggering Weight of the Protocol - - - - - UserId that last updated the Protocol - - - - - Triggers used to activate this Protocol - - - - - Attachments for this Protocol - - - - - Questions used to determine if this Protocol needs to be used or not - - - - - State type - - - - - Result containing all the data required to populate the New Call form - - - - - Response Data - - - - - A role in the Resgrid system - - - + Response Data @@ -7879,518 +7884,518 @@ Default constructor - + - Depicts a result after saving a unit status + Result that contains all the options available to filter units against compatible Resgrid APIs - + Response Data - + - Object inputs for setting a users Status/Action. If this object is used in an operation that sets - a status for the current user the UserId value in this object will be ignored. + A unit in the Resgrid system - + - UnitId of the apparatus that the state is being set for + Response Data - + - The UnitStateType of the Unit + The information about a specific unit - + - The Call/Station the unit is responding to + Id of the Unit - + - The timestamp of the status event in UTC + The Id of the department the unit is under - + - The timestamp of the status event in the local time of the device + Name of the Unit - + - User provided note for this event + Department assigned type for the unit - + - GPS Latitude of the Unit + Department assigned type id for the unit - + - GPS Longitude of the Unit + Custom Statuses Set Id - + - GPS Latitude\Longitude Accuracy of the Unit + Station Id of the station housing the unit (0 means no station) - + - GPS Altitude of the Unit + Name of the station the unit is under - + - GPS Altitude Accuracy of the Unit + Vehicle Identification Number for the unit - + - GPS Speed of the Unit + Plate Number for the Unit - + - GPS Heading of the Unit + Is the unit 4-Wheel drive - + - The event id used for queuing on mobile applications + Does the unit require a special permit to drive - + - The accountability roles filed for this event + Id number of the units current destionation (0 means no destination) - + - Role filled by a User on a Unit for an event + The current status/state of the Unit - + - Id of the locally stored event + The Timestamp of the status - + - Local Event Id + The units current Latitude - + - UserId of the user filling the role + The units current Longitude - + - RoleId of the role being filled + Current user provide status note - + - The name of the Role + Unit role information for roles on a unit - + - Depicts a unit status in the Resgrid system. + Unit Role Id - + - Response Data + User Id of the user in the role (could be null) - + - Depicts a unit's status + Name of the Role - + - Unit Id + Name of the user in the role (could be null) - + - Units Name + Multiple Unit infos Result - + - The Type of the Unit + Response Data - + - Units current Status (State) + Default constructor - + - CSS for status (for display) + The information about a specific unit - + - CSS Style for status (for display) + Id of the Unit - + - Timestamp of this Unit State + The Id of the department the unit is under - + - Timestamp in Utc of this Unit State + Name of the Unit - + - Destination Id (Station or Call) + Department assigned type for the unit - + - Name of the Desination (Call or Station) + Department assigned type id for the unit - + - Note for the State + Custom Statuses Set Id - + - Latitude + Station Id of the station housing the unit (0 means no station) - + - Longitude + Name of the station the unit is under - + - Name of the Group the Unit is in + Vehicle Identification Number for the unit - + - Id of the Group the Unit is in + Plate Number for the Unit - + - Unit statuses (states) + Is the unit 4-Wheel drive - + - Response Data + Does the unit require a special permit to drive - + - Default constructor + Id number of the units current destination (0 means no destination) - + - Result that contains all the options available to filter units against compatible Resgrid APIs + Name of the units current destination (0 means no destination) - + - Response Data + The current status/state of the Unit - + - A unit in the Resgrid system + The current status/state of the Unit as a name - + - Response Data + The current status/state of the Unit color - + - The information about a specific unit + The Timestamp of the status - + - Id of the Unit + The Timestamp of the status in UTC/GMT - + - The Id of the department the unit is under + The units current Latitude - + - Name of the Unit + The units current Longitude - + - Department assigned type for the unit + Current user provide status note - + - Department assigned type id for the unit + Units Roles - + - Custom Statuses Set Id + Multiple Units Result - + - Station Id of the station housing the unit (0 means no station) + Response Data - + - Name of the station the unit is under + Default constructor - + - Vehicle Identification Number for the unit + Depicts a result after saving a unit status - + - Plate Number for the Unit + Response Data - + - Is the unit 4-Wheel drive + Object inputs for setting a users Status/Action. If this object is used in an operation that sets + a status for the current user the UserId value in this object will be ignored. - + - Does the unit require a special permit to drive + UnitId of the apparatus that the state is being set for - + - Id number of the units current destionation (0 means no destination) + The UnitStateType of the Unit - + - The current status/state of the Unit + The Call/Station the unit is responding to - + - The Timestamp of the status + The timestamp of the status event in UTC - + - The units current Latitude + The timestamp of the status event in the local time of the device - + - The units current Longitude + User provided note for this event - + - Current user provide status note + GPS Latitude of the Unit - + - Unit role information for roles on a unit + GPS Longitude of the Unit - + - Unit Role Id + GPS Latitude\Longitude Accuracy of the Unit - + - User Id of the user in the role (could be null) + GPS Altitude of the Unit - + - Name of the Role + GPS Altitude Accuracy of the Unit - + - Name of the user in the role (could be null) + GPS Speed of the Unit - + - Multiple Unit infos Result + GPS Heading of the Unit - + - Response Data + The event id used for queuing on mobile applications - + - Default constructor + The accountability roles filed for this event - + - The information about a specific unit + Role filled by a User on a Unit for an event - + - Id of the Unit + Id of the locally stored event - + - The Id of the department the unit is under + Local Event Id - + - Name of the Unit + UserId of the user filling the role - + - Department assigned type for the unit + RoleId of the role being filled - + - Department assigned type id for the unit + The name of the Role - + - Custom Statuses Set Id + Depicts a unit status in the Resgrid system. - + - Station Id of the station housing the unit (0 means no station) + Response Data - + - Name of the station the unit is under + Depicts a unit's status - + - Vehicle Identification Number for the unit + Unit Id - + - Plate Number for the Unit + Units Name - + - Is the unit 4-Wheel drive + The Type of the Unit - + - Does the unit require a special permit to drive + Units current Status (State) - + - Id number of the units current destination (0 means no destination) + CSS for status (for display) - + - Name of the units current destination (0 means no destination) + CSS Style for status (for display) - + - The current status/state of the Unit + Timestamp of this Unit State - + - The current status/state of the Unit as a name + Timestamp in Utc of this Unit State - + - The current status/state of the Unit color + Destination Id (Station or Call) - + - The Timestamp of the status + Name of the Desination (Call or Station) - + - The Timestamp of the status in UTC/GMT + Note for the State - + - The units current Latitude + Latitude - + - The units current Longitude + Longitude - + - Current user provide status note + Name of the Group the Unit is in - + - Units Roles + Id of the Group the Unit is in - + - Multiple Units Result + Unit statuses (states) - + Response Data - + Default constructor diff --git a/Web/Resgrid.WebCore/wwwroot/js/ng/vendor.js b/Web/Resgrid.WebCore/wwwroot/js/ng/vendor.js index 825032199..e7ca82418 100644 --- a/Web/Resgrid.WebCore/wwwroot/js/ng/vendor.js +++ b/Web/Resgrid.WebCore/wwwroot/js/ng/vendor.js @@ -15290,6 +15290,59 @@ function getHours(dirtyDate) { /***/ }), +/***/ 8355: +/*!*******************************************************!*\ + !*** ./node_modules/date-fns/esm/getISOWeek/index.js ***! + \*******************************************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ "default": () => (/* binding */ getISOWeek) +/* harmony export */ }); +/* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ 9103); +/* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ 5556); +/* harmony import */ var _startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../startOfISOWeekYear/index.js */ 2781); +/* harmony import */ var _lib_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/requiredArgs/index.js */ 4507); + + + + +var MILLISECONDS_IN_WEEK = 604800000; + +/** + * @name getISOWeek + * @category ISO Week Helpers + * @summary Get the ISO week of the given date. + * + * @description + * Get the ISO week of the given date. + * + * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date + * + * @param {Date|Number} date - the given date + * @returns {Number} the ISO week + * @throws {TypeError} 1 argument required + * + * @example + * // Which week of the ISO-week numbering year is 2 January 2005? + * const result = getISOWeek(new Date(2005, 0, 2)) + * //=> 53 + */ +function getISOWeek(dirtyDate) { + (0,_lib_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(1, arguments); + var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); + var diff = (0,_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date).getTime() - (0,_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date).getTime(); + + // Round the number of days to the nearest integer + // because the number of milliseconds in a week is not constant + // (e.g. it's different in the week of the daylight saving time clock shift) + return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; +} + +/***/ }), + /***/ 8446: /*!***********************************************************!*\ !*** ./node_modules/date-fns/esm/getISOWeekYear/index.js ***! @@ -15350,59 +15403,6 @@ function getISOWeekYear(dirtyDate) { /***/ }), -/***/ 8355: -/*!*******************************************************!*\ - !*** ./node_modules/date-fns/esm/getISOWeek/index.js ***! - \*******************************************************/ -/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ getISOWeek) -/* harmony export */ }); -/* harmony import */ var _toDate_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../toDate/index.js */ 9103); -/* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ 5556); -/* harmony import */ var _startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../startOfISOWeekYear/index.js */ 2781); -/* harmony import */ var _lib_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/requiredArgs/index.js */ 4507); - - - - -var MILLISECONDS_IN_WEEK = 604800000; - -/** - * @name getISOWeek - * @category ISO Week Helpers - * @summary Get the ISO week of the given date. - * - * @description - * Get the ISO week of the given date. - * - * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date - * - * @param {Date|Number} date - the given date - * @returns {Number} the ISO week - * @throws {TypeError} 1 argument required - * - * @example - * // Which week of the ISO-week numbering year is 2 January 2005? - * const result = getISOWeek(new Date(2005, 0, 2)) - * //=> 53 - */ -function getISOWeek(dirtyDate) { - (0,_lib_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(1, arguments); - var date = (0,_toDate_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); - var diff = (0,_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(date).getTime() - (0,_startOfISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_3__["default"])(date).getTime(); - - // Round the number of days to the nearest integer - // because the number of milliseconds in a week is not constant - // (e.g. it's different in the week of the daylight saving time clock shift) - return Math.round(diff / MILLISECONDS_IN_WEEK) + 1; -} - -/***/ }), - /***/ 351: /*!*******************************************************!*\ !*** ./node_modules/date-fns/esm/getMinutes/index.js ***! @@ -16031,96 +16031,96 @@ function startOfDay(dirtyDate) { /***/ }), -/***/ 2781: -/*!***************************************************************!*\ - !*** ./node_modules/date-fns/esm/startOfISOWeekYear/index.js ***! - \***************************************************************/ +/***/ 5556: +/*!***********************************************************!*\ + !*** ./node_modules/date-fns/esm/startOfISOWeek/index.js ***! + \***********************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ startOfISOWeekYear) +/* harmony export */ "default": () => (/* binding */ startOfISOWeek) /* harmony export */ }); -/* harmony import */ var _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getISOWeekYear/index.js */ 8446); -/* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ 5556); +/* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfWeek/index.js */ 9935); /* harmony import */ var _lib_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/requiredArgs/index.js */ 4507); - /** - * @name startOfISOWeekYear - * @category ISO Week-Numbering Year Helpers - * @summary Return the start of an ISO week-numbering year for the given date. + * @name startOfISOWeek + * @category ISO Week Helpers + * @summary Return the start of an ISO week for the given date. * * @description - * Return the start of an ISO week-numbering year, - * which always starts 3 days before the year's first Thursday. + * Return the start of an ISO week for the given date. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|Number} date - the original date - * @returns {Date} the start of an ISO week-numbering year + * @returns {Date} the start of an ISO week * @throws {TypeError} 1 argument required * * @example - * // The start of an ISO week-numbering year for 2 July 2005: - * const result = startOfISOWeekYear(new Date(2005, 6, 2)) - * //=> Mon Jan 03 2005 00:00:00 + * // The start of an ISO week for 2 September 2014 11:55:00: + * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) + * //=> Mon Sep 01 2014 00:00:00 */ -function startOfISOWeekYear(dirtyDate) { +function startOfISOWeek(dirtyDate) { (0,_lib_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(1, arguments); - var year = (0,_getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); - var fourthOfJanuary = new Date(0); - fourthOfJanuary.setFullYear(year, 0, 4); - fourthOfJanuary.setHours(0, 0, 0, 0); - var date = (0,_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fourthOfJanuary); - return date; + return (0,_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, { + weekStartsOn: 1 + }); } /***/ }), -/***/ 5556: -/*!***********************************************************!*\ - !*** ./node_modules/date-fns/esm/startOfISOWeek/index.js ***! - \***********************************************************/ +/***/ 2781: +/*!***************************************************************!*\ + !*** ./node_modules/date-fns/esm/startOfISOWeekYear/index.js ***! + \***************************************************************/ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { -/* harmony export */ "default": () => (/* binding */ startOfISOWeek) +/* harmony export */ "default": () => (/* binding */ startOfISOWeekYear) /* harmony export */ }); -/* harmony import */ var _startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../startOfWeek/index.js */ 9935); +/* harmony import */ var _getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../getISOWeekYear/index.js */ 8446); +/* harmony import */ var _startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../startOfISOWeek/index.js */ 5556); /* harmony import */ var _lib_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../_lib/requiredArgs/index.js */ 4507); + /** - * @name startOfISOWeek - * @category ISO Week Helpers - * @summary Return the start of an ISO week for the given date. + * @name startOfISOWeekYear + * @category ISO Week-Numbering Year Helpers + * @summary Return the start of an ISO week-numbering year for the given date. * * @description - * Return the start of an ISO week for the given date. + * Return the start of an ISO week-numbering year, + * which always starts 3 days before the year's first Thursday. * The result will be in the local timezone. * * ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date * * @param {Date|Number} date - the original date - * @returns {Date} the start of an ISO week + * @returns {Date} the start of an ISO week-numbering year * @throws {TypeError} 1 argument required * * @example - * // The start of an ISO week for 2 September 2014 11:55:00: - * const result = startOfISOWeek(new Date(2014, 8, 2, 11, 55, 0)) - * //=> Mon Sep 01 2014 00:00:00 + * // The start of an ISO week-numbering year for 2 July 2005: + * const result = startOfISOWeekYear(new Date(2005, 6, 2)) + * //=> Mon Jan 03 2005 00:00:00 */ -function startOfISOWeek(dirtyDate) { +function startOfISOWeekYear(dirtyDate) { (0,_lib_requiredArgs_index_js__WEBPACK_IMPORTED_MODULE_0__["default"])(1, arguments); - return (0,_startOfWeek_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate, { - weekStartsOn: 1 - }); + var year = (0,_getISOWeekYear_index_js__WEBPACK_IMPORTED_MODULE_1__["default"])(dirtyDate); + var fourthOfJanuary = new Date(0); + fourthOfJanuary.setFullYear(year, 0, 4); + fourthOfJanuary.setHours(0, 0, 0, 0); + var date = (0,_startOfISOWeek_index_js__WEBPACK_IMPORTED_MODULE_2__["default"])(fourthOfJanuary); + return date; } /***/ }), @@ -72371,7 +72371,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ɵPRIMARY_HTTP_BACKEND": () => (/* binding */ PRIMARY_HTTP_BACKEND), /* harmony export */ "ɵwithHttpTransferCache": () => (/* binding */ withHttpTransferCache) /* harmony export */ }); -/* harmony import */ var G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204); +/* harmony import */ var _Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 7580); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 1536); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 7498); @@ -73894,7 +73894,7 @@ class FetchBackend { } doRequest(request, signal, observer) { var _this = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const init = _this.createRequestInit(request); let response; try { @@ -73948,7 +73948,7 @@ class FetchBackend { // Perform response processing outside of Angular zone to // ensure no excessive change detection runs are executed // Here calling the async ReadableStreamDefaultReader.read() is responsible for triggering CD - yield _this.ngZone.runOutsideAngular( /*#__PURE__*/(0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + yield _this.ngZone.runOutsideAngular( /*#__PURE__*/(0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { while (true) { const { done, @@ -75984,7 +75984,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ "ɵɵvalidateIframeAttribute": () => (/* binding */ ɵɵvalidateIframeAttribute), /* harmony export */ "ɵɵviewQuery": () => (/* binding */ ɵɵviewQuery) /* harmony export */ }); -/* harmony import */ var G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204); +/* harmony import */ var _Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204); /* harmony import */ var _angular_core_primitives_signals__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core/primitives/signals */ 5689); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 3119); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 2842); @@ -109664,7 +109664,7 @@ class ChangeDetectionSchedulerImpl { */ raceTimeoutAndRequestAnimationFrame() { var _this = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const timeout = new Promise(resolve => setTimeout(resolve)); const rAF = typeof _global['requestAnimationFrame'] === 'function' ? new Promise(resolve => requestAnimationFrame(() => resolve())) : null; yield Promise.race([timeout, rAF]); @@ -123074,7 +123074,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export */ WindowRef: () => (/* binding */ WindowRef), /* harmony export */ directives: () => (/* binding */ directives) /* harmony export */ }); -/* harmony import */ var G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204); +/* harmony import */ var _Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 9204); /* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 7580); /* harmony import */ var _angular_common_http__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/common/http */ 6443); /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 521); @@ -123888,7 +123888,7 @@ class StorageService { } read(key) { var _this = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this.storageProvider) { return yield _this.storageProvider.read(key); } @@ -123904,7 +123904,7 @@ class StorageService { } write(key, value) { var _this2 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this2.storageProvider) { return yield _this2.storageProvider.write(key, value); } @@ -123913,7 +123913,7 @@ class StorageService { } remove(key) { var _this3 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this3.storageProvider) { return yield _this3.storageProvider.remove(key); } @@ -123922,7 +123922,7 @@ class StorageService { } clear() { var _this4 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this4.storageProvider) { return yield _this4.storageProvider.clear(); } @@ -123994,7 +123994,7 @@ class AuthService { } logout() { var _this5 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this5.updateState({ profile: undefined, tokens: undefined @@ -124028,7 +124028,7 @@ class AuthService { } storeToken(tokens) { var _this6 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this6.logger.logDebug('storing tokens'); const previousTokens = yield _this6.retrieveTokens(); if (previousTokens != null && tokens.refresh_token == null) { @@ -124039,7 +124039,7 @@ class AuthService { } retrieveTokens() { var _this7 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { var tokens = yield _this7.storageService.read('auth-tokens'); if (tokens) { return JSON.parse(tokens); @@ -124049,7 +124049,7 @@ class AuthService { } removeToken() { var _this8 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { yield _this8.storageService.remove('auth-tokens'); })(); } @@ -124197,7 +124197,7 @@ class HttpsRequestInterceptor { } addAuthHeader(request) { var _this9 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const tokens = yield _this9.authService.retrieveTokens(); if (tokens) { const dupReq = request.clone({ @@ -124261,7 +124261,7 @@ class CacheService { } initalize() { var _this10 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this10.cacheProvider) { return yield _this10.cacheProvider.initialize(); } else { @@ -124274,7 +124274,7 @@ class CacheService { } put(data) { var _this11 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this11.cacheProvider) { data.cacheSavedOn = new Date(); const expiresOn = new Date(); @@ -124285,7 +124285,7 @@ class CacheService { } get(key) { var _this12 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this12.cacheProvider) { try { const data = yield _this12.cacheProvider.get(key); @@ -124317,7 +124317,7 @@ class CacheService { } delete(key) { var _this13 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this13.cacheProvider) { yield _this13.cacheProvider.delete(key); } @@ -124325,7 +124325,7 @@ class CacheService { } putHttpResponse(cacheKey, cacheTime, response) { var _this14 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this14.cacheProvider) { const expiresOn = new Date(); expiresOn.setMinutes(expiresOn.getMinutes() + cacheTime); @@ -124335,7 +124335,7 @@ class CacheService { } getHttpResponse(key) { var _this15 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this15.cacheProvider) { const data = yield _this15.cacheProvider.get(key); if (data && data.length > 0) { @@ -124348,7 +124348,7 @@ class CacheService { } deleteHttpResponse(key) { var _this16 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this16.cacheProvider) { yield _this16.cacheProvider.delete(key); } @@ -124594,7 +124594,7 @@ class LiveKitService { } connect(room) { var _this17 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const simulcast = false; const dynacast = true; // optimize publishing bandwidth and CPU for published tracks const forceTURN = false; @@ -124631,7 +124631,7 @@ class LiveKitService { } connectToRoom(url, token, roomOptions, connectOptions, shouldPublish) { var _this18 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this18.room = new livekit_client__WEBPACK_IMPORTED_MODULE_2__.Room(roomOptions); const startTime = Date.now(); yield _this18.room.prepareConnection(url, token); @@ -124641,7 +124641,7 @@ class LiveKitService { that.participantConnected(that, participant); }).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.Disconnected, that.handleRoomDisconnect).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.DataReceived, that.handleData).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.ParticipantDisconnected, participant => { that.renderParticipant(participant, true); - }).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.Reconnected, /*#__PURE__*/(0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {})).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.LocalTrackPublished, pub => { + }).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.Reconnected, /*#__PURE__*/(0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {})).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.LocalTrackPublished, pub => { const track = pub.track; if (track instanceof livekit_client__WEBPACK_IMPORTED_MODULE_2__.LocalAudioTrack) { const { @@ -124680,7 +124680,7 @@ class LiveKitService { }).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.TrackUnsubscribed, (_, pub, participant) => { _this18.renderParticipant(participant); //this.renderScreenShare(this.room); - }).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.SignalConnected, /*#__PURE__*/(0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + }).on(livekit_client__WEBPACK_IMPORTED_MODULE_2__.RoomEvent.SignalConnected, /*#__PURE__*/(0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { const signalConnectionTime = Date.now() - startTime; // speed up publishing by starting to publish before it's fully connected // publishing is accepted as soon as signal connection has established @@ -124954,7 +124954,7 @@ class LiveKitService { } toggleAudio(mute) { var _this19 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (!_this19.room) return false; yield _this19.room.localParticipant.setMicrophoneEnabled(!mute); return _this19.room.localParticipant.isMicrophoneEnabled; @@ -124962,7 +124962,7 @@ class LiveKitService { } toggleVideo(disableCamera) { var _this20 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (!_this20.room) return false; yield _this20.room.localParticipant.setCameraEnabled(!disableCamera); // Donno why, leaving here for now @@ -124972,7 +124972,7 @@ class LiveKitService { } disconnect() { var _this21 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this21.room) { yield _this21.room.disconnect(); } @@ -124996,9 +124996,9 @@ class LiveKitService { } handleDevicesChanged() { var _this22 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { Promise.all(Object.keys(_this22.elementMapping).map( /*#__PURE__*/function () { - var _ref3 = (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (id) { + var _ref3 = (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* (id) { const kind = _this22.elementMapping[id]; if (!kind) { return; @@ -125107,7 +125107,7 @@ class VoiceFooterComponent { ngOnDestroy() {} toggleTransmitting() { var _this23 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (_this23.isTransmitting) { yield _this23.stopTransmitting(); } else { @@ -125117,20 +125117,20 @@ class VoiceFooterComponent { } startTransmitting() { var _this24 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this24.isTransmitting = yield _this24.livekitService.toggleAudio(false); })(); } stopTransmitting() { var _this25 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { _this25.isTransmitting = yield _this25.livekitService.toggleAudio(true); })(); } stopTransmittingLeave() {} onChannelChange(room) { var _this26 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { if (room.id === '') { yield _this26.livekitService.disconnect(); } else { @@ -128197,7 +128197,7 @@ class RealtimeGeolocationService { } start() { var _this27 = this; - return (0,G_Resgrid_Resgrid_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { + return (0,_Users_shawn_dev_Resgrid_Core_Web_Resgrid_WebCore_Areas_User_Apps_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () { console.log('SignalR Channel Start()'); _this27.retryCount = 0; if (!_this27.started) { diff --git a/Workers/Resgrid.Workers.Framework/Logic/SystemQueueLogic.cs b/Workers/Resgrid.Workers.Framework/Logic/SystemQueueLogic.cs index 60b54959f..58a4010a2 100644 --- a/Workers/Resgrid.Workers.Framework/Logic/SystemQueueLogic.cs +++ b/Workers/Resgrid.Workers.Framework/Logic/SystemQueueLogic.cs @@ -30,36 +30,6 @@ public class SystemQueueLogic { case CqrsEventTypes.None: break; - //case CqrsEventTypes.UnitLocation: - // UnitLocation unitLocation = null; - // try - // { - // unitLocation = ObjectSerialization.Deserialize(qi.Data); - // } - // catch (Exception ex) - // { - - // } - - // if (unitLocation != null) - // { - // IUnitsService unitService; - // try - // { - // unitService = Bootstrapper.GetKernel().Resolve(); - // var unit = await unitService.GetUnitByIdAsync(unitLocation.UnitId); - // await unitService.AddUnitLocationAsync(unitLocation, unit.DepartmentId, cancellationToken); - // } - // catch (Exception ex) - // { - - // } - // finally - // { - // unitService = null; - // } - // } - // break; case CqrsEventTypes.PushRegistration: PushUri data = null;