@@ -208,6 +208,63 @@ export default {
208208 } ) ) ;
209209 } ,
210210 } ,
211+ categoryId : {
212+ type : "integer" ,
213+ label : "Category ID" ,
214+ description : "Select a category or provide an ID" ,
215+ async options ( {
216+ helpCenterId, page = 0 ,
217+ } ) {
218+ const response = await this . listCategories ( {
219+ helpCenterId,
220+ params : {
221+ page : page + 1 ,
222+ } ,
223+ } ) ;
224+ return response . data . map ( ( category ) => ( {
225+ label : category . name ,
226+ value : category . id ,
227+ } ) ) ;
228+ } ,
229+ } ,
230+ articleId : {
231+ type : "integer" ,
232+ label : "Article ID" ,
233+ description : "Select an article or provide an ID" ,
234+ async options ( {
235+ helpCenterId, page = 0 ,
236+ } ) {
237+ const response = await this . getArticles ( {
238+ helpCenterId,
239+ params : {
240+ page : page + 1 ,
241+ } ,
242+ } ) ;
243+ return response . data . map ( ( article ) => ( {
244+ label : article . title ,
245+ value : article . id ,
246+ } ) ) ;
247+ } ,
248+ } ,
249+ blockId : {
250+ type : "integer" ,
251+ label : "Block ID" ,
252+ description : "Select a block or provide an ID" ,
253+ async options ( {
254+ helpCenterId, page = 0 ,
255+ } ) {
256+ const response = await this . listBlocks ( {
257+ helpCenterId,
258+ params : {
259+ page : page + 1 ,
260+ } ,
261+ } ) ;
262+ return response . data . map ( ( block ) => ( {
263+ label : block . name ,
264+ value : block . id ,
265+ } ) ) ;
266+ } ,
267+ } ,
211268 } ,
212269 methods : {
213270 _getUrl ( path ) {
@@ -371,5 +428,59 @@ export default {
371428 ...args ,
372429 } ) ;
373430 } ,
431+ listQuickReplies ( args = { } ) {
432+ return this . _makeRequest ( {
433+ path : "/quick_replies" ,
434+ ...args ,
435+ } ) ;
436+ } ,
437+ getHelpCenter ( {
438+ helpCenterId, ...args
439+ } = { } ) {
440+ return this . _makeRequest ( {
441+ path : `/help_center/${ helpCenterId } ` ,
442+ ...args ,
443+ } ) ;
444+ } ,
445+ listCategories ( {
446+ helpCenterId, ...args
447+ } = { } ) {
448+ return this . _makeRequest ( {
449+ path : `/help_center/${ helpCenterId } /categories` ,
450+ ...args ,
451+ } ) ;
452+ } ,
453+ getCategory ( {
454+ helpCenterId, categoryId, ...args
455+ } = { } ) {
456+ return this . _makeRequest ( {
457+ path : `/help_center/${ helpCenterId } /categories/${ categoryId } ` ,
458+ ...args ,
459+ } ) ;
460+ } ,
461+ getArticle ( {
462+ helpCenterId, articleId, ...args
463+ } = { } ) {
464+ return this . _makeRequest ( {
465+ path : `/help_center/${ helpCenterId } /articles/${ articleId } ` ,
466+ ...args ,
467+ } ) ;
468+ } ,
469+ listBlocks ( {
470+ helpCenterId, ...args
471+ } = { } ) {
472+ return this . _makeRequest ( {
473+ path : `/help_center/${ helpCenterId } /blocks` ,
474+ ...args ,
475+ } ) ;
476+ } ,
477+ getBlock ( {
478+ helpCenterId, blockId, ...args
479+ } = { } ) {
480+ return this . _makeRequest ( {
481+ path : `/help_center/${ helpCenterId } /blocks/${ blockId } ` ,
482+ ...args ,
483+ } ) ;
484+ } ,
374485 } ,
375486} ;
0 commit comments