-
Notifications
You must be signed in to change notification settings - Fork 2
/
CloudflareApp.ts
58 lines (51 loc) · 1.99 KB
/
CloudflareApp.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import {
IConfigurationExtend, IEnvironmentRead, ILogger,
} from '@rocket.chat/apps-engine/definition/accessors';
import { App } from '@rocket.chat/apps-engine/definition/App';
import { IAppInfo } from '@rocket.chat/apps-engine/definition/metadata';
import { SettingType } from '@rocket.chat/apps-engine/definition/settings';
import { CloudflareSlashCommand } from './slashcommands';
export class CloudflareApp extends App {
constructor(info: IAppInfo, logger: ILogger) {
super(info, logger);
}
public async extendConfiguration(configuration: IConfigurationExtend, environmentRead: IEnvironmentRead): Promise<void> {
configuration.slashCommands.provideSlashCommand(new CloudflareSlashCommand(this));
configuration.settings.provideSetting({
id: 'user_alias',
type: SettingType.STRING,
packageValue: 'Cloudflare',
required: true,
public: false,
i18nLabel: 'user_alias_label',
i18nDescription: 'user_alias_description',
});
configuration.settings.provideSetting({
id: 'user_avatar',
type: SettingType.STRING,
packageValue: 'https://www.cloudflare.com/img/cf-facebook-card.png',
required: true,
public: false,
i18nLabel: 'user_avatar_label',
i18nDescription: 'user_avatar_description',
});
configuration.settings.provideSetting({
id: 'auth_key',
type: SettingType.STRING,
packageValue: '',
required: true,
public: false,
i18nLabel: 'auth_key',
i18nDescription: 'auth_key_description',
});
configuration.settings.provideSetting({
id: 'auth_email',
type: SettingType.STRING,
packageValue: '',
required: true,
public: false,
i18nLabel: 'auth_email',
i18nDescription: 'auth_email_description',
});
}
}