@telia-ace/knowledge-widget-bot-provider 0.0.1-alpha.35 → 0.0.1-alpha.39

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.
Files changed (129) hide show
  1. package/LICENSE.txt +5 -5
  2. package/README.md +12 -12
  3. package/lib/client/chat.client.d.ts +16 -16
  4. package/lib/client/chat.client.js +79 -79
  5. package/lib/client/contact-method.client.d.ts +30 -25
  6. package/lib/client/contact-method.client.js +292 -282
  7. package/lib/client/http.client.d.ts +25 -23
  8. package/lib/client/http.client.js +130 -113
  9. package/lib/client/middleware.client.d.ts +14 -14
  10. package/lib/client/middleware.client.js +115 -118
  11. package/lib/contract/custom-component/contact-method-item.d.ts +8 -8
  12. package/lib/contract/custom-component/contact-method-item.js +54 -54
  13. package/lib/contract/custom-component/contact-method-list.d.ts +7 -7
  14. package/lib/contract/custom-component/contact-method-list.js +13 -13
  15. package/lib/contract/custom-component/contact-method.d.ts +3 -3
  16. package/lib/contract/custom-component/contact-method.js +34 -34
  17. package/lib/contract/enum/server-entry-type.enum.d.ts +7 -7
  18. package/lib/contract/enum/server-entry-type.enum.js +8 -8
  19. package/lib/contract/model/conversation-api-model/list.model.d.ts +5 -5
  20. package/lib/contract/model/conversation-api-model/list.model.js +1 -0
  21. package/lib/contract/model/conversation-api-model/message.model.d.ts +7 -7
  22. package/lib/contract/model/conversation-api-model/message.model.js +1 -0
  23. package/lib/contract/model/http/action.model.d.ts +3 -3
  24. package/lib/contract/model/http/action.model.js +1 -0
  25. package/lib/contract/model/http/client-action.model.d.ts +4 -4
  26. package/lib/contract/model/http/client-action.model.js +2 -1
  27. package/lib/contract/model/http/client-envelope.model.d.ts +9 -9
  28. package/lib/contract/model/http/client-envelope.model.js +1 -0
  29. package/lib/contract/model/http/connect-options.model.d.ts +5 -5
  30. package/lib/contract/model/http/connect-options.model.js +1 -0
  31. package/lib/contract/model/http/global-state.model.d.ts +8 -8
  32. package/lib/contract/model/http/global-state.model.js +1 -0
  33. package/lib/contract/model/http/http-client-options.model.d.ts +5 -5
  34. package/lib/contract/model/http/http-client-options.model.js +1 -0
  35. package/lib/contract/model/http/server-entry.model.d.ts +11 -11
  36. package/lib/contract/model/http/server-entry.model.js +1 -0
  37. package/lib/contract/model/http/server-envelope.model.d.ts +10 -10
  38. package/lib/contract/model/http/server-envelope.model.js +1 -0
  39. package/lib/contract/model/middleware/aggregator-state.model.d.ts +4 -4
  40. package/lib/contract/model/middleware/aggregator-state.model.js +2 -1
  41. package/lib/contract/model/shared/loose-object.model.d.ts +3 -3
  42. package/lib/contract/model/shared/loose-object.model.js +1 -0
  43. package/lib/helper/chat.helper.d.ts +8 -8
  44. package/lib/helper/chat.helper.js +18 -18
  45. package/lib/helper/http.helper.d.ts +13 -13
  46. package/lib/helper/http.helper.js +28 -28
  47. package/lib/helper/middleware.helper.d.ts +12 -12
  48. package/lib/helper/middleware.helper.js +69 -67
  49. package/lib/helper/store.helper.d.ts +22 -22
  50. package/lib/helper/store.helper.js +77 -77
  51. package/lib/index.d.ts +2 -2
  52. package/lib/index.js +2 -2
  53. package/lib/interface/entry.interface.d.ts +20 -20
  54. package/lib/interface/entry.interface.js +258 -262
  55. package/lib/interface/middleware/paging.interface.d.ts +4 -4
  56. package/lib/interface/middleware/paging.interface.js +53 -53
  57. package/lib/interface/middleware/processor.interface.d.ts +10 -10
  58. package/lib/interface/middleware/processor.interface.js +118 -118
  59. package/lib/plugin.d.ts +3 -3
  60. package/lib/plugin.js +149 -139
  61. package/lib/utils.d.ts +1 -0
  62. package/lib/utils.js +5 -0
  63. package/lib-esm/client/chat.client.d.ts +16 -16
  64. package/lib-esm/client/chat.client.js +79 -79
  65. package/lib-esm/client/contact-method.client.d.ts +30 -25
  66. package/lib-esm/client/contact-method.client.js +292 -282
  67. package/lib-esm/client/http.client.d.ts +25 -23
  68. package/lib-esm/client/http.client.js +130 -113
  69. package/lib-esm/client/middleware.client.d.ts +14 -14
  70. package/lib-esm/client/middleware.client.js +115 -118
  71. package/lib-esm/contract/custom-component/contact-method-item.d.ts +8 -8
  72. package/lib-esm/contract/custom-component/contact-method-item.js +54 -54
  73. package/lib-esm/contract/custom-component/contact-method-list.d.ts +7 -7
  74. package/lib-esm/contract/custom-component/contact-method-list.js +13 -13
  75. package/lib-esm/contract/custom-component/contact-method.d.ts +3 -3
  76. package/lib-esm/contract/custom-component/contact-method.js +34 -34
  77. package/lib-esm/contract/enum/server-entry-type.enum.d.ts +7 -7
  78. package/lib-esm/contract/enum/server-entry-type.enum.js +8 -8
  79. package/lib-esm/contract/model/conversation-api-model/list.model.d.ts +5 -5
  80. package/lib-esm/contract/model/conversation-api-model/list.model.js +1 -0
  81. package/lib-esm/contract/model/conversation-api-model/message.model.d.ts +7 -7
  82. package/lib-esm/contract/model/conversation-api-model/message.model.js +1 -0
  83. package/lib-esm/contract/model/http/action.model.d.ts +3 -3
  84. package/lib-esm/contract/model/http/action.model.js +1 -0
  85. package/lib-esm/contract/model/http/client-action.model.d.ts +4 -4
  86. package/lib-esm/contract/model/http/client-action.model.js +2 -1
  87. package/lib-esm/contract/model/http/client-envelope.model.d.ts +9 -9
  88. package/lib-esm/contract/model/http/client-envelope.model.js +1 -0
  89. package/lib-esm/contract/model/http/connect-options.model.d.ts +5 -5
  90. package/lib-esm/contract/model/http/connect-options.model.js +1 -0
  91. package/lib-esm/contract/model/http/global-state.model.d.ts +8 -8
  92. package/lib-esm/contract/model/http/global-state.model.js +1 -0
  93. package/lib-esm/contract/model/http/http-client-options.model.d.ts +5 -5
  94. package/lib-esm/contract/model/http/http-client-options.model.js +1 -0
  95. package/lib-esm/contract/model/http/server-entry.model.d.ts +11 -11
  96. package/lib-esm/contract/model/http/server-entry.model.js +1 -0
  97. package/lib-esm/contract/model/http/server-envelope.model.d.ts +10 -10
  98. package/lib-esm/contract/model/http/server-envelope.model.js +1 -0
  99. package/lib-esm/contract/model/middleware/aggregator-state.model.d.ts +4 -4
  100. package/lib-esm/contract/model/middleware/aggregator-state.model.js +2 -1
  101. package/lib-esm/contract/model/shared/loose-object.model.d.ts +3 -3
  102. package/lib-esm/contract/model/shared/loose-object.model.js +1 -0
  103. package/lib-esm/helper/chat.helper.d.ts +8 -8
  104. package/lib-esm/helper/chat.helper.js +18 -18
  105. package/lib-esm/helper/http.helper.d.ts +13 -13
  106. package/lib-esm/helper/http.helper.js +28 -28
  107. package/lib-esm/helper/middleware.helper.d.ts +12 -12
  108. package/lib-esm/helper/middleware.helper.js +69 -67
  109. package/lib-esm/helper/store.helper.d.ts +22 -22
  110. package/lib-esm/helper/store.helper.js +77 -77
  111. package/lib-esm/index.d.ts +2 -2
  112. package/lib-esm/index.js +2 -2
  113. package/lib-esm/interface/entry.interface.d.ts +20 -20
  114. package/lib-esm/interface/entry.interface.js +258 -262
  115. package/lib-esm/interface/middleware/paging.interface.d.ts +4 -4
  116. package/lib-esm/interface/middleware/paging.interface.js +53 -53
  117. package/lib-esm/interface/middleware/processor.interface.d.ts +10 -10
  118. package/lib-esm/interface/middleware/processor.interface.js +118 -118
  119. package/lib-esm/plugin.d.ts +3 -3
  120. package/lib-esm/plugin.js +149 -139
  121. package/lib-esm/utils.d.ts +1 -0
  122. package/lib-esm/utils.js +5 -0
  123. package/package.json +15 -24
  124. package/lib/interface/_mocked-contact-method.json +0 -375
  125. package/lib/interface/convert.d.ts +0 -1
  126. package/lib/interface/convert.js +0 -68
  127. package/lib-esm/interface/_mocked-contact-method.json +0 -375
  128. package/lib-esm/interface/convert.d.ts +0 -1
  129. package/lib-esm/interface/convert.js +0 -68
@@ -1,375 +0,0 @@
1
- {
2
- "ContactMethod": {
3
- "Form": {
4
- "Groups": [
5
- {
6
- "Components": [
7
- {
8
- "$type": "Humany.KnowledgeBase.ContactMethods.FormTextComponent, Humany.KnowledgeBase",
9
- "Name": "customer-id",
10
- "HasCustomName": false,
11
- "Type": "text/number",
12
- "Value": "",
13
- "Constraints": {
14
- "Required": true,
15
- "Regex": null,
16
- "VerifyValue": false
17
- },
18
- "HasDependencies": false,
19
- "Title": "Customer ID",
20
- "Description": null,
21
- "Hints": [],
22
- "Visible": true,
23
- "VisibilityCriteria": {
24
- "Value": true,
25
- "Negated": true,
26
- "Description": null,
27
- "Criteria": [],
28
- "Operator": "And"
29
- },
30
- "HasDependants": false
31
- },
32
- {
33
- "$type": "Humany.KnowledgeBase.ContactMethods.FormGroupComponent, Humany.KnowledgeBase",
34
- "Children": [
35
- {
36
- "$type": "Humany.KnowledgeBase.ContactMethods.FormTextComponent, Humany.KnowledgeBase",
37
- "Name": "first-name",
38
- "HasCustomName": false,
39
- "Type": "text/sentence",
40
- "Value": "",
41
- "Constraints": {
42
- "Required": false,
43
- "Regex": null,
44
- "VerifyValue": false
45
- },
46
- "HasDependencies": false,
47
- "Title": "First name",
48
- "Description": null,
49
- "Hints": ["firstname", "verifyLabel=Confirm First name"],
50
- "Visible": true,
51
- "VisibilityCriteria": {
52
- "Value": true,
53
- "Negated": true,
54
- "Description": null,
55
- "Criteria": [],
56
- "Operator": "And"
57
- },
58
- "HasDependants": false
59
- },
60
- {
61
- "$type": "Humany.KnowledgeBase.ContactMethods.FormTextComponent, Humany.KnowledgeBase",
62
- "Name": "last-name",
63
- "HasCustomName": false,
64
- "Type": "text/sentence",
65
- "Value": "",
66
- "Constraints": {
67
- "Required": false,
68
- "Regex": null,
69
- "VerifyValue": false
70
- },
71
- "HasDependencies": false,
72
- "Title": "Last name",
73
- "Description": null,
74
- "Hints": ["lastname"],
75
- "Visible": true,
76
- "VisibilityCriteria": {
77
- "Value": true,
78
- "Negated": true,
79
- "Description": null,
80
- "Criteria": [],
81
- "Operator": "And"
82
- },
83
- "HasDependants": false
84
- }
85
- ],
86
- "Title": "Name",
87
- "Description": null,
88
- "Hints": ["fullname"],
89
- "Visible": true,
90
- "VisibilityCriteria": {
91
- "Value": true,
92
- "Negated": true,
93
- "Description": null,
94
- "Criteria": [],
95
- "Operator": "And"
96
- },
97
- "HasDependants": false
98
- },
99
- {
100
- "$type": "Humany.KnowledgeBase.ContactMethods.FormChoiceComponent, Humany.KnowledgeBase",
101
- "UseCustomValues": false,
102
- "Options": [
103
- {
104
- "Title": "CheckBox 1",
105
- "Value": "CheckBox 1",
106
- "Selected": false
107
- },
108
- {
109
- "Title": "CheckBox 2",
110
- "Value": "CheckBox 2",
111
- "Selected": false
112
- }
113
- ],
114
- "Name": "checkboxes",
115
- "HasCustomName": false,
116
- "Type": "choice",
117
- "Value": "",
118
- "Constraints": {
119
- "Required": true,
120
- "Regex": null,
121
- "VerifyValue": false
122
- },
123
- "HasDependencies": true,
124
- "Title": "Checkboxes",
125
- "Description": null,
126
- "Hints": ["checkbox", "multiple"],
127
- "Visible": true,
128
- "VisibilityCriteria": {
129
- "Value": true,
130
- "Negated": true,
131
- "Description": null,
132
- "Criteria": [],
133
- "Operator": "And"
134
- },
135
- "HasDependants": false
136
- },
137
- {
138
- "$type": "Humany.KnowledgeBase.ContactMethods.FormChoiceComponent, Humany.KnowledgeBase",
139
- "UseCustomValues": false,
140
- "Options": [
141
- {
142
- "Title": "Test 1",
143
- "Value": "Test 1",
144
- "Selected": false
145
- },
146
- {
147
- "Title": "Test 2",
148
- "Value": "Test 2",
149
- "Selected": false
150
- }
151
- ],
152
- "Name": "select-one",
153
- "HasCustomName": false,
154
- "Type": "choice",
155
- "Value": "",
156
- "Constraints": {
157
- "Required": true,
158
- "Regex": null,
159
- "VerifyValue": false
160
- },
161
- "HasDependencies": true,
162
- "Title": "Select one",
163
- "Description": null,
164
- "Hints": ["dropdown"],
165
- "Visible": true,
166
- "VisibilityCriteria": {
167
- "Value": true,
168
- "Negated": true,
169
- "Description": null,
170
- "Criteria": [],
171
- "Operator": "And"
172
- },
173
- "HasDependants": false
174
- },
175
- {
176
- "$type": "Humany.KnowledgeBase.ContactMethods.FormTextComponent, Humany.KnowledgeBase",
177
- "Name": "e-mail",
178
- "HasCustomName": false,
179
- "Type": "text/sentence",
180
- "Value": "",
181
- "Constraints": {
182
- "Required": true,
183
- "Regex": "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,4}$",
184
- "VerifyValue": false
185
- },
186
- "HasDependencies": false,
187
- "Title": "E-mail",
188
- "Description": null,
189
- "Hints": ["email"],
190
- "Visible": true,
191
- "VisibilityCriteria": {
192
- "Value": true,
193
- "Negated": true,
194
- "Description": null,
195
- "Criteria": [],
196
- "Operator": "And"
197
- },
198
- "HasDependants": false
199
- },
200
- {
201
- "$type": "Humany.KnowledgeBase.ContactMethods.FormGroupComponent, Humany.KnowledgeBase",
202
- "Children": [
203
- {
204
- "$type": "Humany.KnowledgeBase.ContactMethods.FormTextComponent, Humany.KnowledgeBase",
205
- "Name": "street",
206
- "HasCustomName": false,
207
- "Type": "text/sentence",
208
- "Value": "",
209
- "Constraints": {
210
- "Required": false,
211
- "Regex": null,
212
- "VerifyValue": false
213
- },
214
- "HasDependencies": false,
215
- "Title": "Street",
216
- "Description": null,
217
- "Hints": ["street"],
218
- "Visible": true,
219
- "VisibilityCriteria": {
220
- "Value": true,
221
- "Negated": true,
222
- "Description": null,
223
- "Criteria": [],
224
- "Operator": "And"
225
- },
226
- "HasDependants": false
227
- },
228
- {
229
- "$type": "Humany.KnowledgeBase.ContactMethods.FormTextComponent, Humany.KnowledgeBase",
230
- "Name": "number",
231
- "HasCustomName": false,
232
- "Type": "text/word",
233
- "Value": "",
234
- "Constraints": {
235
- "Required": false,
236
- "Regex": null,
237
- "VerifyValue": false
238
- },
239
- "HasDependencies": false,
240
- "Title": "Number",
241
- "Description": null,
242
- "Hints": ["number"],
243
- "Visible": true,
244
- "VisibilityCriteria": {
245
- "Value": true,
246
- "Negated": true,
247
- "Description": null,
248
- "Criteria": [],
249
- "Operator": "And"
250
- },
251
- "HasDependants": false
252
- },
253
- {
254
- "$type": "Humany.KnowledgeBase.ContactMethods.FormTextComponent, Humany.KnowledgeBase",
255
- "Name": "postcode",
256
- "HasCustomName": false,
257
- "Type": "text/word",
258
- "Value": "",
259
- "Constraints": {
260
- "Required": false,
261
- "Regex": null,
262
- "VerifyValue": false
263
- },
264
- "HasDependencies": false,
265
- "Title": "Postcode",
266
- "Description": null,
267
- "Hints": ["zipcode"],
268
- "Visible": true,
269
- "VisibilityCriteria": {
270
- "Value": true,
271
- "Negated": true,
272
- "Description": null,
273
- "Criteria": [],
274
- "Operator": "And"
275
- },
276
- "HasDependants": false
277
- },
278
- {
279
- "$type": "Humany.KnowledgeBase.ContactMethods.FormTextComponent, Humany.KnowledgeBase",
280
- "Name": "city",
281
- "HasCustomName": false,
282
- "Type": "text/sentence",
283
- "Value": "",
284
- "Constraints": {
285
- "Required": false,
286
- "Regex": null,
287
- "VerifyValue": false
288
- },
289
- "HasDependencies": false,
290
- "Title": "City",
291
- "Description": null,
292
- "Hints": ["city"],
293
- "Visible": true,
294
- "VisibilityCriteria": {
295
- "Value": true,
296
- "Negated": true,
297
- "Description": null,
298
- "Criteria": [],
299
- "Operator": "And"
300
- },
301
- "HasDependants": false
302
- }
303
- ],
304
- "Title": "Address",
305
- "Description": null,
306
- "Hints": ["address"],
307
- "Visible": true,
308
- "VisibilityCriteria": {
309
- "Value": true,
310
- "Negated": true,
311
- "Description": null,
312
- "Criteria": [],
313
- "Operator": "And"
314
- },
315
- "HasDependants": false
316
- }
317
- ],
318
- "Title": "",
319
- "Description": null,
320
- "Hints": null,
321
- "Visible": true,
322
- "VisibilityCriteria": {
323
- "Value": true,
324
- "Negated": true,
325
- "Description": null,
326
- "Criteria": [],
327
- "Operator": "And"
328
- },
329
- "HasDependants": false
330
- }
331
- ],
332
- "HasValueComponents": true,
333
- "Extra": {}
334
- },
335
- "Exits": [
336
- {
337
- "Name": "email1",
338
- "Type": "email",
339
- "Adapter": {
340
- "Id": "6973ff0a-b1a9-4f01-cd87-e7547f1384c0",
341
- "ClientName": "email.form",
342
- "CustomClientName": null,
343
- "Uri": "/interfaces/widgets/adapters/email.form.js",
344
- "Settings": {}
345
- }
346
- }
347
- ],
348
- "ConfirmationText": "<h1>Thank you!</h1><p>Your message has been sent.</p>",
349
- "Id": 942,
350
- "Title": "Report a problem",
351
- "Description": "<p>Use this contact form to send us the relevant information.</p>\n",
352
- "UriName": "report-a-problem",
353
- "Attributes": [],
354
- "Translations": {
355
- "en": 942
356
- },
357
- "MatchQuestion": false,
358
- "ExitType": "email",
359
- "ExitConfiguration": "email.form",
360
- "Highlighted": false,
361
- "HighlightedInStart": false,
362
- "ExecuteImmediately": false,
363
- "ExpandFormAutomatically": false,
364
- "DefaultIcon": {
365
- "Type": "FontAwesome",
366
- "Content": "envelope"
367
- },
368
- "ActiveIcon": {
369
- "Type": null,
370
- "Content": null
371
- },
372
- "LastModified": "2022-04-07T11:14:20.5582864Z",
373
- "Parents": [808]
374
- }
375
- }
@@ -1 +0,0 @@
1
- export declare const toContactMethod: ({ Id, Title, DefaultIcon, Exits: [Exit], ExitType, ConfirmationText, ExpandFormAutomatically, Form, Description, }: any, Validation?: any) => any;
@@ -1,68 +0,0 @@
1
- // TODO: remove this file
2
- var __read = (this && this.__read) || function (o, n) {
3
- var m = typeof Symbol === "function" && o[Symbol.iterator];
4
- if (!m) return o;
5
- var i = m.call(o), r, ar = [], e;
6
- try {
7
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
8
- }
9
- catch (error) { e = { error: error }; }
10
- finally {
11
- try {
12
- if (r && !r.done && (m = i["return"])) m.call(i);
13
- }
14
- finally { if (e) throw e.error; }
15
- }
16
- return ar;
17
- };
18
- import { FormBuilder } from '@humany/widget-forms';
19
- export var toContactMethod = function (_a, Validation) {
20
- var Id = _a.Id, Title = _a.Title, DefaultIcon = _a.DefaultIcon, _b = __read(_a.Exits, 1), Exit = _b[0], ExitType = _a.ExitType, ConfirmationText = _a.ConfirmationText, ExpandFormAutomatically = _a.ExpandFormAutomatically, Form = _a.Form, Description = _a.Description;
21
- var Adapter = (Exit || { Adapter: {} }).Adapter;
22
- var _c = Adapter.ClientName, ClientName = _c === void 0 ? '' : _c, _d = Adapter.Settings, Settings = _d === void 0 ? {} : _d, _e = Adapter.CustomClientName, CustomClientName = _e === void 0 ? '' : _e;
23
- var settings = {
24
- id: Id.toString(),
25
- title: Title,
26
- description: Description,
27
- // symbol: convertLegacySymbol(DefaultIcon), // TODO:
28
- symbol: null,
29
- clientName: ClientName === 'custom.adapter' ? CustomClientName : ClientName,
30
- expanded: true,
31
- inline: true,
32
- body: {},
33
- };
34
- if (ClientName.indexOf('phone') > -1 || ClientName.indexOf('freetext') > -1) {
35
- var displayTextBeforeClick = Settings.displayTextBeforeClick, textBeforeClick = Settings.textBeforeClick;
36
- if (displayTextBeforeClick === 'true') {
37
- settings.expanded = false;
38
- settings.title = textBeforeClick;
39
- }
40
- if (ClientName.indexOf('phone.text') > -1) {
41
- settings.body.phoneNumber = Settings.phoneNumber;
42
- }
43
- else {
44
- settings.body.freetext = Settings.freetext;
45
- }
46
- }
47
- if (ClientName.indexOf('chat.popup') > -1 ||
48
- ClientName.indexOf('link') > -1 ||
49
- (ClientName === 'custom.adapter' && ExitType === 'custom')) {
50
- settings.body = Settings;
51
- settings.body.confirmationFallback = ConfirmationText;
52
- }
53
- if (ClientName.indexOf('ace') > -1) {
54
- settings.body = Settings;
55
- }
56
- if (Form && Form.HasValueComponents) {
57
- if (Validation) {
58
- settings.body.form = FormBuilder.fromLegacyForm(Id.toString(), Form, Validation).get();
59
- }
60
- else {
61
- settings.body.form = FormBuilder.fromLegacyForm(Id.toString(), Form).get();
62
- }
63
- if (!ExpandFormAutomatically) {
64
- settings.expanded = settings.inline = false;
65
- }
66
- }
67
- return settings;
68
- };