This repository was archived by the owner on Apr 3, 2025. It is now read-only.
forked from assistify/rcapps-gitlab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGitLabApp.ts
46 lines (40 loc) · 1.54 KB
/
GitLabApp.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
import {
IAppAccessors,
IConfigurationExtend,
IEnvironmentRead,
ILogger,
} from '@rocket.chat/apps-engine/definition/accessors';
import { ApiSecurity, ApiVisibility} from '@rocket.chat/apps-engine/definition/api';
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 { GitLabCommand } from './commands/GitLabCommands';
import { GitLabEndpoint} from './endpoints/GitLabEndpoint';
import { Issue } from './models/Issue';
export class GitLabApp extends App {
public issue: Issue;
constructor(info: IAppInfo, logger: ILogger, accessors: IAppAccessors) {
super(info, logger, accessors);
this.getLogger();
}
public async initialize(configurationExtend: IConfigurationExtend, environmentRead: IEnvironmentRead) {
configurationExtend.settings.provideSetting({
id: 'url',
type: SettingType.STRING,
packageValue: '',
required: true,
public: false,
i18nLabel: 'url',
});
// TODO:Disable slashcommands for now
// configurationExtend.slashCommands.provideSlashCommand(new GitLabCommand(this));
configurationExtend.api.provideApi({
visibility: ApiVisibility.PUBLIC,
security: ApiSecurity.UNSECURE,
endpoints: [
new GitLabEndpoint(this),
],
});
this.issue = new Issue();
}
}