diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 14963051a..04a174bec 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -57,7 +57,7 @@ const config = { redirects: [ { to: '/getting-started', - from: ['/tutorial/getting-started','/tutorial/getting-started-http'], + from: ['/tutorial/getting-started', '/tutorial/getting-started-http'], }, { to: '/concepts/steps-from-apps', @@ -65,15 +65,12 @@ const config = { '/concepts/creating-steps', '/concepts/adding-editing-steps', '/concepts/saving-steps', - '/concepts/executing-steps' + '/concepts/executing-steps', ], }, { to: '/concepts/actions', - from: [ - '/concepts/action-listening', - '/concepts/action-responding' - ], + from: ['/concepts/action-listening', '/concepts/action-responding'], }, { to: '/', diff --git a/docs/sidebars.js b/docs/sidebars.js index 7ea9d6924..e5442a016 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -2,108 +2,92 @@ const sidebars = { sidebarJSBolt: [ { - type: "doc", - id: "index", - label: "Bolt for JavaScript", - className: "sidebar-title", + type: 'doc', + id: 'index', + label: 'Bolt for JavaScript', + className: 'sidebar-title', }, - "getting-started", + 'getting-started', { - type: "category", - label: "Slack API calls", - items: ["concepts/message-sending", "concepts/web-api"], + type: 'category', + label: 'Slack API calls', + items: ['concepts/message-sending', 'concepts/web-api'], }, { - type: "category", - label: "Events", - items: ["concepts/message-listening", "concepts/event-listening"], + type: 'category', + label: 'Events', + items: ['concepts/message-listening', 'concepts/event-listening'], }, { - type: "category", - label: "App UI & Interactivity", + type: 'category', + label: 'App UI & Interactivity', items: [ - "concepts/acknowledge", - "concepts/shortcuts", - "concepts/commands", - "concepts/actions", - "concepts/creating-modals", - "concepts/updating-pushing-views", - "concepts/view-submissions", - "concepts/select-menu-options", - "concepts/publishing-views", + 'concepts/acknowledge', + 'concepts/shortcuts', + 'concepts/commands', + 'concepts/actions', + 'concepts/creating-modals', + 'concepts/updating-pushing-views', + 'concepts/view-submissions', + 'concepts/select-menu-options', + 'concepts/publishing-views', ], }, - "concepts/custom-steps", + 'concepts/custom-steps', { - type: "category", - label: "App Configuration", + type: 'category', + label: 'App Configuration', items: [ - "concepts/socket-mode", - "concepts/error-handling", - "concepts/logging", - "concepts/custom-routes", - "concepts/deferring-initialization", - "concepts/receiver", + 'concepts/socket-mode', + 'concepts/error-handling', + 'concepts/logging', + 'concepts/custom-routes', + 'concepts/deferring-initialization', + 'concepts/receiver', ], }, { - type: "category", - label: "Middleware & Context", - items: [ - "concepts/global-middleware", - "concepts/listener-middleware", - "concepts/context", - ], + type: 'category', + label: 'Middleware & Context', + items: ['concepts/global-middleware', 'concepts/listener-middleware', 'concepts/context'], }, { - type: "category", - label: "Authorization & Security", - items: [ - "concepts/authenticating-oauth", - "concepts/authorization", - "concepts/token-rotation", - ], + type: 'category', + label: 'Authorization & Security', + items: ['concepts/authenticating-oauth', 'concepts/authorization', 'concepts/token-rotation'], }, { - type: "category", - label: "Deployments", - items: ["deployments/aws-lambda", "deployments/heroku"], + type: 'category', + label: 'Deployments', + items: ['deployments/aws-lambda', 'deployments/heroku'], }, { - type: "category", - label: "Migration Guides", - items: [ - "migration/migration-v2", - "migration/migration-v3", - "migration/migration-v4", - ], + type: 'category', + label: 'Migration Guides', + items: ['migration/migration-v2', 'migration/migration-v3', 'migration/migration-v4'], }, { - type: "category", - label: "Legacy", - items: [ - "legacy/hubot-migration", - "legacy/steps-from-apps", - "legacy/conversation-store", - ], + type: 'category', + label: 'Legacy', + items: ['legacy/hubot-migration', 'legacy/steps-from-apps', 'legacy/conversation-store'], }, - { type: "html", value: "
" }, - "reference", - { type: "html", value: "
" }, + { type: 'html', value: '
' }, + 'reference', + { type: 'html', value: '
' }, { - type: "link", - label: "Release notes", - href: "https://github.com/slackapi/bolt-js/releases", + type: 'link', + label: 'Release notes', + href: 'https://github.com/slackapi/bolt-js/releases', }, { - type: "link", - label: "Code on GitHub", - href: "https://github.com/SlackAPI/bolt-js", + type: 'link', + label: 'Code on GitHub', + href: 'https://github.com/SlackAPI/bolt-js', }, { - type: "link", - label: "Contributors Guide", - href: "https://github.com/SlackAPI/bolt-js/blob/main/.github/contributing.md", + type: 'link', + label: 'Contributors Guide', + href: 'https://github.com/SlackAPI/bolt-js/blob/main/.github/contributing.md', }, ], }; diff --git a/src/Assistant.ts b/src/Assistant.ts index ddcc44c27..14d817d19 100644 --- a/src/Assistant.ts +++ b/src/Assistant.ts @@ -45,11 +45,16 @@ type SetSuggestedPromptsFn = ( ) => Promise; interface SetSuggestedPromptsArguments { + /** @description Prompt suggestions that appear when opening assistant thread. */ prompts: [AssistantPrompt, ...AssistantPrompt[]]; + /** @description Title for the prompts. */ + title?: string; } interface AssistantPrompt { + /** @description Title of the prompt. */ title: string; + /** @description Message of the prompt. */ message: string; } @@ -345,11 +350,12 @@ function createSetSuggestedPrompts(args: AllAssistantMiddlewareArgs): SetSuggest const { channelId: channel_id, threadTs: thread_ts } = extractThreadInfo(payload); return (params: Parameters[0]) => { - const { prompts } = params; + const { prompts, title } = params; return client.assistant.threads.setSuggestedPrompts({ channel_id, thread_ts, prompts, + title, }); }; } diff --git a/test/unit/Assistant.spec.ts b/test/unit/Assistant.spec.ts index 61071f832..40dc4b24f 100644 --- a/test/unit/Assistant.spec.ts +++ b/test/unit/Assistant.spec.ts @@ -387,7 +387,7 @@ describe('Assistant class', () => { const { enrichAssistantArgs } = await importAssistant(); const threadStartedArgs = enrichAssistantArgs(mockThreadContextStore, mockThreadStartedArgs); - await threadStartedArgs.setSuggestedPrompts({ prompts: [{ title: '', message: '' }] }); + await threadStartedArgs.setSuggestedPrompts({ prompts: [{ title: '', message: '' }], title: '' }); sinon.assert.called(fakeClient.assistant.threads.setSuggestedPrompts); });