@digipair/skill-web-debug 0.8.11 → 0.8.13

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
@@ -3,11 +3,17 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  let DebugService = class DebugService {
6
- async console(params, _pinsSettingsList, _context) {
7
- const { label, value } = params;
8
- window.console.log(label, value);
6
+ async log(params, _pinsSettingsList, _context) {
7
+ const { type = 'INFOS', label, value } = params;
8
+ const message = `[${type}] ${label}`;
9
+ if (value) {
10
+ window.console.log(message, value);
11
+ } else {
12
+ window.console.log(message);
13
+ }
14
+ return value;
9
15
  }
10
16
  };
11
- const console = (params, pinsSettingsList, context)=>new DebugService().console(params, pinsSettingsList, context);
17
+ const log = (params, pinsSettingsList, context)=>new DebugService().log(params, pinsSettingsList, context);
12
18
 
13
- exports.console = console;
19
+ exports.log = log;
package/index.esm.js CHANGED
@@ -1,9 +1,15 @@
1
1
  let DebugService = class DebugService {
2
- async console(params, _pinsSettingsList, _context) {
3
- const { label, value } = params;
4
- window.console.log(label, value);
2
+ async log(params, _pinsSettingsList, _context) {
3
+ const { type = 'INFOS', label, value } = params;
4
+ const message = `[${type}] ${label}`;
5
+ if (value) {
6
+ window.console.log(message, value);
7
+ } else {
8
+ window.console.log(message);
9
+ }
10
+ return value;
5
11
  }
6
12
  };
7
- const console = (params, pinsSettingsList, context)=>new DebugService().console(params, pinsSettingsList, context);
13
+ const log = (params, pinsSettingsList, context)=>new DebugService().log(params, pinsSettingsList, context);
8
14
 
9
- export { console };
15
+ export { log };
@@ -1,2 +1,2 @@
1
1
  import { PinsSettings } from '@digipair/engine';
2
- export declare const console: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<void>;
2
+ export declare const log: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-web-debug",
3
- "version": "0.8.11",
3
+ "version": "0.8.13",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
package/schema.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "x-icon": "🔧"
9
9
  },
10
10
  "paths": {
11
- "/console": {
11
+ "/log": {
12
12
  "post": {
13
13
  "tags": ["web", "spatial"],
14
14
  "summary": "Afficher dans la console",
@@ -23,6 +23,15 @@
23
23
  "type": "string"
24
24
  }
25
25
  },
26
+ {
27
+ "name": "type",
28
+ "summary": "Type",
29
+ "required": false,
30
+ "description": "Type de log",
31
+ "schema": {
32
+ "type": "string"
33
+ }
34
+ },
26
35
  {
27
36
  "name": "value",
28
37
  "summary": "Valeur",