@xapp/stentor-gbm 1.45.97 → 1.45.99
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.
|
@@ -50,7 +50,7 @@ class TranslateResponse extends lib_1.Translator {
|
|
|
50
50
|
representative,
|
|
51
51
|
text,
|
|
52
52
|
suggestions,
|
|
53
|
-
containsRichText
|
|
53
|
+
containsRichText
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
if (card) {
|
|
@@ -68,14 +68,14 @@ class TranslateResponse extends lib_1.Translator {
|
|
|
68
68
|
height: models_1.Height.MEDIUM,
|
|
69
69
|
contentInfo: {
|
|
70
70
|
fileUrl: imageUrl,
|
|
71
|
-
forceRefresh: false
|
|
72
|
-
}
|
|
71
|
+
forceRefresh: false
|
|
72
|
+
}
|
|
73
73
|
}
|
|
74
74
|
: undefined,
|
|
75
|
-
suggestions
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
75
|
+
suggestions
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
if (list) {
|
|
@@ -94,15 +94,15 @@ class TranslateResponse extends lib_1.Translator {
|
|
|
94
94
|
height: models_1.Height.MEDIUM,
|
|
95
95
|
contentInfo: {
|
|
96
96
|
fileUrl: list.items[0].image.url,
|
|
97
|
-
forceRefresh: false
|
|
98
|
-
}
|
|
97
|
+
forceRefresh: false
|
|
98
|
+
}
|
|
99
99
|
}
|
|
100
100
|
: undefined,
|
|
101
|
-
suggestions
|
|
102
|
-
}
|
|
101
|
+
suggestions
|
|
102
|
+
}
|
|
103
103
|
}
|
|
104
|
-
: undefined
|
|
105
|
-
}
|
|
104
|
+
: undefined
|
|
105
|
+
}
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -110,7 +110,7 @@ class TranslateResponse extends lib_1.Translator {
|
|
|
110
110
|
gbmResponses.push({
|
|
111
111
|
messageId: (0, uuid_1.v4)(),
|
|
112
112
|
representative: this.getRepresentative(),
|
|
113
|
-
text: "Something went wrong. The gremlins were fed after midnight. Try later!"
|
|
113
|
+
text: "Something went wrong. The gremlins were fed after midnight. Try later!"
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
return gbmResponses.length === 1 ? gbmResponses[0] : gbmResponses;
|
|
@@ -119,7 +119,7 @@ class TranslateResponse extends lib_1.Translator {
|
|
|
119
119
|
return {
|
|
120
120
|
representativeType: models_1.RepresentativeType.BOT,
|
|
121
121
|
displayName: this.props.botAvatarName,
|
|
122
|
-
avatarImage: this.props.botAvatarImageUrl
|
|
122
|
+
avatarImage: this.props.botAvatarImageUrl
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
}
|
|
@@ -139,8 +139,8 @@ function convertSuggestions(suggestions) {
|
|
|
139
139
|
gbmSuggestions.push({
|
|
140
140
|
reply: {
|
|
141
141
|
text: suggestion,
|
|
142
|
-
postbackData: suggestion
|
|
143
|
-
}
|
|
142
|
+
postbackData: suggestion
|
|
143
|
+
}
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
else if (suggestion.title && suggestion.url) {
|
|
@@ -153,9 +153,9 @@ function convertSuggestions(suggestions) {
|
|
|
153
153
|
text: suggestion.title,
|
|
154
154
|
postbackData: url,
|
|
155
155
|
dialAction: {
|
|
156
|
-
phoneNumber
|
|
157
|
-
}
|
|
158
|
-
}
|
|
156
|
+
phoneNumber
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
159
|
});
|
|
160
160
|
}
|
|
161
161
|
else {
|
|
@@ -164,9 +164,9 @@ function convertSuggestions(suggestions) {
|
|
|
164
164
|
text: suggestion.title,
|
|
165
165
|
postbackData: url,
|
|
166
166
|
openUrlAction: {
|
|
167
|
-
url
|
|
168
|
-
}
|
|
169
|
-
}
|
|
167
|
+
url
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
}
|
|
@@ -174,8 +174,8 @@ function convertSuggestions(suggestions) {
|
|
|
174
174
|
gbmSuggestions.push({
|
|
175
175
|
reply: {
|
|
176
176
|
text: suggestion.title,
|
|
177
|
-
postbackData: suggestion.title
|
|
178
|
-
}
|
|
177
|
+
postbackData: suggestion.title
|
|
178
|
+
}
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
}
|
|
@@ -194,10 +194,10 @@ function convertButtonSuggestions(buttons) {
|
|
|
194
194
|
for (const button of buttons) {
|
|
195
195
|
if (button.title) {
|
|
196
196
|
gbmSuggestions.push({
|
|
197
|
-
|
|
197
|
+
reply: {
|
|
198
198
|
text: button.title,
|
|
199
|
-
postbackData: button.title
|
|
200
|
-
}
|
|
199
|
+
postbackData: button.title
|
|
200
|
+
}
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
}
|
|
@@ -222,15 +222,15 @@ function convertList(list) {
|
|
|
222
222
|
height: models_1.Height.MEDIUM,
|
|
223
223
|
contentInfo: {
|
|
224
224
|
fileUrl: imageUrl,
|
|
225
|
-
forceRefresh: false
|
|
226
|
-
}
|
|
225
|
+
forceRefresh: false
|
|
226
|
+
}
|
|
227
227
|
}
|
|
228
|
-
: undefined
|
|
228
|
+
: undefined
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
return {
|
|
232
232
|
cardWidth: models_1.CardWidth.MEDIUM,
|
|
233
|
-
cardContents: cardContents
|
|
233
|
+
cardContents: cardContents
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Translators/TranslateResponse/index.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AACpC,4CAAgD;AAGhD,uDAAkD;AAClD,mDAAqC;AAErC,+BAAoC;AACpC,kDAAmD;AAEnD,yCAQsB;AAGtB,MAAa,iBAAkB,SAAQ,gBAA0D;IAG7F,YAAY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CAAC,KAAK;oBAClB,YAAY,EAAE,MAAM,CAAC,KAAK;iBAC7B;aACJ,CAAC,CAAC;SACN;KACJ;IAED,OAAO,cAAc,CAAC;AAC1B,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,IAAU;;IAC3B,MAAM,YAAY,GAAG,EAAE,CAAC;IAExB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,KAAK,EAAE;QAC/B,MAAM,QAAQ,GAAG,MAAA,QAAQ,CAAC,KAAK,0CAAE,GAAG,CAAC;QAErC,YAAY,CAAC,IAAI,CAAC;YACd,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,WAAW,EAAE,QAAQ,CAAC,WAAW;YACjC,WAAW,EAAE,wBAAwB,CAAC,QAAQ,CAAC,OAAO,CAAC;YACvD,KAAK,EAAE,QAAQ;gBACX,CAAC,CAAC;oBACI,MAAM,EAAE,eAAM,CAAC,MAAM;oBACrB,WAAW,EAAE;wBACT,OAAO,EAAE,QAAQ;wBACjB,YAAY,EAAE,KAAK;qBACtB;iBACJ;gBACH,CAAC,CAAC,SAAS;SAClB,CAAC,CAAC;KACN;IAED,OAAO;QACH,SAAS,EAAE,kBAAS,CAAC,MAAM;QAC3B,YAAY,EAAE,YAAY;KAC7B,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "1.45.
|
|
7
|
+
"version": "1.45.99",
|
|
8
8
|
"description": "Google Business Messages channel for stentor",
|
|
9
9
|
"types": "lib/index",
|
|
10
10
|
"main": "lib/index",
|
|
@@ -27,24 +27,24 @@
|
|
|
27
27
|
"mocha": "10.2.0",
|
|
28
28
|
"sinon": "15.1.0",
|
|
29
29
|
"sinon-chai": "3.7.0",
|
|
30
|
-
"stentor-constants": "1.57.
|
|
31
|
-
"stentor-guards": "1.57.
|
|
32
|
-
"stentor-interaction-model": "1.57.
|
|
33
|
-
"stentor-locales": "1.57.
|
|
34
|
-
"stentor-logger": "1.57.
|
|
35
|
-
"stentor-media": "1.57.
|
|
36
|
-
"stentor-models": "1.57.
|
|
37
|
-
"stentor-request": "1.57.
|
|
38
|
-
"stentor-response": "1.57.
|
|
39
|
-
"stentor-utils": "1.57.
|
|
30
|
+
"stentor-constants": "1.57.159",
|
|
31
|
+
"stentor-guards": "1.57.159",
|
|
32
|
+
"stentor-interaction-model": "1.57.159",
|
|
33
|
+
"stentor-locales": "1.57.159",
|
|
34
|
+
"stentor-logger": "1.57.159",
|
|
35
|
+
"stentor-media": "1.57.159",
|
|
36
|
+
"stentor-models": "1.57.159",
|
|
37
|
+
"stentor-request": "1.57.159",
|
|
38
|
+
"stentor-response": "1.57.159",
|
|
39
|
+
"stentor-utils": "1.57.159",
|
|
40
40
|
"ts-node": "10.9.1",
|
|
41
41
|
"typescript": "4.9.5",
|
|
42
42
|
"uuid": "9.0.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@xapp/patterns": "2.0.1",
|
|
46
|
-
"@xapp/stentor-actions-on-google": "1.45.
|
|
47
|
-
"@xapp/stentor-app": "1.45.
|
|
46
|
+
"@xapp/stentor-actions-on-google": "1.45.99",
|
|
47
|
+
"@xapp/stentor-app": "1.45.99",
|
|
48
48
|
"google-auth-library": "8.8.0",
|
|
49
49
|
"googleapis-common": "6.0.4",
|
|
50
50
|
"node-fetch": "2.6.11",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"clean": "rm -rf ./lib/*",
|
|
68
68
|
"test": "mocha --recursive -r ts-node/register \"./src/**/*.test.ts\""
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "b269cbac676ea675b118a0d5714b4d0c9cb76a2b"
|
|
71
71
|
}
|