@digipair/skill-chatbot 0.31.4 → 0.32.1

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
@@ -35,16 +35,6 @@ let ChatbotService = class ChatbotService {
35
35
  }
36
36
  // SCENES
37
37
  async boost(params, _pinsSettingsList, context) {
38
- if (context.request.method !== 'POST') {
39
- return {
40
- error: 'Method not allowed'
41
- };
42
- }
43
- const { execute } = params;
44
- const result = await engine.executePinsList(execute, context);
45
- return result;
46
- }
47
- async boostBySteps(params, _pinsSettingsList, context) {
48
38
  var _steps_step;
49
39
  if (context.request.method !== 'POST') {
50
40
  return {
@@ -67,9 +57,7 @@ const answer = (params, pinsSettingsList, context)=>new ChatbotService().answer(
67
57
  const execute = (params, pinsSettingsList, context)=>new ChatbotService().execute(params, pinsSettingsList, context);
68
58
  // SCENES
69
59
  const boost = (params, pinsSettingsList, context)=>new ChatbotService().boost(params, pinsSettingsList, context);
70
- const boostBySteps = (params, pinsSettingsList, context)=>new ChatbotService().boostBySteps(params, pinsSettingsList, context);
71
60
 
72
61
  exports.answer = answer;
73
62
  exports.boost = boost;
74
- exports.boostBySteps = boostBySteps;
75
63
  exports.execute = execute;
package/index.esm.js CHANGED
@@ -31,16 +31,6 @@ let ChatbotService = class ChatbotService {
31
31
  }
32
32
  // SCENES
33
33
  async boost(params, _pinsSettingsList, context) {
34
- if (context.request.method !== 'POST') {
35
- return {
36
- error: 'Method not allowed'
37
- };
38
- }
39
- const { execute } = params;
40
- const result = await executePinsList(execute, context);
41
- return result;
42
- }
43
- async boostBySteps(params, _pinsSettingsList, context) {
44
34
  var _steps_step;
45
35
  if (context.request.method !== 'POST') {
46
36
  return {
@@ -63,6 +53,5 @@ const answer = (params, pinsSettingsList, context)=>new ChatbotService().answer(
63
53
  const execute = (params, pinsSettingsList, context)=>new ChatbotService().execute(params, pinsSettingsList, context);
64
54
  // SCENES
65
55
  const boost = (params, pinsSettingsList, context)=>new ChatbotService().boost(params, pinsSettingsList, context);
66
- const boostBySteps = (params, pinsSettingsList, context)=>new ChatbotService().boostBySteps(params, pinsSettingsList, context);
67
56
 
68
- export { answer, boost, boostBySteps, execute };
57
+ export { answer, boost, execute };
@@ -8,4 +8,3 @@ export declare const answer: (params: any, pinsSettingsList: PinsSettings[], con
8
8
  }>;
9
9
  export declare const execute: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
10
10
  export declare const boost: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
11
- export declare const boostBySteps: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-chatbot",
3
- "version": "0.31.4",
3
+ "version": "0.32.1",
4
4
  "dependencies": {},
5
5
  "typings": "./index.d.ts",
6
6
  "main": "./index.cjs.js",
package/schema.en.json CHANGED
@@ -67,7 +67,7 @@
67
67
  "post": {
68
68
  "tags": ["boost"],
69
69
  "summary": "Execute a step",
70
- "description": "Execute a step of a step-by-step boost",
70
+ "description": "Execute a step of a boost",
71
71
  "parameters": [
72
72
  {
73
73
  "name": "step",
@@ -85,23 +85,17 @@
85
85
  },
86
86
  "components": {
87
87
  "schemas": {
88
- "Boost": {
88
+ "Input": {
89
89
  "type": "object",
90
90
  "tags": ["boost"],
91
- "summary": "Trigger",
91
+ "summary": "Input",
92
92
  "properties": {
93
- "name": {
94
- "type": "string"
95
- },
96
93
  "prompt": {
97
94
  "type": "boolean"
98
95
  },
99
96
  "required": {
100
97
  "type": "boolean"
101
98
  },
102
- "text": {
103
- "type": "string"
104
- },
105
99
  "selector": {
106
100
  "type": "string"
107
101
  },
@@ -120,6 +114,23 @@
120
114
  },
121
115
  "required": []
122
116
  },
117
+ "Trigger": {
118
+ "type": "object",
119
+ "tags": ["boost"],
120
+ "summary": "Trigger",
121
+ "properties": {
122
+ "name": {
123
+ "type": "string"
124
+ },
125
+ "selector": {
126
+ "type": "string"
127
+ },
128
+ "url": {
129
+ "type": "string"
130
+ }
131
+ },
132
+ "required": []
133
+ },
123
134
  "Step": {
124
135
  "type": "object",
125
136
  "tags": ["boost"],
@@ -155,40 +166,7 @@
155
166
  "schema": {
156
167
  "type": "array",
157
168
  "items": {
158
- "$ref": "#/components/schemas/Boost"
159
- }
160
- }
161
- }
162
- ],
163
- "parameters": [
164
- {
165
- "name": "execute",
166
- "summary": "Execution of actions",
167
- "required": false,
168
- "description": "List of actions to execute",
169
- "schema": {
170
- "type": "array",
171
- "items": {
172
- "$ref": "https://schemas.digipair.ai/pinsSettings"
173
- }
174
- }
175
- }
176
- ]
177
- },
178
- "/boostBySteps": {
179
- "summary": "Step-by-step boost",
180
- "description": "Step-by-step boost proposed by Digipair",
181
- "tags": ["boost", "service"],
182
- "metadata": [
183
- {
184
- "name": "boosts",
185
- "summary": "List of triggers",
186
- "required": true,
187
- "description": "List of boost triggers",
188
- "schema": {
189
- "type": "array",
190
- "items": {
191
- "$ref": "#/components/schemas/Boost"
169
+ "$ref": "#/components/schemas/Trigger"
192
170
  }
193
171
  }
194
172
  }
package/schema.fr.json CHANGED
@@ -67,7 +67,7 @@
67
67
  "post": {
68
68
  "tags": ["boost"],
69
69
  "summary": "Execute une étape",
70
- "description": "Execute une étape d'un boost par étapes",
70
+ "description": "Execute une étape d'un boost",
71
71
  "parameters": [
72
72
  {
73
73
  "name": "step",
@@ -85,23 +85,17 @@
85
85
  },
86
86
  "components": {
87
87
  "schemas": {
88
- "Boost": {
88
+ "Input": {
89
89
  "type": "object",
90
90
  "tags": ["boost"],
91
- "summary": "Déclencheur",
91
+ "summary": "Données d'entrée",
92
92
  "properties": {
93
- "name": {
94
- "type": "string"
95
- },
96
93
  "prompt": {
97
94
  "type": "boolean"
98
95
  },
99
96
  "required": {
100
97
  "type": "boolean"
101
98
  },
102
- "text": {
103
- "type": "string"
104
- },
105
99
  "selector": {
106
100
  "type": "string"
107
101
  },
@@ -120,6 +114,23 @@
120
114
  },
121
115
  "required": []
122
116
  },
117
+ "Trigger": {
118
+ "type": "object",
119
+ "tags": ["boost"],
120
+ "summary": "Déclencheur",
121
+ "properties": {
122
+ "name": {
123
+ "type": "string"
124
+ },
125
+ "selector": {
126
+ "type": "string"
127
+ },
128
+ "url": {
129
+ "type": "string"
130
+ }
131
+ },
132
+ "required": []
133
+ },
123
134
  "Step": {
124
135
  "type": "object",
125
136
  "tags": ["boost"],
@@ -155,40 +166,7 @@
155
166
  "schema": {
156
167
  "type": "array",
157
168
  "items": {
158
- "$ref": "#/components/schemas/Boost"
159
- }
160
- }
161
- }
162
- ],
163
- "parameters": [
164
- {
165
- "name": "execute",
166
- "summary": "Exécution des actions",
167
- "required": false,
168
- "description": "Liste des actions à exécuter",
169
- "schema": {
170
- "type": "array",
171
- "items": {
172
- "$ref": "https://schemas.digipair.ai/pinsSettings"
173
- }
174
- }
175
- }
176
- ]
177
- },
178
- "/boostBySteps": {
179
- "summary": "Boost par étapes",
180
- "description": "Boost avec étapes proposé par le Digipair",
181
- "tags": ["boost", "service"],
182
- "metadata": [
183
- {
184
- "name": "boosts",
185
- "summary": "Liste des déclencheurs",
186
- "required": true,
187
- "description": "Liste des déclencheurs du boost",
188
- "schema": {
189
- "type": "array",
190
- "items": {
191
- "$ref": "#/components/schemas/Boost"
169
+ "$ref": "#/components/schemas/Trigger"
192
170
  }
193
171
  }
194
172
  }
package/schema.json CHANGED
@@ -67,7 +67,7 @@
67
67
  "post": {
68
68
  "tags": ["boost"],
69
69
  "summary": "Execute a step",
70
- "description": "Execute a step of a step-by-step boost",
70
+ "description": "Execute a step of a boost",
71
71
  "parameters": [
72
72
  {
73
73
  "name": "step",
@@ -85,23 +85,17 @@
85
85
  },
86
86
  "components": {
87
87
  "schemas": {
88
- "Boost": {
88
+ "Input": {
89
89
  "type": "object",
90
90
  "tags": ["boost"],
91
- "summary": "Trigger",
91
+ "summary": "Input",
92
92
  "properties": {
93
- "name": {
94
- "type": "string"
95
- },
96
93
  "prompt": {
97
94
  "type": "boolean"
98
95
  },
99
96
  "required": {
100
97
  "type": "boolean"
101
98
  },
102
- "text": {
103
- "type": "string"
104
- },
105
99
  "selector": {
106
100
  "type": "string"
107
101
  },
@@ -120,6 +114,23 @@
120
114
  },
121
115
  "required": []
122
116
  },
117
+ "Trigger": {
118
+ "type": "object",
119
+ "tags": ["boost"],
120
+ "summary": "Trigger",
121
+ "properties": {
122
+ "name": {
123
+ "type": "string"
124
+ },
125
+ "selector": {
126
+ "type": "string"
127
+ },
128
+ "url": {
129
+ "type": "string"
130
+ }
131
+ },
132
+ "required": []
133
+ },
123
134
  "Step": {
124
135
  "type": "object",
125
136
  "tags": ["boost"],
@@ -155,40 +166,7 @@
155
166
  "schema": {
156
167
  "type": "array",
157
168
  "items": {
158
- "$ref": "#/components/schemas/Boost"
159
- }
160
- }
161
- }
162
- ],
163
- "parameters": [
164
- {
165
- "name": "execute",
166
- "summary": "Execution of actions",
167
- "required": false,
168
- "description": "List of actions to execute",
169
- "schema": {
170
- "type": "array",
171
- "items": {
172
- "$ref": "https://schemas.digipair.ai/pinsSettings"
173
- }
174
- }
175
- }
176
- ]
177
- },
178
- "/boostBySteps": {
179
- "summary": "Step-by-step boost",
180
- "description": "Step-by-step boost proposed by Digipair",
181
- "tags": ["boost", "service"],
182
- "metadata": [
183
- {
184
- "name": "boosts",
185
- "summary": "List of triggers",
186
- "required": true,
187
- "description": "List of boost triggers",
188
- "schema": {
189
- "type": "array",
190
- "items": {
191
- "$ref": "#/components/schemas/Boost"
169
+ "$ref": "#/components/schemas/Trigger"
192
170
  }
193
171
  }
194
172
  }