@mhome/conversation-protocol 3.16.0 → 4.1.0

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.
@@ -124,156 +124,6 @@
124
124
  }
125
125
  }
126
126
  },
127
- "previewValue": {
128
- "oneOf": [
129
- {
130
- "type": "object",
131
- "additionalProperties": false,
132
- "required": [
133
- "type",
134
- "text"
135
- ],
136
- "properties": {
137
- "type": {
138
- "const": "text"
139
- },
140
- "text": {
141
- "type": "string"
142
- }
143
- }
144
- },
145
- {
146
- "type": "object",
147
- "additionalProperties": false,
148
- "required": [
149
- "type",
150
- "items"
151
- ],
152
- "properties": {
153
- "type": {
154
- "const": "text_list"
155
- },
156
- "items": {
157
- "type": "array",
158
- "items": {
159
- "type": "string"
160
- }
161
- }
162
- }
163
- },
164
- {
165
- "type": "object",
166
- "additionalProperties": false,
167
- "required": [
168
- "type",
169
- "value"
170
- ],
171
- "properties": {
172
- "type": {
173
- "const": "number"
174
- },
175
- "value": {
176
- "type": "number"
177
- }
178
- }
179
- },
180
- {
181
- "type": "object",
182
- "additionalProperties": false,
183
- "required": [
184
- "type",
185
- "value"
186
- ],
187
- "properties": {
188
- "type": {
189
- "const": "bool"
190
- },
191
- "value": {
192
- "type": "boolean"
193
- }
194
- }
195
- }
196
- ]
197
- },
198
- "interactionPreview": {
199
- "type": "object",
200
- "additionalProperties": false,
201
- "required": [
202
- "actionCode",
203
- "title",
204
- "message",
205
- "tone",
206
- "details",
207
- "proceedLabel",
208
- "rejectLabel"
209
- ],
210
- "properties": {
211
- "actionCode": {
212
- "$ref": "#/$defs/id"
213
- },
214
- "title": {
215
- "$ref": "#/$defs/id"
216
- },
217
- "message": {
218
- "type": "string"
219
- },
220
- "tone": {
221
- "enum": [
222
- "normal",
223
- "danger"
224
- ]
225
- },
226
- "details": {
227
- "type": "array",
228
- "items": {
229
- "type": "object",
230
- "additionalProperties": false,
231
- "required": [
232
- "label",
233
- "value"
234
- ],
235
- "properties": {
236
- "label": {
237
- "$ref": "#/$defs/id"
238
- },
239
- "value": {
240
- "$ref": "#/$defs/previewValue"
241
- }
242
- }
243
- }
244
- },
245
- "proceedLabel": {
246
- "$ref": "#/$defs/id"
247
- },
248
- "rejectLabel": {
249
- "$ref": "#/$defs/id"
250
- },
251
- "clientTask": {
252
- "type": "object",
253
- "additionalProperties": false,
254
- "required": [
255
- "type",
256
- "integrationId",
257
- "sessionId"
258
- ],
259
- "properties": {
260
- "type": {
261
- "const": "connect_integration"
262
- },
263
- "integrationId": {
264
- "type": "string",
265
- "minLength": 1,
266
- "pattern": "\\S"
267
- },
268
- "sessionId": {
269
- "type": "string",
270
- "minLength": 1,
271
- "pattern": "\\S"
272
- }
273
- }
274
- }
275
- }
276
- },
277
127
  "pendingInteraction": {
278
128
  "type": "object",
279
129
  "additionalProperties": false,
@@ -282,7 +132,8 @@
282
132
  "batchId",
283
133
  "title",
284
134
  "message",
285
- "items"
135
+ "items",
136
+ "answeredActionIds"
286
137
  ],
287
138
  "properties": {
288
139
  "requestId": {
@@ -301,30 +152,14 @@
301
152
  "type": "array",
302
153
  "minItems": 1,
303
154
  "items": {
304
- "type": "object",
305
- "additionalProperties": false,
306
- "required": [
307
- "actionId",
308
- "kind",
309
- "preview"
310
- ],
311
- "properties": {
312
- "actionId": {
313
- "$ref": "#/$defs/id"
314
- },
315
- "kind": {
316
- "enum": [
317
- "approval",
318
- "user_action"
319
- ]
320
- },
321
- "expiresAt": {
322
- "$ref": "#/$defs/time"
323
- },
324
- "preview": {
325
- "$ref": "#/$defs/interactionPreview"
326
- }
327
- }
155
+ "$ref": "#/$defs/interactionItem"
156
+ }
157
+ },
158
+ "answeredActionIds": {
159
+ "type": "array",
160
+ "uniqueItems": true,
161
+ "items": {
162
+ "$ref": "#/$defs/id"
328
163
  }
329
164
  }
330
165
  }
@@ -2011,7 +1846,7 @@
2011
1846
  "required": [
2012
1847
  "threadId",
2013
1848
  "batchId",
2014
- "decisions"
1849
+ "responses"
2015
1850
  ],
2016
1851
  "properties": {
2017
1852
  "threadId": {
@@ -2020,27 +1855,11 @@
2020
1855
  "batchId": {
2021
1856
  "$ref": "#/$defs/id"
2022
1857
  },
2023
- "decisions": {
1858
+ "responses": {
2024
1859
  "type": "array",
2025
1860
  "minItems": 1,
2026
1861
  "items": {
2027
- "type": "object",
2028
- "additionalProperties": false,
2029
- "required": [
2030
- "actionId",
2031
- "decision"
2032
- ],
2033
- "properties": {
2034
- "actionId": {
2035
- "$ref": "#/$defs/id"
2036
- },
2037
- "decision": {
2038
- "enum": [
2039
- "approve",
2040
- "reject"
2041
- ]
2042
- }
2043
- }
1862
+ "$ref": "#/$defs/interactionItemResponse"
2044
1863
  }
2045
1864
  }
2046
1865
  }
@@ -2574,7 +2393,7 @@
2574
2393
  "required": [
2575
2394
  "requestId",
2576
2395
  "batchId",
2577
- "decisions",
2396
+ "responses",
2578
2397
  "occurredAtUnixMs"
2579
2398
  ],
2580
2399
  "properties": {
@@ -2584,32 +2403,16 @@
2584
2403
  "batchId": {
2585
2404
  "$ref": "#/$defs/id"
2586
2405
  },
2587
- "decisions": {
2406
+ "occurredAtUnixMs": {
2407
+ "type": "integer",
2408
+ "minimum": 0
2409
+ },
2410
+ "responses": {
2588
2411
  "type": "array",
2589
2412
  "minItems": 1,
2590
2413
  "items": {
2591
- "type": "object",
2592
- "additionalProperties": false,
2593
- "required": [
2594
- "actionId",
2595
- "decision"
2596
- ],
2597
- "properties": {
2598
- "actionId": {
2599
- "$ref": "#/$defs/id"
2600
- },
2601
- "decision": {
2602
- "enum": [
2603
- "approve",
2604
- "reject"
2605
- ]
2606
- }
2607
- }
2414
+ "$ref": "#/$defs/interactionItemResponse"
2608
2415
  }
2609
- },
2610
- "occurredAtUnixMs": {
2611
- "type": "integer",
2612
- "minimum": 0
2613
2416
  }
2614
2417
  }
2615
2418
  }
@@ -3016,6 +2819,248 @@
3016
2819
  }
3017
2820
  }
3018
2821
  }
2822
+ },
2823
+ "interactionCard": {
2824
+ "type": "object",
2825
+ "additionalProperties": false,
2826
+ "required": [
2827
+ "type",
2828
+ "title",
2829
+ "message",
2830
+ "tone",
2831
+ "continueLabel",
2832
+ "cancelLabel",
2833
+ "data"
2834
+ ],
2835
+ "properties": {
2836
+ "type": {
2837
+ "type": "string",
2838
+ "minLength": 1,
2839
+ "pattern": "^[a-z0-9._]+$"
2840
+ },
2841
+ "title": {
2842
+ "type": "string",
2843
+ "minLength": 1,
2844
+ "pattern": "\\S"
2845
+ },
2846
+ "message": {
2847
+ "type": "string"
2848
+ },
2849
+ "tone": {
2850
+ "enum": [
2851
+ "normal",
2852
+ "danger"
2853
+ ]
2854
+ },
2855
+ "continueLabel": {
2856
+ "type": "string",
2857
+ "minLength": 1,
2858
+ "pattern": "\\S"
2859
+ },
2860
+ "cancelLabel": {
2861
+ "type": "string",
2862
+ "minLength": 1,
2863
+ "pattern": "\\S"
2864
+ },
2865
+ "data": {
2866
+ "type": "object"
2867
+ }
2868
+ }
2869
+ },
2870
+ "interactionAnswer": {
2871
+ "oneOf": [
2872
+ {
2873
+ "type": "object",
2874
+ "additionalProperties": false,
2875
+ "required": [
2876
+ "action"
2877
+ ],
2878
+ "properties": {
2879
+ "action": {
2880
+ "const": "approve"
2881
+ }
2882
+ }
2883
+ },
2884
+ {
2885
+ "type": "object",
2886
+ "additionalProperties": false,
2887
+ "required": [
2888
+ "action"
2889
+ ],
2890
+ "properties": {
2891
+ "action": {
2892
+ "const": "reject"
2893
+ }
2894
+ }
2895
+ },
2896
+ {
2897
+ "type": "object",
2898
+ "additionalProperties": false,
2899
+ "required": [
2900
+ "action",
2901
+ "data"
2902
+ ],
2903
+ "properties": {
2904
+ "action": {
2905
+ "const": "continue"
2906
+ },
2907
+ "data": {}
2908
+ }
2909
+ },
2910
+ {
2911
+ "type": "object",
2912
+ "additionalProperties": false,
2913
+ "required": [
2914
+ "action"
2915
+ ],
2916
+ "properties": {
2917
+ "action": {
2918
+ "const": "cancel"
2919
+ }
2920
+ }
2921
+ }
2922
+ ]
2923
+ },
2924
+ "interactionItem": {
2925
+ "type": "object",
2926
+ "additionalProperties": false,
2927
+ "required": [
2928
+ "actionId",
2929
+ "kind",
2930
+ "card"
2931
+ ],
2932
+ "properties": {
2933
+ "actionId": {
2934
+ "type": "string",
2935
+ "minLength": 1,
2936
+ "pattern": "\\S"
2937
+ },
2938
+ "kind": {
2939
+ "enum": [
2940
+ "approval",
2941
+ "user_action"
2942
+ ]
2943
+ },
2944
+ "expiresAt": {
2945
+ "type": "string"
2946
+ },
2947
+ "card": {
2948
+ "type": "object",
2949
+ "additionalProperties": false,
2950
+ "required": [
2951
+ "type",
2952
+ "title",
2953
+ "message",
2954
+ "tone",
2955
+ "continueLabel",
2956
+ "cancelLabel",
2957
+ "data"
2958
+ ],
2959
+ "properties": {
2960
+ "type": {
2961
+ "type": "string",
2962
+ "minLength": 1,
2963
+ "pattern": "^[a-z0-9._]+$"
2964
+ },
2965
+ "title": {
2966
+ "type": "string",
2967
+ "minLength": 1,
2968
+ "pattern": "\\S"
2969
+ },
2970
+ "message": {
2971
+ "type": "string"
2972
+ },
2973
+ "tone": {
2974
+ "enum": [
2975
+ "normal",
2976
+ "danger"
2977
+ ]
2978
+ },
2979
+ "continueLabel": {
2980
+ "type": "string",
2981
+ "minLength": 1,
2982
+ "pattern": "\\S"
2983
+ },
2984
+ "cancelLabel": {
2985
+ "type": "string",
2986
+ "minLength": 1,
2987
+ "pattern": "\\S"
2988
+ },
2989
+ "data": {
2990
+ "type": "object"
2991
+ }
2992
+ }
2993
+ }
2994
+ }
2995
+ },
2996
+ "interactionItemResponse": {
2997
+ "type": "object",
2998
+ "additionalProperties": false,
2999
+ "required": [
3000
+ "actionId",
3001
+ "response"
3002
+ ],
3003
+ "properties": {
3004
+ "actionId": {
3005
+ "type": "string",
3006
+ "minLength": 1,
3007
+ "pattern": "\\S"
3008
+ },
3009
+ "response": {
3010
+ "oneOf": [
3011
+ {
3012
+ "type": "object",
3013
+ "additionalProperties": false,
3014
+ "required": [
3015
+ "action"
3016
+ ],
3017
+ "properties": {
3018
+ "action": {
3019
+ "const": "approve"
3020
+ }
3021
+ }
3022
+ },
3023
+ {
3024
+ "type": "object",
3025
+ "additionalProperties": false,
3026
+ "required": [
3027
+ "action"
3028
+ ],
3029
+ "properties": {
3030
+ "action": {
3031
+ "const": "reject"
3032
+ }
3033
+ }
3034
+ },
3035
+ {
3036
+ "type": "object",
3037
+ "additionalProperties": false,
3038
+ "required": [
3039
+ "action",
3040
+ "data"
3041
+ ],
3042
+ "properties": {
3043
+ "action": {
3044
+ "const": "continue"
3045
+ },
3046
+ "data": {}
3047
+ }
3048
+ },
3049
+ {
3050
+ "type": "object",
3051
+ "additionalProperties": false,
3052
+ "required": [
3053
+ "action"
3054
+ ],
3055
+ "properties": {
3056
+ "action": {
3057
+ "const": "cancel"
3058
+ }
3059
+ }
3060
+ }
3061
+ ]
3062
+ }
3063
+ }
3019
3064
  }
3020
3065
  }
3021
3066
  }