@digipair/skill-chatbot 0.31.0 → 0.31.2

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
@@ -45,6 +45,7 @@ let ChatbotService = class ChatbotService {
45
45
  return result;
46
46
  }
47
47
  async boostBySteps(params, _pinsSettingsList, context) {
48
+ var _steps_step;
48
49
  if (context.request.method !== 'POST') {
49
50
  return {
50
51
  error: 'Method not allowed'
@@ -52,7 +53,7 @@ let ChatbotService = class ChatbotService {
52
53
  }
53
54
  const { steps } = params;
54
55
  const step = context.request.body.step ? steps.findIndex(({ name })=>name === context.request.body.step) : 0;
55
- const execute = steps[step];
56
+ const execute = ((_steps_step = steps[step]) == null ? void 0 : _steps_step.execute) || [];
56
57
  const result = await engine.executePinsList(execute, _extends({}, context, {
57
58
  boost: {
58
59
  steps
package/index.esm.js CHANGED
@@ -41,6 +41,7 @@ let ChatbotService = class ChatbotService {
41
41
  return result;
42
42
  }
43
43
  async boostBySteps(params, _pinsSettingsList, context) {
44
+ var _steps_step;
44
45
  if (context.request.method !== 'POST') {
45
46
  return {
46
47
  error: 'Method not allowed'
@@ -48,7 +49,7 @@ let ChatbotService = class ChatbotService {
48
49
  }
49
50
  const { steps } = params;
50
51
  const step = context.request.body.step ? steps.findIndex(({ name })=>name === context.request.body.step) : 0;
51
- const execute = steps[step];
52
+ const execute = ((_steps_step = steps[step]) == null ? void 0 : _steps_step.execute) || [];
52
53
  const result = await executePinsList(execute, _extends({}, context, {
53
54
  boost: {
54
55
  steps
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-chatbot",
3
- "version": "0.31.0",
3
+ "version": "0.31.2",
4
4
  "dependencies": {},
5
5
  "typings": "./index.d.ts",
6
6
  "main": "./index.cjs.js",
package/schema.en.json CHANGED
@@ -179,7 +179,20 @@
179
179
  "summary": "Step-by-step boost",
180
180
  "description": "Step-by-step boost proposed by Digipair",
181
181
  "tags": ["boost", "service"],
182
- "metadata": [],
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"
192
+ }
193
+ }
194
+ }
195
+ ],
183
196
  "parameters": [
184
197
  {
185
198
  "name": "steps",
package/schema.fr.json CHANGED
@@ -179,7 +179,20 @@
179
179
  "summary": "Boost par étapes",
180
180
  "description": "Boost avec étapes proposé par le Digipair",
181
181
  "tags": ["boost", "service"],
182
- "metadata": [],
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"
192
+ }
193
+ }
194
+ }
195
+ ],
183
196
  "parameters": [
184
197
  {
185
198
  "name": "steps",
package/schema.json CHANGED
@@ -179,7 +179,20 @@
179
179
  "summary": "Step-by-step boost",
180
180
  "description": "Step-by-step boost proposed by Digipair",
181
181
  "tags": ["boost", "service"],
182
- "metadata": [],
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"
192
+ }
193
+ }
194
+ }
195
+ ],
183
196
  "parameters": [
184
197
  {
185
198
  "name": "steps",