forked from mrsric/rocketchat-glpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGLPITicketApp.ts
91 lines (82 loc) · 2.69 KB
/
GLPITicketApp.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
79
80
81
82
83
84
85
86
87
88
89
90
91
import {
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';
import { CreateTicketCommand } from './commands/CreateTicketCommand';
export class CreateTicketApp extends App {
constructor(info: IAppInfo, logger: ILogger) {
super(info, logger);
}
public async onEnable(): Promise<boolean> {
return true;
}
protected async extendConfiguration(
configuration: IConfigurationExtend,
): Promise<void> {
await configuration.settings.provideSetting({
id: 'webServiceUrl',
type: SettingType.STRING,
packageValue: 'https://',
required: true,
public: false,
section: 'GLPI',
i18nLabel: 'GLPI Web Service Url',
i18nDescription:
`URL do servideo GLPI, por exemplo - servidorglpi`,
});
await configuration.settings.provideSetting({
id: 'isAuthToken',
type: SettingType.BOOLEAN,
packageValue: true,
required: true,
public: false,
section: 'Autenticação via Token',
i18nLabel: 'Token',
i18nDescription: 'Utilizar Token ao invés de usuário e senha',
});
await configuration.settings.provideSetting({
id: 'glpiTokenUser',
type: SettingType.STRING,
packageValue: '',
required: true,
public: false,
section: 'Autenticação Token',
i18nLabel: 'Token Usuário',
i18nDescription: 'Token para atenticação da API no GLPI',
});
await configuration.settings.provideSetting({
id: 'glpiTokenApp',
type: SettingType.STRING,
packageValue: '',
required: true,
public: false,
section: 'Autenticação Token',
i18nLabel: 'Token Aplicação',
i18nDescription: 'Token de aplicação no GLPI',
});
await configuration.settings.provideSetting({
id: 'glpiTimeZone',
type: SettingType.STRING,
packageValue: 'America/Sao_Paulo',
required: false,
public: false,
i18nLabel: 'Fuso Horário',
i18nDescription: 'Fuso Horário para trancrição do Chat. Ex America/Sao_Paulo. (Senão informado será utilizado o UTC)',
});
await configuration.settings.provideSetting({
id: 'glpiIsHtml',
type: SettingType.BOOLEAN,
packageValue: true,
required: true,
public: false,
i18nLabel: 'HTML',
i18nDescription: 'Utilizar HTML nos chamados. (Desmarque caso queira texto simples)',
});
await configuration.slashCommands.provideSlashCommand(
new CreateTicketCommand(this),
);
}
}