|
@@ -13,8 +13,7 @@ export class RegisterService implements GrowiCommandProcessor {
|
|
|
|
|
|
|
|
async process(growiCommand: GrowiCommand, authorizeResult: AuthorizeResult, body: {[key:string]:string}): Promise<void> {
|
|
async process(growiCommand: GrowiCommand, authorizeResult: AuthorizeResult, body: {[key:string]:string}): Promise<void> {
|
|
|
const { botToken } = authorizeResult;
|
|
const { botToken } = authorizeResult;
|
|
|
- console.log(body.channel_name);
|
|
|
|
|
- // tmp use process.env
|
|
|
|
|
|
|
+
|
|
|
const client = new WebClient(botToken, { logLevel: isProduction ? LogLevel.DEBUG : LogLevel.INFO });
|
|
const client = new WebClient(botToken, { logLevel: isProduction ? LogLevel.DEBUG : LogLevel.INFO });
|
|
|
await client.views.open({
|
|
await client.views.open({
|
|
|
trigger_id: body.trigger_id,
|
|
trigger_id: body.trigger_id,
|
|
@@ -37,21 +36,6 @@ export class RegisterService implements GrowiCommandProcessor {
|
|
|
generateInputSectionBlock('growiDomain', 'GROWI domain', 'contents_input', false, 'https://example.com'),
|
|
generateInputSectionBlock('growiDomain', 'GROWI domain', 'contents_input', false, 'https://example.com'),
|
|
|
generateInputSectionBlock('growiAccessToken', 'GROWI ACCESS_TOKEN', 'contents_input', false, 'jBMZvpk.....'),
|
|
generateInputSectionBlock('growiAccessToken', 'GROWI ACCESS_TOKEN', 'contents_input', false, 'jBMZvpk.....'),
|
|
|
generateInputSectionBlock('proxyToken', 'PROXY ACCESS_TOKEN', 'contents_input', false, 'jBMZvpk.....'),
|
|
generateInputSectionBlock('proxyToken', 'PROXY ACCESS_TOKEN', 'contents_input', false, 'jBMZvpk.....'),
|
|
|
- // added an input block to make response_url enabled and get info (block_id, action_id, channel_id, response_url)
|
|
|
|
|
- // refer to https://api.slack.com/surfaces/modals/using#modal_response_url
|
|
|
|
|
- // {
|
|
|
|
|
- // type: 'input',
|
|
|
|
|
- // label: {
|
|
|
|
|
- // type: 'plain_text',
|
|
|
|
|
- // text: 'Select a channel to post the proxy URL on',
|
|
|
|
|
- // },
|
|
|
|
|
- // element: {
|
|
|
|
|
- // action_id: 'submit_growi_url_and_access_tokens',
|
|
|
|
|
- // type: 'conversations_select',
|
|
|
|
|
- // response_url_enabled: true,
|
|
|
|
|
- // default_to_current_conversation: true,
|
|
|
|
|
- // },
|
|
|
|
|
- // },
|
|
|
|
|
],
|
|
],
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
@@ -86,8 +70,6 @@ export class RegisterService implements GrowiCommandProcessor {
|
|
|
): Promise<void> {
|
|
): Promise<void> {
|
|
|
|
|
|
|
|
const { botToken } = authorizeResult;
|
|
const { botToken } = authorizeResult;
|
|
|
- console.log((payload.view.private_metadata));
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
const serverUri = process.env.SERVER_URI;
|
|
const serverUri = process.env.SERVER_URI;
|
|
|
|
|
|