openfin-notifications 1.21.2 → 1.22.0-alpha-2194
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/README.md +0 -5
- package/dist/client/controls.d.ts +1 -1
- package/dist/client/index.d.ts +64 -2
- package/dist/client/internal.d.ts +7 -3
- package/dist/client/openfin-notifications.js +1 -1
- package/dist/client/platform.d.ts +25 -3
- package/dist/client/templates/BaseNotificationOptions.d.ts +6 -0
- package/package.json +3 -8
package/README.md
CHANGED
|
@@ -14,11 +14,6 @@ This project consist of 3 parts:
|
|
|
14
14
|
2. The Notification Center Client Library, exposing APIs for applications to create and manage notifications
|
|
15
15
|
3. The Notification Studio, A visual editor for user notifications.
|
|
16
16
|
|
|
17
|
-
### Dependencies
|
|
18
|
-
|
|
19
|
-
- OpenFin version used by the Notifications Provider = 23.96.68.3
|
|
20
|
-
- OpenFin RVM >= 4.7
|
|
21
|
-
|
|
22
17
|
### Features
|
|
23
18
|
|
|
24
19
|
- Create notifications.
|
|
@@ -67,6 +67,7 @@ export interface ButtonOptions {
|
|
|
67
67
|
*/
|
|
68
68
|
submit?: boolean;
|
|
69
69
|
/**
|
|
70
|
+
* @deprecated
|
|
70
71
|
* Optional icon URL, if an icon should be placed on the button.
|
|
71
72
|
*
|
|
72
73
|
* Icons are placed to the left of the button text.
|
|
@@ -83,7 +84,6 @@ export interface ButtonOptions {
|
|
|
83
84
|
* side-effect-free interaction. Even if `onClick` is omitted or `null`, a `notification-closed` event will still be
|
|
84
85
|
* raised after the button click.
|
|
85
86
|
*
|
|
86
|
-
* Future versions of the service will allow for greater control over what happens when a button is clicked.
|
|
87
87
|
*/
|
|
88
88
|
onClick?: ActionDeclaration<never, never> | null;
|
|
89
89
|
/**
|
package/dist/client/index.d.ts
CHANGED
|
@@ -168,6 +168,40 @@ export interface NotificationCreatedEvent {
|
|
|
168
168
|
*/
|
|
169
169
|
notification: Notification;
|
|
170
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Event fired whenever a reminder has been created either via the Notifications API
|
|
173
|
+
* or by the user on the Notification Center UI
|
|
174
|
+
*
|
|
175
|
+
* @event "notification-reminder-created"
|
|
176
|
+
*/
|
|
177
|
+
export interface NotificationReminderCreatedEvent {
|
|
178
|
+
type: 'notification-reminder-created';
|
|
179
|
+
/**
|
|
180
|
+
* The reminder notification that has just been created.
|
|
181
|
+
*
|
|
182
|
+
* This object will match what is returned from the `create` call when the notification
|
|
183
|
+
* was first created.
|
|
184
|
+
*/
|
|
185
|
+
notification: Notification;
|
|
186
|
+
/**
|
|
187
|
+
* The reminder time-out timestamp.
|
|
188
|
+
*/
|
|
189
|
+
reminderDate: Date;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Event fired whenever a reminder has been canceled by the user, reminder notification is deleted or the reminder timeout has reached.
|
|
193
|
+
*
|
|
194
|
+
* @event "notification-reminder-removed"
|
|
195
|
+
*/
|
|
196
|
+
export interface NotificationReminderRemovedEvent {
|
|
197
|
+
type: 'notification-reminder-removed';
|
|
198
|
+
/**
|
|
199
|
+
* The notification associated with the reminder that has just been removed.
|
|
200
|
+
*
|
|
201
|
+
* This object will match what is returned from the `create` call when the notification was first created.
|
|
202
|
+
*/
|
|
203
|
+
notification: Notification;
|
|
204
|
+
}
|
|
171
205
|
/**
|
|
172
206
|
* Event fired whenever the total number of notifications from **all** sources changes.
|
|
173
207
|
*
|
|
@@ -180,6 +214,11 @@ export interface NotificationsCountChanged {
|
|
|
180
214
|
*/
|
|
181
215
|
count: number;
|
|
182
216
|
}
|
|
217
|
+
/**
|
|
218
|
+
* Event fired whenever submit button is clicked on a notification form.
|
|
219
|
+
*
|
|
220
|
+
* @event "notifications-count-changed"
|
|
221
|
+
*/
|
|
183
222
|
export interface NotificationFormSubmittedEvent {
|
|
184
223
|
type: 'notification-form-submitted';
|
|
185
224
|
notification: Notification;
|
|
@@ -191,16 +230,36 @@ export declare function addEventListener(eventType: 'notification-created', list
|
|
|
191
230
|
export declare function addEventListener(eventType: 'notification-toast-dismissed', listener: (event: NotificationToastDismissedEvent) => void): void;
|
|
192
231
|
export declare function addEventListener(eventType: 'notification-closed', listener: (event: NotificationClosedEvent) => void): void;
|
|
193
232
|
export declare function addEventListener(eventType: 'notifications-count-changed', listener: (event: NotificationsCountChanged) => void): void;
|
|
233
|
+
export declare function addEventListener(eventType: 'notification-reminder-created', listener: (event: NotificationReminderCreatedEvent) => void): void;
|
|
234
|
+
export declare function addEventListener(eventType: 'notification-reminder-removed', listener: (event: NotificationReminderRemovedEvent) => void): void;
|
|
194
235
|
export declare function removeEventListener(eventType: 'notification-form-submitted', listener: (event: NotificationFormSubmittedEvent) => void): void;
|
|
195
236
|
export declare function removeEventListener(eventType: 'notification-action', listener: (event: NotificationActionEvent) => void): void;
|
|
196
237
|
export declare function removeEventListener(eventType: 'notification-created', listener: (event: NotificationCreatedEvent) => void): void;
|
|
197
238
|
export declare function removeEventListener(eventType: 'notification-toast-dismissed', listener: (event: NotificationToastDismissedEvent) => void): void;
|
|
198
239
|
export declare function removeEventListener(eventType: 'notification-closed', listener: (event: NotificationClosedEvent) => void): void;
|
|
199
240
|
export declare function removeEventListener(eventType: 'notifications-count-changed', listener: (event: NotificationsCountChanged) => void): void;
|
|
241
|
+
export declare function removeEventListener(eventType: 'notification-reminder-created', listener: (event: NotificationReminderCreatedEvent) => void): void;
|
|
242
|
+
export declare function removeEventListener(eventType: 'notification-reminder-removed', listener: (event: NotificationReminderRemovedEvent) => void): void;
|
|
243
|
+
/**
|
|
244
|
+
* Extended configuration options for the notification creation.
|
|
245
|
+
*/
|
|
246
|
+
export interface NotificationCreationOptions {
|
|
247
|
+
/**
|
|
248
|
+
* The date on which the notification will be removed from reminders category and recreated
|
|
249
|
+
* created as regular notification.
|
|
250
|
+
*
|
|
251
|
+
* If this date is earlier than the notification creation time, the notification will be created
|
|
252
|
+
* immediately.
|
|
253
|
+
* Cannot be earlier than the expiry date, if set.
|
|
254
|
+
*
|
|
255
|
+
*/
|
|
256
|
+
reminderDate?: Date;
|
|
257
|
+
}
|
|
200
258
|
/**
|
|
201
259
|
* Creates a new notification.
|
|
202
260
|
*
|
|
203
|
-
*
|
|
261
|
+
* If a reminder is not set, the notification will immediately appear in the Notification Center and as a toast if the Center is not visible.
|
|
262
|
+
* If a reminder is set, the notification will appear in the Center when the reminder date is reached.
|
|
204
263
|
*
|
|
205
264
|
* If a notification is created with an `id` of an already existing notification, the existing notification will be recreated with the new content.
|
|
206
265
|
*
|
|
@@ -212,12 +271,15 @@ export declare function removeEventListener(eventType: 'notifications-count-chan
|
|
|
212
271
|
* title: 'Notification Title',
|
|
213
272
|
* body: 'Text to display within the notification body',
|
|
214
273
|
* icon: 'https://openfin.co/favicon.ico'
|
|
274
|
+
* }, {
|
|
275
|
+
* reminderDate: new Date('October 21, 2015 07:28:00');
|
|
215
276
|
* });
|
|
216
277
|
* ```
|
|
217
278
|
*
|
|
218
279
|
* @param options Notification configuration options.
|
|
280
|
+
* @param creationOptions Extended configuration options for the notification creation.
|
|
219
281
|
*/
|
|
220
|
-
export declare function create<T extends NotificationOptions>(options: T): Promise<Notification<T>>;
|
|
282
|
+
export declare function create<T extends NotificationOptions>(options: T, creationOptions?: NotificationCreationOptions): Promise<Notification<T>>;
|
|
221
283
|
/**
|
|
222
284
|
* Updates an existing notification. Requires id of original Notification and one of:
|
|
223
285
|
* - buttons
|
|
@@ -11,7 +11,7 @@ import type OpenFin from '@openfin/core';
|
|
|
11
11
|
import { NotificationActionResult, ActionTrigger } from './actions';
|
|
12
12
|
import { ProviderStatus } from './provider';
|
|
13
13
|
import { NotificationSource } from './source';
|
|
14
|
-
import { NotificationOptions, Notification, NotificationActionEvent, NotificationClosedEvent, NotificationCreatedEvent, NotificationsCountChanged, NotificationFormSubmittedEvent, UpdatableNotification, NotificationPlatform, UpdatableNotificationOptions, NotificationToastDismissedEvent, ShowOptions } from './index';
|
|
14
|
+
import { NotificationOptions, Notification, NotificationActionEvent, NotificationClosedEvent, NotificationCreatedEvent, NotificationsCountChanged, NotificationFormSubmittedEvent, UpdatableNotification, NotificationPlatform, UpdatableNotificationOptions, NotificationToastDismissedEvent, ShowOptions, NotificationReminderCreatedEvent, NotificationReminderRemovedEvent, RegistrationMetaInfo } from './index';
|
|
15
15
|
/**
|
|
16
16
|
* The identity of the main application window of the service provider
|
|
17
17
|
*/
|
|
@@ -50,17 +50,21 @@ export interface API {
|
|
|
50
50
|
[APITopic.REMOVE_EVENT_LISTENER]: [Events['type'], void];
|
|
51
51
|
[APITopic.GET_PROVIDER_STATUS]: [undefined, ProviderStatus];
|
|
52
52
|
[APITopic.GET_NOTIFICATIONS_COUNT]: [undefined, number];
|
|
53
|
-
[APITopic.REGISTER_PLATFORM]: [
|
|
53
|
+
[APITopic.REGISTER_PLATFORM]: [
|
|
54
|
+
PlatformRegisterPayload,
|
|
55
|
+
Pick<RegistrationMetaInfo, 'notificationsVersion'> | undefined
|
|
56
|
+
];
|
|
54
57
|
[APITopic.DEREGISTER_PLATFORM]: [PlatformDeregisterPayload, void];
|
|
55
58
|
[APITopic.SHOW_NOTIFICATION_CENTER]: [ShowPayload | undefined, void];
|
|
56
59
|
[APITopic.HIDE_NOTIFICATION_CENTER]: [undefined, void];
|
|
57
60
|
}
|
|
58
|
-
export declare type Events = NotificationActionEvent | NotificationToastDismissedEvent | NotificationClosedEvent | NotificationCreatedEvent | NotificationsCountChanged | NotificationFormSubmittedEvent;
|
|
61
|
+
export declare type Events = NotificationActionEvent | NotificationToastDismissedEvent | NotificationClosedEvent | NotificationCreatedEvent | NotificationsCountChanged | NotificationFormSubmittedEvent | NotificationReminderCreatedEvent | NotificationReminderRemovedEvent;
|
|
59
62
|
export declare type TransportMappings<T> = T extends NotificationActionEvent ? NotificationActionEventTransport : never;
|
|
60
63
|
export declare type TransportMemberMappings<T> = T extends Notification ? NotificationInternal : T;
|
|
61
64
|
export declare type CreatePayload<T extends NotificationOptions = NotificationOptions> = DistributiveOmit<T, 'date' | 'expires'> & {
|
|
62
65
|
date?: number;
|
|
63
66
|
expires?: number | null;
|
|
67
|
+
reminder?: number | null;
|
|
64
68
|
};
|
|
65
69
|
export declare type UpdatePayload<T extends UpdatableNotificationOptions = UpdatableNotificationOptions> = T;
|
|
66
70
|
export declare type NotificationInternal<T extends NotificationOptions = NotificationOptions> = DistributiveOmit<Notification<T>, 'date' | 'expires'> & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.notifications=t():e.notifications=t()}(self,(()=>{return e={17187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,i){function r(n){e.removeListener(t,o),i(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}y(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,{once:!0})}(e,r)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,n,i){var r,o,s,u;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),(r=c(e))>0&&s.length>r&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=l.bind(i);return r.listener=n,i.wrapFn=r,r}function p(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):v(r,r.length)}function d(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}function y(e,t,n,i){if("function"==typeof e.on)i.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(o){i.once&&e.removeEventListener(t,r),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,l=v(c,u);for(n=0;n<u;++n)i(l[n],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,i,r,o,s;if(a(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return p(this,e,!0)},o.prototype.rawListeners=function(e){return p(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},54456:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeferredPromise=class{constructor(){const e=new Promise(((e,t)=>{this._resolve=e,this._reject=t}));this._promise=e}get promise(){return this._promise}get resolve(){return this._resolve}get reject(){return this._reject}}},16272:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(54456);async function r(e,t){let n=0;for(const i of e)await t(i,n,e),n++}async function o(e,t){await Promise.all(e.map(t))}function s(e,t,n){const r=new i.DeferredPromise,o=e.add(((...e)=>{t(...e)&&(o.remove(),r.resolve())}));return n&&n.catch((e=>{o.remove(),r.reject(e)})),a(r.promise)}function a(e){return e.catch((()=>{})),e}t.serialForEach=r,t.serialMap=async function(e,t){const n=[];return await r(e,(async(e,i,r)=>{n.push(await t(e,i,r))})),n},t.serialFilter=async function(e,t){const n=[];return await r(e,(async(e,i,r)=>{await t(e,i,r)&&n.push(e)})),n},t.parallelForEach=o,t.parallelMap=async function(e,t){const n=[];return await o(e,(async(e,i,r)=>{n[i]=await t(e,i,r)})),n},t.parallelFilter=async function(e,t){const n=[];return await o(e,(async(e,i,r)=>{n[i]=await t(e,i,r)})),e.filter(((e,t)=>n[t]))},t.withStrictTimeout=function(e,t,n){const i=new Promise(((t,i)=>setTimeout((()=>i(new Error(n))),e)));return a(Promise.race([i,t]))},t.withTimeout=function(e,t){const n=new Promise((t=>setTimeout((()=>t([!0,void 0])),e))),i=t.then((e=>[!1,e]));return Promise.race([n,i])},t.untilTrue=function(e,t,n){return t()?Promise.resolve():s(e,t,n)},t.untilSignal=s,t.allowReject=a},95881:(e,t,n)=>{"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(16272)),i(n(54456))},29140:e=>{e.exports=function(e,t){for(var n=e.split("."),i=t.split("."),r=0;r<3;r++){var o=Number(n[r]),s=Number(i[r]);if(o>s)return 1;if(s>o)return-1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))return-1}return 0}},47924:function(e,t){"use strict";var n=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.EventRouter=void 0,t.EventRouter=class{constructor(e){this._emitterProviders={},this._deserializers={},this._defaultEmitter=e}registerEmitterProvider(e,t){this._emitterProviders[e]=t}registerDeserializer(e,t){this._deserializers[e]=t}dispatchEvent(e){const{type:t,target:i}=e,r=n(e,["type","target"]);let o;if(!i)throw new Error("Invalid event, no target specified");if("default"===i)o=this._defaultEmitter;else{if(!this._emitterProviders[i.type])throw new Error(`Invalid target, no provider registered for '${i.type}'`);o=this._emitterProviders[i.type](i.id)}const s=Object.assign({type:t},r),a=this._deserializers[t];a?o.emit(t,a(s)):o.emit(t,s)}}},85400:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionBodyClickType=t.ActionNoopType=t.ActionTrigger=void 0,(n=t.ActionTrigger||(t.ActionTrigger={})).CONTROL="control",n.SELECT="select",n.CLOSE="close",n.EXPIRE="expire",n.PROGRAMMATIC="programmatic",(t.ActionNoopType||(t.ActionNoopType={})).EVENT_DISMISS="event_dismiss",(t.ActionBodyClickType||(t.ActionBodyClickType={})).DISMISS_EVENT="dismiss_event"},53595:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEventRouter=t.tryServiceDispatch=t.getServicePromise=t.eventEmitter=void 0;const i=n(17187),r=n(95881),o=n(84666),s=n(47924);let a;t.eventEmitter=new i.EventEmitter;const c=new r.DeferredPromise;let u,l=!1;async function f(){if(window.navigator.appVersion.includes("Windows"))try{const e=await fin.System.getRvmInfo();parseInt(e.version.split(".")[0])>=6&&(fin.System.launchManifest?fin.System.launchManifest("fins://system-apps/notification-center",{noUi:!0}).catch((e=>{console.error("Unable to launch the Notification Center as a system app",e)})):fin.System.openUrlWithBrowser("fins://system-apps/notification-center").catch((()=>{})))}catch(e){}else fin.System.openUrlWithBrowser("fins://system-apps/notification-center")}async function p(){var e;if(await c.promise,!a){if("undefined"==typeof fin){const e="fin is not defined. The openfin-notifications module is only intended for use in an OpenFin application.";return a=Promise.reject(new Error(e)),a}fin.System.getVersion().then((e=>{const t=parseInt(e.split(".")[2]);t<53&&console.warn(`API version ${t} of OpenFin version ${e} is less than 53. Please upgrade the runtime version.`)}));const{name:t,uuid:n}=null!==(e=fin.me.identity)&&void 0!==e?e:fin.Window.me;if(n===o.SERVICE_IDENTITY.uuid&&t===o.SERVICE_IDENTITY.name)a=Promise.reject(new Error("Trying to connect to provider from provider"));else{const e=window.setTimeout((()=>{console.warn("Taking a long time to connect to Notifications service. Is the Notifications service running?")}),5e3);a=fin.InterApplicationBus.Channel.connect(o.SERVICE_CHANNEL,{wait:!0,payload:{version:"1.21.2"}}).then((t=>{window.clearTimeout(e);const n=d();return t.register("WARN",(e=>console.warn(e))),t.register("event",(e=>{n.dispatchEvent(e)})),t.setDefaultAction((()=>!1)),t.onDisconnection((()=>{console.warn("Disconnected from Notifications service"),l=!0,a=null,f(),setTimeout((()=>{console.log("Attempting to reconnect to Notifications service"),p()}),300)})),l?console.log("Reconnected to Notifications service"):console.log("Connected to Notifications service"),t}))}}return a}function d(){return u||(u=new s.EventRouter(t.eventEmitter)),u}"undefined"!=typeof fin&&"undefined"!=typeof window&&(f(),p(),"loading"!==document.readyState?c.resolve():(window.addEventListener("DOMContentLoaded",(()=>{c.resolve()})),document.addEventListener("DOMContentLoaded",(()=>{c.resolve()})))),t.getServicePromise=p,t.tryServiceDispatch=async function(e,t){return(await p()).dispatch(e,t)},t.getEventRouter=d},4575:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},176:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldType=void 0,t.FieldType={string:"string",number:"number",boolean:"boolean"}},93407:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(176),t),r(n(49725),t)},49725:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetType=t.BooleanWidgetType=t.NumberWidgetType=t.StringWidgetType=void 0,t.StringWidgetType={Text:"Text"},t.NumberWidgetType={Number:"Number"},t.BooleanWidgetType={Toggle:"Toggle",Checkbox:"Checkbox"},t.WidgetType=Object.assign(Object.assign(Object.assign({},t.StringWidgetType),t.NumberWidgetType),t.BooleanWidgetType)},3771:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)},a=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getNotificationsCount=t.hide=t.show=t.toggleNotificationCenter=t.clearAll=t.getAll=t.clear=t.update=t.create=t.removeEventListener=t.addEventListener=t.VERSION=t.NotificationIndicatorType=t.IndicatorColor=t.NotificationIndicator=t.NotificationOptions=t.provider=void 0;const c=n(85400),u=n(53595),l=n(84666),f=o(n(14045));t.provider=f;const p=n(10314),d=n(43392);Object.defineProperty(t,"NotificationIndicator",{enumerable:!0,get:function(){return d.NotificationIndicator}}),Object.defineProperty(t,"NotificationIndicatorType",{enumerable:!0,get:function(){return d.IndicatorType}}),Object.defineProperty(t,"IndicatorColor",{enumerable:!0,get:function(){return d.IndicatorColor}});const v=n(69695);Object.defineProperty(t,"NotificationOptions",{enumerable:!0,get:function(){return v.NotificationOptions}}),s(n(85400),t),s(n(4575),t),s(n(69742),t),s(n(93407),t),s(n(78985),t),s(n(95482),t),s(n(23310),t),t.VERSION="1.21.2";const y=(0,u.getEventRouter)();function m(e){const{notification:t}=e;return Object.assign(Object.assign({},e),{notification:Object.assign(Object.assign({},t),{date:new Date(t.date),expires:null!==t.expires?new Date(t.expires):null})})}y.registerDeserializer("notification-created",(e=>m(e))),y.registerDeserializer("notification-toast-dismissed",(e=>m(e))),y.registerDeserializer("notification-closed",(e=>m(e))),y.registerDeserializer("notification-action",(e=>{const t=m(e),{controlSource:n,controlIndex:i}=t,r=a(t,["controlSource","controlIndex"]);if(e.trigger===c.ActionTrigger.CONTROL){const t=e.notification[n][i];return Object.assign(Object.assign({},r),{control:t})}return r})),y.registerDeserializer("notifications-count-changed",(e=>e)),t.addEventListener=function(e,t){(0,p.validateEnvironment)(),e=(0,p.sanitizeEventType)(e),t=(0,p.sanitizeFunction)(t);const n=u.eventEmitter.listenerCount(e);u.eventEmitter.addListener(e,t),0===n&&1===u.eventEmitter.listenerCount(e)&&(0,u.tryServiceDispatch)(l.APITopic.ADD_EVENT_LISTENER,e)},t.removeEventListener=function(e,t){(0,p.validateEnvironment)(),e=(0,p.sanitizeEventType)(e),t=(0,p.sanitizeFunction)(t);const n=u.eventEmitter.listenerCount(e);u.eventEmitter.removeListener(e,t),1===n&&0===u.eventEmitter.listenerCount(e)&&(0,u.tryServiceDispatch)(l.APITopic.REMOVE_EVENT_LISTENER,e)},t.create=async function(e){if("object"!=typeof e||null===e)throw new Error("Invalid argument passed to create: argument must be an object and must not be null");if(void 0!==e.date&&!(e.date instanceof Date))throw new Error('Invalid argument passed to create: "date" must be a valid Date object');if(void 0!==e.expires&&null!==e.expires&&!(e.expires instanceof Date))throw new Error('Invalid argument passed to create: "expires" must be null or a valid Date object');void 0!==e.category&&null!==e.category||(e.category="default");const t=await(0,u.tryServiceDispatch)(l.APITopic.CREATE_NOTIFICATION,Object.assign(Object.assign({},e),{date:e.date&&e.date.valueOf(),expires:e.expires&&e.expires.valueOf()}));return Object.assign(Object.assign({},t),{date:new Date(t.date),expires:null!==t.expires?new Date(t.expires):null})},t.update=async function(e){if("object"!=typeof e||null===e)throw new Error("Invalid argument passed to create: argument must be an object and must not be null");if(!e.id)throw new Error('Invalid argument passed to create: "id" must be Id of previously created Notification');const t=await(0,u.tryServiceDispatch)(l.APITopic.UPDATE_NOTIFICATION,Object.assign({},e));return Object.assign({},t)},t.clear=async function(e){return(0,u.tryServiceDispatch)(l.APITopic.CLEAR_NOTIFICATION,{id:e})},t.getAll=async function(){return(await(0,u.tryServiceDispatch)(l.APITopic.GET_APP_NOTIFICATIONS,void 0)).map((e=>Object.assign(Object.assign({},e),{indicator:e.indicator||null,date:new Date(e.date),expires:null!==e.expires?new Date(e.expires):null})))},t.clearAll=async function(){return(0,u.tryServiceDispatch)(l.APITopic.CLEAR_APP_NOTIFICATIONS,void 0)},t.toggleNotificationCenter=async function(){return(0,u.tryServiceDispatch)(l.APITopic.TOGGLE_NOTIFICATION_CENTER,void 0)},t.show=async function(e){return(0,u.tryServiceDispatch)(l.APITopic.SHOW_NOTIFICATION_CENTER,e)},t.hide=async function(){return(0,u.tryServiceDispatch)(l.APITopic.HIDE_NOTIFICATION_CENTER,void 0)},t.getNotificationsCount=async function(){return(0,u.tryServiceDispatch)(l.APITopic.GET_NOTIFICATIONS_COUNT,void 0)}},43392:(e,t)=>{"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.IndicatorColor=t.IndicatorType=void 0,(i=t.IndicatorType||(t.IndicatorType={})).FAILURE="failure",i.WARNING="warning",i.SUCCESS="success",(n=t.IndicatorColor||(t.IndicatorColor={})).RED="red",n.GREEN="green",n.YELLOW="yellow",n.BLUE="blue",n.PURPLE="purple",n.GRAY="gray"},84666:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.APITopic=t.SERVICE_CHANNEL=t.SERVICE_IDENTITY=void 0,t.SERVICE_IDENTITY={uuid:"notifications-service",name:"notifications-service"},t.SERVICE_CHANNEL="of-notifications-service-v1",(n=t.APITopic||(t.APITopic={})).CREATE_NOTIFICATION="create-notification",n.UPDATE_NOTIFICATION="update-notification",n.CLEAR_NOTIFICATION="clear-notification",n.GET_APP_NOTIFICATIONS="fetch-app-notifications",n.CLEAR_APP_NOTIFICATIONS="clear-app-notifications",n.TOGGLE_NOTIFICATION_CENTER="toggle-notification-center",n.ADD_EVENT_LISTENER="add-event-listener",n.REMOVE_EVENT_LISTENER="remove-event-listener",n.GET_PROVIDER_STATUS="get-provider-status",n.GET_NOTIFICATIONS_COUNT="get-notifications-count",n.REGISTER_PLATFORM="register-notifications-platform",n.DEREGISTER_PLATFORM="deregister-notifications-platform",n.SHOW_NOTIFICATION_CENTER="show-notification-center",n.HIDE_NOTIFICATION_CENTER="hide-notification-center"},23310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deregisterPlatform=t.registerPlatform=void 0;const i=n(53595),r=n(84666);t.registerPlatform=async function(e){if("object"!=typeof e||null===e)throw new Error("Invalid argument passed to registerPlatform: argument must be an object and must not be null");if(!e.id)throw new Error('Invalid argument passed to registerPlatform: "id" must be a non-empty string in platform info.');return(0,i.tryServiceDispatch)(r.APITopic.REGISTER_PLATFORM,Object.assign({},e))},t.deregisterPlatform=async function(e){if(!e)throw new Error('Invalid argument passed to deregisterPlatform: "id" must be a non-empty string.');return(0,i.tryServiceDispatch)(r.APITopic.DEREGISTER_PLATFORM,{id:e})}},14045:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isConnectedToAtLeast=t.getStatus=void 0;const r=i(n(29140)),o=n(95881),s=n(53595),a=n(84666);function c(){return(0,o.withStrictTimeout)(500,(0,s.tryServiceDispatch)(a.APITopic.GET_PROVIDER_STATUS,void 0),"").catch((()=>({connected:!1,version:null,templateAPIVersion:null})))}t.getStatus=c,t.isConnectedToAtLeast=async function(e){const t=await c();if(t.connected&&null!==t.version){const n=(0,r.default)(t.version,e);if(0===n||1===n)return!0}return!1}},69742:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},78985:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},69045:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},56242:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},95482:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(69045),t),r(n(56242),t),r(n(69695),t),r(n(81627),t)},69695:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TemplateFragmentNames=t.PresentationTemplateFragmentNames=t.ContainerTemplateFragmentNames=t.TemplateNames=void 0,t.TemplateNames={markdown:"markdown",list:"list",custom:"custom"},t.ContainerTemplateFragmentNames={container:"container"},t.PresentationTemplateFragmentNames={text:"text",image:"image",list:"list"},t.TemplateFragmentNames=Object.assign(Object.assign({},t.ContainerTemplateFragmentNames),t.PresentationTemplateFragmentNames)},81627:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},10314:(e,t)=>{"use strict";function n(e,t){let n;try{n=JSON.stringify(e)}catch(e){n=t}return n}Object.defineProperty(t,"__esModule",{value:!0}),t.safeStringify=t.validateEnvironment=t.sanitizeEventType=t.sanitizeFunction=void 0,t.sanitizeFunction=function(e){if("function"!=typeof e)throw new Error(`Invalid argument passed: ${n(e,"The provided value")} is not a valid function`);return e},t.sanitizeEventType=function(e){if("notification-action"===e||"notification-created"===e||"notification-toast-dismissed"===e||"notification-closed"===e||"notifications-count-changed"===e||"notification-form-submitted"===e)return e;throw new Error(`Invalid argument passed: ${n(e,"The provided event type")} is not a valid Notifications event type`)},t.validateEnvironment=function(){if("undefined"==typeof fin)throw new Error("fin is not defined. The openfin-notifications module is only intended for use in an OpenFin application.")},t.safeStringify=n}},t={},function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(3771);var e,t}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.notifications=t():e.notifications=t()}(self,(()=>{return e={17187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,i=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,i){function r(n){e.removeListener(t,o),i(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,r)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function u(e,t,n,i){var r,o,s,u;if(a(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),(r=c(e))>0&&s.length>r&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=l.bind(i);return r.listener=n,i.wrapFn=r,r}function d(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(r):v(r,r.length)}function p(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function v(e,t){for(var n=new Array(t),i=0;i<t;++i)n[i]=e[i];return n}function m(e,t,n,i){if("function"==typeof e.on)i.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(o){i.once&&e.removeEventListener(t,r),n(o)}))}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||r(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,o=this._events;if(void 0!==o)r=r&&void 0===o.error;else if(!r)return!1;if(r){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)i(c,this,t);else{var u=c.length,l=v(c,u);for(n=0;n<u;++n)i(l[n],this,t)}return!0},o.prototype.addListener=function(e,t){return u(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return u(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var n,i,r,o,s;if(a(t),void 0===(i=this._events))return this;if(void 0===(n=i[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(r=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,r=o;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,r),1===n.length&&(i[e]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,n,i;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var r,o=Object.keys(n);for(i=0;i<o.length;++i)"removeListener"!==(r=o[i])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},54456:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeferredPromise=class{constructor(){const e=new Promise(((e,t)=>{this._resolve=e,this._reject=t}));this._promise=e}get promise(){return this._promise}get resolve(){return this._resolve}get reject(){return this._reject}}},16272:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(54456);async function r(e,t){let n=0;for(const i of e)await t(i,n,e),n++}async function o(e,t){await Promise.all(e.map(t))}function s(e,t,n){const r=new i.DeferredPromise,o=e.add(((...e)=>{t(...e)&&(o.remove(),r.resolve())}));return n&&n.catch((e=>{o.remove(),r.reject(e)})),a(r.promise)}function a(e){return e.catch((()=>{})),e}t.serialForEach=r,t.serialMap=async function(e,t){const n=[];return await r(e,(async(e,i,r)=>{n.push(await t(e,i,r))})),n},t.serialFilter=async function(e,t){const n=[];return await r(e,(async(e,i,r)=>{await t(e,i,r)&&n.push(e)})),n},t.parallelForEach=o,t.parallelMap=async function(e,t){const n=[];return await o(e,(async(e,i,r)=>{n[i]=await t(e,i,r)})),n},t.parallelFilter=async function(e,t){const n=[];return await o(e,(async(e,i,r)=>{n[i]=await t(e,i,r)})),e.filter(((e,t)=>n[t]))},t.withStrictTimeout=function(e,t,n){const i=new Promise(((t,i)=>setTimeout((()=>i(new Error(n))),e)));return a(Promise.race([i,t]))},t.withTimeout=function(e,t){const n=new Promise((t=>setTimeout((()=>t([!0,void 0])),e))),i=t.then((e=>[!1,e]));return Promise.race([n,i])},t.untilTrue=function(e,t,n){return t()?Promise.resolve():s(e,t,n)},t.untilSignal=s,t.allowReject=a},95881:(e,t,n)=>{"use strict";function i(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),i(n(16272)),i(n(54456))},29140:e=>{e.exports=function(e,t){for(var n=e.split("."),i=t.split("."),r=0;r<3;r++){var o=Number(n[r]),s=Number(i[r]);if(o>s)return 1;if(s>o)return-1;if(!isNaN(o)&&isNaN(s))return 1;if(isNaN(o)&&!isNaN(s))return-1}return 0}},17385:function(e,t){"use strict";var n=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.EventRouter=void 0,t.EventRouter=class{constructor(e){this._emitterProviders={},this._deserializers={},this._defaultEmitter=e}registerEmitterProvider(e,t){this._emitterProviders[e]=t}registerDeserializer(e,t){this._deserializers[e]=t}dispatchEvent(e){const{type:t,target:i}=e,r=n(e,["type","target"]);let o;if(!i)throw new Error("Invalid event, no target specified");if("default"===i)o=this._defaultEmitter;else{if(!this._emitterProviders[i.type])throw new Error(`Invalid target, no provider registered for '${i.type}'`);o=this._emitterProviders[i.type](i.id)}const s=Object.assign({type:t},r),a=this._deserializers[t];a?o.emit(t,a(s)):o.emit(t,s)}}},19659:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ActionBodyClickType=t.ActionNoopType=t.ActionTrigger=void 0,(n=t.ActionTrigger||(t.ActionTrigger={})).CONTROL="control",n.SELECT="select",n.CLOSE="close",n.EXPIRE="expire",n.PROGRAMMATIC="programmatic",(t.ActionNoopType||(t.ActionNoopType={})).EVENT_DISMISS="event_dismiss",(t.ActionBodyClickType||(t.ActionBodyClickType={})).DISMISS_EVENT="dismiss_event"},12052:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getEventRouter=t.tryServiceDispatch=t.getServicePromise=t.eventEmitter=void 0;const i=n(17187),r=n(95881),o=n(76598),s=n(17385);let a;t.eventEmitter=new i.EventEmitter;const c=new r.DeferredPromise;let u,l=!1;async function f(){if(window.navigator.appVersion.includes("Windows"))try{const e=await fin.System.getRvmInfo();parseInt(e.version.split(".")[0])>=6&&(fin.System.launchManifest?fin.System.launchManifest("fins://system-apps/notification-center",{noUi:!0}).catch((e=>{console.error("Unable to launch the Notification Center as a system app",e)})):fin.System.openUrlWithBrowser("fins://system-apps/notification-center").catch((()=>{})))}catch(e){}else fin.System.openUrlWithBrowser("fins://system-apps/notification-center")}async function d(){var e;if(await c.promise,!a){if("undefined"==typeof fin){const e="fin is not defined. The openfin-notifications module is only intended for use in an OpenFin application.";return a=Promise.reject(new Error(e)),a}fin.System.getVersion().then((e=>{const t=parseInt(e.split(".")[2]);t<53&&console.warn(`API version ${t} of OpenFin version ${e} is less than 53. Please upgrade the runtime version.`)}));const{name:t,uuid:n}=null!==(e=fin.me.identity)&&void 0!==e?e:fin.Window.me;if(n===o.SERVICE_IDENTITY.uuid&&t===o.SERVICE_IDENTITY.name)a=Promise.reject(new Error("Trying to connect to provider from provider"));else{const e=window.setTimeout((()=>{console.warn("Taking a long time to connect to Notifications service. Is the Notifications service running?")}),5e3);a=fin.InterApplicationBus.Channel.connect(o.SERVICE_CHANNEL,{wait:!0,payload:{version:"1.22.0-alpha-2194"}}).then((t=>{window.clearTimeout(e);const n=p();return t.register("WARN",(e=>console.warn(e))),t.register("event",(e=>{n.dispatchEvent(e)})),t.setDefaultAction((()=>!1)),t.onDisconnection((()=>{console.warn("Disconnected from Notifications service"),l=!0,a=null,f(),setTimeout((()=>{console.log("Attempting to reconnect to Notifications service"),d()}),300)})),l?console.log("Reconnected to Notifications service"):console.log("Connected to Notifications service"),t}))}}return a}function p(){return u||(u=new s.EventRouter(t.eventEmitter)),u}"undefined"!=typeof fin&&"undefined"!=typeof window&&(f(),d(),"loading"!==document.readyState?c.resolve():(window.addEventListener("DOMContentLoaded",(()=>{c.resolve()})),document.addEventListener("DOMContentLoaded",(()=>{c.resolve()})))),t.getServicePromise=d,t.tryServiceDispatch=async function(e,t){return(await d()).dispatch(e,t)},t.getEventRouter=p},490:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},97490:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldType=void 0,t.FieldType={string:"string",number:"number",boolean:"boolean"}},8910:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(97490),t),r(n(7713),t)},7713:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetType=t.BooleanWidgetType=t.NumberWidgetType=t.StringWidgetType=void 0,t.StringWidgetType={Text:"Text"},t.NumberWidgetType={Number:"Number"},t.BooleanWidgetType={Toggle:"Toggle",Checkbox:"Checkbox"},t.WidgetType=Object.assign(Object.assign(Object.assign({},t.StringWidgetType),t.NumberWidgetType),t.BooleanWidgetType)},61995:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&i(t,e,n);return r(t,e),t},s=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)},a=this&&this.__rest||function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.getNotificationsCount=t.hide=t.show=t.toggleNotificationCenter=t.clearAll=t.getAll=t.clear=t.update=t.create=t.removeEventListener=t.addEventListener=t.VERSION=t.NotificationIndicatorType=t.IndicatorColor=t.NotificationIndicator=t.NotificationOptions=t.provider=void 0;const c=n(19659),u=n(12052),l=n(76598),f=o(n(30207));t.provider=f;const d=n(72475),p=n(5221);Object.defineProperty(t,"NotificationIndicator",{enumerable:!0,get:function(){return p.NotificationIndicator}}),Object.defineProperty(t,"NotificationIndicatorType",{enumerable:!0,get:function(){return p.IndicatorType}}),Object.defineProperty(t,"IndicatorColor",{enumerable:!0,get:function(){return p.IndicatorColor}});const v=n(12908);Object.defineProperty(t,"NotificationOptions",{enumerable:!0,get:function(){return v.NotificationOptions}}),s(n(19659),t),s(n(490),t),s(n(55063),t),s(n(8910),t),s(n(87221),t),s(n(49757),t),s(n(7005),t),t.VERSION="1.22.0-alpha-2194";const m=(0,u.getEventRouter)();function y(e){const{notification:t}=e;return Object.assign(Object.assign({},e),{notification:Object.assign(Object.assign({},t),{date:new Date(t.date),expires:null!==t.expires?new Date(t.expires):null})})}m.registerDeserializer("notification-created",(e=>y(e))),m.registerDeserializer("notification-toast-dismissed",(e=>y(e))),m.registerDeserializer("notification-closed",(e=>y(e))),m.registerDeserializer("notification-action",(e=>{const t=y(e),{controlSource:n,controlIndex:i}=t,r=a(t,["controlSource","controlIndex"]);if(e.trigger===c.ActionTrigger.CONTROL){const t=e.notification[n][i];return Object.assign(Object.assign({},r),{control:t})}return r})),m.registerDeserializer("notifications-count-changed",(e=>e)),m.registerDeserializer("notification-reminder-created",(e=>{const t=y(e),{reminderDate:n}=t,i=a(t,["reminderDate"]);return Object.assign(Object.assign({},i),{reminderDate:new Date(n)})})),m.registerDeserializer("notification-reminder-removed",(e=>y(e))),t.addEventListener=function(e,t){(0,d.validateEnvironment)(),e=(0,d.sanitizeEventType)(e),t=(0,d.sanitizeFunction)(t);const n=u.eventEmitter.listenerCount(e);u.eventEmitter.addListener(e,t),0===n&&1===u.eventEmitter.listenerCount(e)&&(0,u.tryServiceDispatch)(l.APITopic.ADD_EVENT_LISTENER,e)},t.removeEventListener=function(e,t){(0,d.validateEnvironment)(),e=(0,d.sanitizeEventType)(e),t=(0,d.sanitizeFunction)(t);const n=u.eventEmitter.listenerCount(e);u.eventEmitter.removeListener(e,t),1===n&&0===u.eventEmitter.listenerCount(e)&&(0,u.tryServiceDispatch)(l.APITopic.REMOVE_EVENT_LISTENER,e)},t.create=async function(e,t){if("object"!=typeof e||null===e)throw new Error("Invalid argument passed to create: argument must be an object and must not be null");if(void 0!==e.date&&!(e.date instanceof Date))throw new Error('Invalid argument passed to create: "date" must be a valid Date object');if(void 0!==e.expires&&null!==e.expires&&!(e.expires instanceof Date))throw new Error('Invalid argument passed to create: "expires" must be null or a valid Date object');if(t&&t.reminderDate){if(!1===e.allowReminder)throw new Error('You must not specify a reminder date for a notification with "allowReminder" option set to false.');if(!(t.reminderDate instanceof Date))throw new Error('Invalid argument passed to reminder Options: "date" must a valid Date object');if(e.expires&&e.expires.getTime()<t.reminderDate.getTime())throw new Error("Expiration date must not be earlier than reminder date.")}void 0!==e.category&&null!==e.category||(e.category="default");const n=await(0,u.tryServiceDispatch)(l.APITopic.CREATE_NOTIFICATION,Object.assign(Object.assign({},e),{date:e.date&&e.date.valueOf(),expires:e.expires&&e.expires.valueOf(),reminder:(null==t?void 0:t.reminderDate)&&t.reminderDate.valueOf()}));return Object.assign(Object.assign({},n),{date:new Date(n.date),expires:null!==n.expires?new Date(n.expires):null})},t.update=async function(e){if("object"!=typeof e||null===e)throw new Error("Invalid argument passed to create: argument must be an object and must not be null");if(!e.id)throw new Error('Invalid argument passed to create: "id" must be Id of previously created Notification');const t=await(0,u.tryServiceDispatch)(l.APITopic.UPDATE_NOTIFICATION,Object.assign({},e));return Object.assign({},t)},t.clear=async function(e){return(0,u.tryServiceDispatch)(l.APITopic.CLEAR_NOTIFICATION,{id:e})},t.getAll=async function(){return(await(0,u.tryServiceDispatch)(l.APITopic.GET_APP_NOTIFICATIONS,void 0)).map((e=>Object.assign(Object.assign({},e),{indicator:e.indicator||null,date:new Date(e.date),expires:null!==e.expires?new Date(e.expires):null})))},t.clearAll=async function(){return(0,u.tryServiceDispatch)(l.APITopic.CLEAR_APP_NOTIFICATIONS,void 0)},t.toggleNotificationCenter=async function(){return(0,u.tryServiceDispatch)(l.APITopic.TOGGLE_NOTIFICATION_CENTER,void 0)},t.show=async function(e){return(0,u.tryServiceDispatch)(l.APITopic.SHOW_NOTIFICATION_CENTER,e)},t.hide=async function(){return(0,u.tryServiceDispatch)(l.APITopic.HIDE_NOTIFICATION_CENTER,void 0)},t.getNotificationsCount=async function(){return(0,u.tryServiceDispatch)(l.APITopic.GET_NOTIFICATIONS_COUNT,void 0)}},5221:(e,t)=>{"use strict";var n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.IndicatorColor=t.IndicatorType=void 0,(i=t.IndicatorType||(t.IndicatorType={})).FAILURE="failure",i.WARNING="warning",i.SUCCESS="success",(n=t.IndicatorColor||(t.IndicatorColor={})).RED="red",n.GREEN="green",n.YELLOW="yellow",n.BLUE="blue",n.PURPLE="purple",n.GRAY="gray"},76598:(e,t)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.APITopic=t.SERVICE_CHANNEL=t.SERVICE_IDENTITY=void 0,t.SERVICE_IDENTITY={uuid:"notifications-service",name:"notifications-service"},t.SERVICE_CHANNEL="of-notifications-service-v1",(n=t.APITopic||(t.APITopic={})).CREATE_NOTIFICATION="create-notification",n.UPDATE_NOTIFICATION="update-notification",n.CLEAR_NOTIFICATION="clear-notification",n.GET_APP_NOTIFICATIONS="fetch-app-notifications",n.CLEAR_APP_NOTIFICATIONS="clear-app-notifications",n.TOGGLE_NOTIFICATION_CENTER="toggle-notification-center",n.ADD_EVENT_LISTENER="add-event-listener",n.REMOVE_EVENT_LISTENER="remove-event-listener",n.GET_PROVIDER_STATUS="get-provider-status",n.GET_NOTIFICATIONS_COUNT="get-notifications-count",n.REGISTER_PLATFORM="register-notifications-platform",n.DEREGISTER_PLATFORM="deregister-notifications-platform",n.SHOW_NOTIFICATION_CENTER="show-notification-center",n.HIDE_NOTIFICATION_CENTER="hide-notification-center"},7005:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.deregisterPlatform=t.registerPlatform=void 0;const i=n(12052),r=n(76598);t.registerPlatform=async function(e){if("object"!=typeof e||null===e)throw new Error("Invalid argument passed to registerPlatform: argument must be an object and must not be null");if(!e.id)throw new Error('Invalid argument passed to registerPlatform: "id" must be a non-empty string in platform info.');const t=await(0,i.tryServiceDispatch)(r.APITopic.REGISTER_PLATFORM,Object.assign({},e));return{notificationsVersion:t?t.notificationsVersion:"unknown",clientAPIVersion:"1.22.0-alpha-2194"}},t.deregisterPlatform=async function(e){if(!e)throw new Error('Invalid argument passed to deregisterPlatform: "id" must be a non-empty string.');return(0,i.tryServiceDispatch)(r.APITopic.DEREGISTER_PLATFORM,{id:e})}},30207:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isConnectedToAtLeast=t.getStatus=void 0;const r=i(n(29140)),o=n(95881),s=n(12052),a=n(76598);function c(){return(0,o.withStrictTimeout)(500,(0,s.tryServiceDispatch)(a.APITopic.GET_PROVIDER_STATUS,void 0),"").catch((()=>({connected:!1,version:null,templateAPIVersion:null})))}t.getStatus=c,t.isConnectedToAtLeast=async function(e){const t=await c();if(t.connected&&null!==t.version){const n=(0,r.default)(t.version,e);if(0===n||1===n)return!0}return!1}},55063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},87221:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},30600:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},23371:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},49757:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),r(n(30600),t),r(n(23371),t),r(n(12908),t),r(n(48877),t)},12908:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TemplateFragmentNames=t.PresentationTemplateFragmentNames=t.ContainerTemplateFragmentNames=t.TemplateNames=void 0,t.TemplateNames={markdown:"markdown",list:"list",custom:"custom"},t.ContainerTemplateFragmentNames={container:"container"},t.PresentationTemplateFragmentNames={text:"text",image:"image",list:"list"},t.TemplateFragmentNames=Object.assign(Object.assign({},t.ContainerTemplateFragmentNames),t.PresentationTemplateFragmentNames)},48877:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},72475:(e,t)=>{"use strict";function n(e,t){let n;try{n=JSON.stringify(e)}catch(e){n=t}return n}Object.defineProperty(t,"__esModule",{value:!0}),t.safeStringify=t.validateEnvironment=t.sanitizeEventType=t.sanitizeFunction=void 0,t.sanitizeFunction=function(e){if("function"!=typeof e)throw new Error(`Invalid argument passed: ${n(e,"The provided value")} is not a valid function`);return e},t.sanitizeEventType=function(e){if("notification-action"===e||"notification-created"===e||"notification-toast-dismissed"===e||"notification-closed"===e||"notifications-count-changed"===e||"notification-form-submitted"===e||"notification-reminder-created"===e||"notification-reminder-removed"===e)return e;throw new Error(`Invalid argument passed: ${n(e,"The provided event type")} is not a valid Notifications event type`)},t.validateEnvironment=function(){if("undefined"==typeof fin)throw new Error("fin is not defined. The openfin-notifications module is only intended for use in an OpenFin application.")},t.safeStringify=n}},t={},function n(i){var r=t[i];if(void 0!==r)return r.exports;var o=t[i]={exports:{}};return e[i].call(o.exports,o,o.exports,n),o.exports}(61995);var e,t}));
|
|
@@ -41,15 +41,37 @@ export interface NotificationPlatform {
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Data returned by the service when registering a platform.
|
|
46
|
+
*/
|
|
47
|
+
export interface RegistrationMetaInfo {
|
|
48
|
+
/**
|
|
49
|
+
* Version of the client API.
|
|
50
|
+
*/
|
|
51
|
+
clientAPIVersion: string;
|
|
52
|
+
/**
|
|
53
|
+
* Version of the notification service that is running.
|
|
54
|
+
* A response of 'unknown' indicates that an older version of the service is runningthat does not support returning the service version.
|
|
55
|
+
*/
|
|
56
|
+
notificationsVersion: string;
|
|
57
|
+
}
|
|
44
58
|
/**
|
|
45
59
|
* Registers a workspace platform with Notification Center.
|
|
46
60
|
*
|
|
47
|
-
*
|
|
61
|
+
* This is an internal method that is not intended for direct use by applications.
|
|
62
|
+
* Instead, call via the Workspace Platform SDK to register your Workspace platform.
|
|
63
|
+
*
|
|
64
|
+
* @param platform The platform to register.
|
|
65
|
+
* @returns A promise that resolves when the platform has been registered.
|
|
48
66
|
*/
|
|
49
|
-
export declare function registerPlatform<T extends NotificationPlatform>(platform: T): Promise<
|
|
67
|
+
export declare function registerPlatform<T extends NotificationPlatform>(platform: T): Promise<RegistrationMetaInfo>;
|
|
50
68
|
/**
|
|
51
69
|
* Deregisters a workspace platform.
|
|
52
70
|
*
|
|
53
|
-
*
|
|
71
|
+
* This is an internal method that is not intended for direct use by applications.
|
|
72
|
+
* Instead, call via the Workspace Platform SDK to deregister your Workspace platform.
|
|
73
|
+
*
|
|
74
|
+
* @param id The ID of the platform to deregister.
|
|
75
|
+
* @returns A promise that resolves when the platform has been deregistered.
|
|
54
76
|
*/
|
|
55
77
|
export declare function deregisterPlatform(id: string): Promise<void>;
|
|
@@ -28,6 +28,12 @@ export interface BaseNotificationOptions<T extends keyof typeof TemplateNames> {
|
|
|
28
28
|
* Displayed as the first line of the notification, in a heading style.
|
|
29
29
|
*/
|
|
30
30
|
title: string;
|
|
31
|
+
/**
|
|
32
|
+
* If set to false, the user won't be able to set a reminder for this notification in the Notification Center.
|
|
33
|
+
*
|
|
34
|
+
* Default value is `true`.
|
|
35
|
+
*/
|
|
36
|
+
allowReminder?: boolean;
|
|
31
37
|
/**
|
|
32
38
|
* Describes the context of this notification. Allows users to control different notification types that are raised
|
|
33
39
|
* by an application.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openfin-notifications",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.0-alpha-2194",
|
|
4
4
|
"description": "Client library for the Openfin Notifications Center",
|
|
5
5
|
"main": "dist/client/openfin-notifications.js",
|
|
6
6
|
"types": "dist/client/index.d.ts",
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"scripts": {
|
|
11
11
|
"build": "webpack build --mode production",
|
|
12
12
|
"build:dev": "webpack build --mode development",
|
|
13
|
-
"channels": "node scripts/create-runtime-channels.js",
|
|
14
13
|
"clean": "rimraf gen dist",
|
|
15
14
|
"docs": "typedoc --tsconfig \"./src/client/tsconfig.json\"",
|
|
16
15
|
"posttest": "npm run check",
|
|
@@ -31,7 +30,7 @@
|
|
|
31
30
|
"license": "SEE LICENSE IN LICENSE.MD",
|
|
32
31
|
"homepage": "https://developers.openfin.co/docs/notifications-api",
|
|
33
32
|
"dependencies": {
|
|
34
|
-
"@openfin/core": "^30.74.
|
|
33
|
+
"@openfin/core": "^30.74.13",
|
|
35
34
|
"@openfin/predux": "^1.0.0-alpha.1",
|
|
36
35
|
"acorn": "^8.8.1",
|
|
37
36
|
"ajv": "^8.11.0",
|
|
@@ -62,7 +61,7 @@
|
|
|
62
61
|
},
|
|
63
62
|
"devDependencies": {
|
|
64
63
|
"@actions/core": "^1.10.0",
|
|
65
|
-
"@openfin/ui-library": "^0.
|
|
64
|
+
"@openfin/ui-library": "^0.13.5",
|
|
66
65
|
"@testing-library/jest-dom": "^5.11.5",
|
|
67
66
|
"@testing-library/react": "^11.1.0",
|
|
68
67
|
"@types/jest": "^27.4.1",
|
|
@@ -88,7 +87,6 @@
|
|
|
88
87
|
"archiver": "^5.3.0",
|
|
89
88
|
"babel-preset-const-enum": "^1.0.0",
|
|
90
89
|
"copy-webpack-plugin": "^10.2.4",
|
|
91
|
-
"css-loader": "^6.7.1",
|
|
92
90
|
"dotenv": "^16.0.0",
|
|
93
91
|
"dotenv-defaults": "^5.0.0",
|
|
94
92
|
"dotenv-expand": "^8.0.3",
|
|
@@ -104,14 +102,11 @@
|
|
|
104
102
|
"jest-cli": "^27.5.1",
|
|
105
103
|
"jest-dom": "^4.0.0",
|
|
106
104
|
"jsdom": "^15.1.1",
|
|
107
|
-
"mini-css-extract-plugin": "^2.6.0",
|
|
108
105
|
"mkdirp": "^0.5.1",
|
|
109
106
|
"node-fetch": "^2.6.0",
|
|
110
107
|
"prettier": "^2.2.1",
|
|
111
108
|
"puppeteer-core": "^19.0.0",
|
|
112
109
|
"rimraf": "^3.0.2",
|
|
113
|
-
"sass": "^1.50.0",
|
|
114
|
-
"sass-loader": "^12.6.0",
|
|
115
110
|
"stylelint": "^13.13.1",
|
|
116
111
|
"stylelint-config-recommended": "^4.0.0",
|
|
117
112
|
"stylelint-config-styled-components": "^0.1.1",
|