-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenieApp.ts
78 lines (70 loc) · 2.68 KB
/
GenieApp.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import {
IAppAccessors,
IConfigurationExtend,
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/SettingType';
import { GennieCommand } from './commands/Genie';
export class GenieApp extends App {
constructor(info: IAppInfo, logger: ILogger, accessors: IAppAccessors) {
super(info, logger, accessors);
}
public async extendConfiguration(
configuration: IConfigurationExtend
): Promise<void> {
await configuration.settings.provideSetting({
id: 'opsgenie_api_url',
type: SettingType.STRING,
packageValue: 'https://api.opsgenie.com/v2/',
required: true,
public: false,
multiline: false,
i18nLabel: 'opsgenie_api_url',
i18nDescription: 'opsgenie_api_url_desc',
});
await configuration.settings.provideSetting({
id: 'opsgenie_api_key',
type: SettingType.STRING,
packageValue: 'XXX-YYYY-ZZZ-WWWW-VVVV',
required: true,
public: false,
multiline: false,
i18nLabel: 'opsgenie_api_key',
i18nDescription: 'opsgenie_api_key_desc',
});
await configuration.settings.provideSetting({
id: 'opsgenie_api_integration_key',
type: SettingType.STRING,
packageValue: 'XXX-YYYY-ZZZ-WWWW-VVVV',
required: true,
public: false,
multiline: false,
i18nLabel: 'opsgenie_api_integration_key',
i18nDescription: 'opsgenie_api_integration_key_desc',
});
await configuration.settings.provideSetting({
id: 'opsgenie_notify_only',
type: SettingType.BOOLEAN,
packageValue: true,
required: true,
public: false,
multiline: false,
i18nLabel: 'opsgenie_notify_only',
i18nDescription: 'opsgenie_notify_only_desc',
});
await configuration.settings.provideSetting({
id: 'opsgenie_domain',
type: SettingType.STRING,
packageValue: 'https://rjmfernandes2.app.opsgenie.com',
required: true,
public: false,
multiline: false,
i18nLabel: 'opsgenie_domain',
i18nDescription: 'opsgenie_domain_desc',
});
const genieCommand: GennieCommand = new GennieCommand();
await configuration.slashCommands.provideSlashCommand(genieCommand);
}
}