@digipair/skill-web-notification 0.10.3 → 0.10.5

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/index.cjs.js CHANGED
@@ -398,6 +398,14 @@ let NotificationService = class NotificationService {
398
398
  duration: 3000
399
399
  }).showToast();
400
400
  }
401
+ async confirm(params, _pinsSettingsList, _context) {
402
+ const { message } = params;
403
+ return window.confirm(message);
404
+ }
405
+ async alert(params, _pinsSettingsList, _context) {
406
+ const { message } = params;
407
+ return window.alert(message);
408
+ }
401
409
  constructor(){
402
410
  let link = document.querySelector('#digipair-skill-web-notification-css');
403
411
  if (!link) {
@@ -412,6 +420,10 @@ let NotificationService = class NotificationService {
412
420
  };
413
421
  const information = (params, pinsSettingsList, context)=>new NotificationService().information(params, pinsSettingsList, context);
414
422
  const error = (params, pinsSettingsList, context)=>new NotificationService().error(params, pinsSettingsList, context);
423
+ const confirm = (params, pinsSettingsList, context)=>new NotificationService().confirm(params, pinsSettingsList, context);
424
+ const alert = (params, pinsSettingsList, context)=>new NotificationService().alert(params, pinsSettingsList, context);
415
425
 
426
+ exports.alert = alert;
427
+ exports.confirm = confirm;
416
428
  exports.error = error;
417
429
  exports.information = information;
package/index.esm.js CHANGED
@@ -394,6 +394,14 @@ let NotificationService = class NotificationService {
394
394
  duration: 3000
395
395
  }).showToast();
396
396
  }
397
+ async confirm(params, _pinsSettingsList, _context) {
398
+ const { message } = params;
399
+ return window.confirm(message);
400
+ }
401
+ async alert(params, _pinsSettingsList, _context) {
402
+ const { message } = params;
403
+ return window.alert(message);
404
+ }
397
405
  constructor(){
398
406
  let link = document.querySelector('#digipair-skill-web-notification-css');
399
407
  if (!link) {
@@ -408,5 +416,7 @@ let NotificationService = class NotificationService {
408
416
  };
409
417
  const information = (params, pinsSettingsList, context)=>new NotificationService().information(params, pinsSettingsList, context);
410
418
  const error = (params, pinsSettingsList, context)=>new NotificationService().error(params, pinsSettingsList, context);
419
+ const confirm = (params, pinsSettingsList, context)=>new NotificationService().confirm(params, pinsSettingsList, context);
420
+ const alert = (params, pinsSettingsList, context)=>new NotificationService().alert(params, pinsSettingsList, context);
411
421
 
412
- export { error, information };
422
+ export { alert, confirm, error, information };
@@ -1,3 +1,5 @@
1
1
  import { PinsSettings } from '@digipair/engine';
2
2
  export declare const information: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
3
3
  export declare const error: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
4
+ export declare const confirm: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<boolean>;
5
+ export declare const alert: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-notification",
3
- "version": "0.10.3",
3
+ "version": "0.10.5",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
package/schema.json CHANGED
@@ -45,6 +45,44 @@
45
45
  ],
46
46
  "x-events": []
47
47
  }
48
+ },
49
+ "/confirm": {
50
+ "post": {
51
+ "tags": ["web"],
52
+ "summary": "Affiche une confirmation",
53
+ "description": "Affiche une notification de confirmation",
54
+ "parameters": [
55
+ {
56
+ "name": "message",
57
+ "summary": "Message",
58
+ "required": true,
59
+ "description": "Message à afficher",
60
+ "schema": {
61
+ "type": "string"
62
+ }
63
+ }
64
+ ],
65
+ "x-events": []
66
+ }
67
+ },
68
+ "/alert": {
69
+ "post": {
70
+ "tags": ["web"],
71
+ "summary": "Affiche une alerte",
72
+ "description": "Affiche une notification d'alerte",
73
+ "parameters": [
74
+ {
75
+ "name": "message",
76
+ "summary": "Message",
77
+ "required": true,
78
+ "description": "Message à afficher",
79
+ "schema": {
80
+ "type": "string"
81
+ }
82
+ }
83
+ ],
84
+ "x-events": []
85
+ }
48
86
  }
49
87
  },
50
88
  "components": {