@mhome/conversation-protocol 3.16.0 → 4.0.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,
@@ -301,30 +151,7 @@
301
151
  "type": "array",
302
152
  "minItems": 1,
303
153
  "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
- }
154
+ "$ref": "#/$defs/interactionItem"
328
155
  }
329
156
  }
330
157
  }
@@ -2011,7 +1838,7 @@
2011
1838
  "required": [
2012
1839
  "threadId",
2013
1840
  "batchId",
2014
- "decisions"
1841
+ "responses"
2015
1842
  ],
2016
1843
  "properties": {
2017
1844
  "threadId": {
@@ -2020,27 +1847,11 @@
2020
1847
  "batchId": {
2021
1848
  "$ref": "#/$defs/id"
2022
1849
  },
2023
- "decisions": {
1850
+ "responses": {
2024
1851
  "type": "array",
2025
1852
  "minItems": 1,
2026
1853
  "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
- }
1854
+ "$ref": "#/$defs/interactionItemResponse"
2044
1855
  }
2045
1856
  }
2046
1857
  }
@@ -2574,7 +2385,7 @@
2574
2385
  "required": [
2575
2386
  "requestId",
2576
2387
  "batchId",
2577
- "decisions",
2388
+ "responses",
2578
2389
  "occurredAtUnixMs"
2579
2390
  ],
2580
2391
  "properties": {
@@ -2584,32 +2395,16 @@
2584
2395
  "batchId": {
2585
2396
  "$ref": "#/$defs/id"
2586
2397
  },
2587
- "decisions": {
2398
+ "occurredAtUnixMs": {
2399
+ "type": "integer",
2400
+ "minimum": 0
2401
+ },
2402
+ "responses": {
2588
2403
  "type": "array",
2589
2404
  "minItems": 1,
2590
2405
  "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
- }
2406
+ "$ref": "#/$defs/interactionItemResponse"
2608
2407
  }
2609
- },
2610
- "occurredAtUnixMs": {
2611
- "type": "integer",
2612
- "minimum": 0
2613
2408
  }
2614
2409
  }
2615
2410
  }
@@ -3016,6 +2811,248 @@
3016
2811
  }
3017
2812
  }
3018
2813
  }
2814
+ },
2815
+ "interactionCard": {
2816
+ "type": "object",
2817
+ "additionalProperties": false,
2818
+ "required": [
2819
+ "type",
2820
+ "title",
2821
+ "message",
2822
+ "tone",
2823
+ "continueLabel",
2824
+ "cancelLabel",
2825
+ "data"
2826
+ ],
2827
+ "properties": {
2828
+ "type": {
2829
+ "type": "string",
2830
+ "minLength": 1,
2831
+ "pattern": "^[a-z0-9._]+$"
2832
+ },
2833
+ "title": {
2834
+ "type": "string",
2835
+ "minLength": 1,
2836
+ "pattern": "\\S"
2837
+ },
2838
+ "message": {
2839
+ "type": "string"
2840
+ },
2841
+ "tone": {
2842
+ "enum": [
2843
+ "normal",
2844
+ "danger"
2845
+ ]
2846
+ },
2847
+ "continueLabel": {
2848
+ "type": "string",
2849
+ "minLength": 1,
2850
+ "pattern": "\\S"
2851
+ },
2852
+ "cancelLabel": {
2853
+ "type": "string",
2854
+ "minLength": 1,
2855
+ "pattern": "\\S"
2856
+ },
2857
+ "data": {
2858
+ "type": "object"
2859
+ }
2860
+ }
2861
+ },
2862
+ "interactionAnswer": {
2863
+ "oneOf": [
2864
+ {
2865
+ "type": "object",
2866
+ "additionalProperties": false,
2867
+ "required": [
2868
+ "action"
2869
+ ],
2870
+ "properties": {
2871
+ "action": {
2872
+ "const": "approve"
2873
+ }
2874
+ }
2875
+ },
2876
+ {
2877
+ "type": "object",
2878
+ "additionalProperties": false,
2879
+ "required": [
2880
+ "action"
2881
+ ],
2882
+ "properties": {
2883
+ "action": {
2884
+ "const": "reject"
2885
+ }
2886
+ }
2887
+ },
2888
+ {
2889
+ "type": "object",
2890
+ "additionalProperties": false,
2891
+ "required": [
2892
+ "action",
2893
+ "data"
2894
+ ],
2895
+ "properties": {
2896
+ "action": {
2897
+ "const": "continue"
2898
+ },
2899
+ "data": {}
2900
+ }
2901
+ },
2902
+ {
2903
+ "type": "object",
2904
+ "additionalProperties": false,
2905
+ "required": [
2906
+ "action"
2907
+ ],
2908
+ "properties": {
2909
+ "action": {
2910
+ "const": "cancel"
2911
+ }
2912
+ }
2913
+ }
2914
+ ]
2915
+ },
2916
+ "interactionItem": {
2917
+ "type": "object",
2918
+ "additionalProperties": false,
2919
+ "required": [
2920
+ "actionId",
2921
+ "kind",
2922
+ "card"
2923
+ ],
2924
+ "properties": {
2925
+ "actionId": {
2926
+ "type": "string",
2927
+ "minLength": 1,
2928
+ "pattern": "\\S"
2929
+ },
2930
+ "kind": {
2931
+ "enum": [
2932
+ "approval",
2933
+ "user_action"
2934
+ ]
2935
+ },
2936
+ "expiresAt": {
2937
+ "type": "string"
2938
+ },
2939
+ "card": {
2940
+ "type": "object",
2941
+ "additionalProperties": false,
2942
+ "required": [
2943
+ "type",
2944
+ "title",
2945
+ "message",
2946
+ "tone",
2947
+ "continueLabel",
2948
+ "cancelLabel",
2949
+ "data"
2950
+ ],
2951
+ "properties": {
2952
+ "type": {
2953
+ "type": "string",
2954
+ "minLength": 1,
2955
+ "pattern": "^[a-z0-9._]+$"
2956
+ },
2957
+ "title": {
2958
+ "type": "string",
2959
+ "minLength": 1,
2960
+ "pattern": "\\S"
2961
+ },
2962
+ "message": {
2963
+ "type": "string"
2964
+ },
2965
+ "tone": {
2966
+ "enum": [
2967
+ "normal",
2968
+ "danger"
2969
+ ]
2970
+ },
2971
+ "continueLabel": {
2972
+ "type": "string",
2973
+ "minLength": 1,
2974
+ "pattern": "\\S"
2975
+ },
2976
+ "cancelLabel": {
2977
+ "type": "string",
2978
+ "minLength": 1,
2979
+ "pattern": "\\S"
2980
+ },
2981
+ "data": {
2982
+ "type": "object"
2983
+ }
2984
+ }
2985
+ }
2986
+ }
2987
+ },
2988
+ "interactionItemResponse": {
2989
+ "type": "object",
2990
+ "additionalProperties": false,
2991
+ "required": [
2992
+ "actionId",
2993
+ "response"
2994
+ ],
2995
+ "properties": {
2996
+ "actionId": {
2997
+ "type": "string",
2998
+ "minLength": 1,
2999
+ "pattern": "\\S"
3000
+ },
3001
+ "response": {
3002
+ "oneOf": [
3003
+ {
3004
+ "type": "object",
3005
+ "additionalProperties": false,
3006
+ "required": [
3007
+ "action"
3008
+ ],
3009
+ "properties": {
3010
+ "action": {
3011
+ "const": "approve"
3012
+ }
3013
+ }
3014
+ },
3015
+ {
3016
+ "type": "object",
3017
+ "additionalProperties": false,
3018
+ "required": [
3019
+ "action"
3020
+ ],
3021
+ "properties": {
3022
+ "action": {
3023
+ "const": "reject"
3024
+ }
3025
+ }
3026
+ },
3027
+ {
3028
+ "type": "object",
3029
+ "additionalProperties": false,
3030
+ "required": [
3031
+ "action",
3032
+ "data"
3033
+ ],
3034
+ "properties": {
3035
+ "action": {
3036
+ "const": "continue"
3037
+ },
3038
+ "data": {}
3039
+ }
3040
+ },
3041
+ {
3042
+ "type": "object",
3043
+ "additionalProperties": false,
3044
+ "required": [
3045
+ "action"
3046
+ ],
3047
+ "properties": {
3048
+ "action": {
3049
+ "const": "cancel"
3050
+ }
3051
+ }
3052
+ }
3053
+ ]
3054
+ }
3055
+ }
3019
3056
  }
3020
3057
  }
3021
3058
  }