-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathexample-plugin.ts
40 lines (35 loc) · 1.48 KB
/
example-plugin.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
import { Session } from "@noovolari/leapp-core/models/session";
import { AwsCredentialsPlugin } from "@noovolari/leapp-core/plugin-sdk/aws-credentials-plugin";
import { PluginLogLevel } from "@noovolari/leapp-core/plugin-sdk/plugin-log-level";
export class ExamplePlugin extends AwsCredentialsPlugin {
get actionName(): string {
return "Add a friendly name for your plugin action, eg. My first Plugin";
}
/*
* Get your icon here:
* https://fontawesome.com/v5/search
*/
get actionIcon(): string {
return "Add a font awesome compatible icon tag, e.g. fa fa-globe";
}
/*
* @params
* session Session my session object (https://github.com/Noovolari/leapp/blob/master/packages/core/src/models/session.ts)
* credentials Credential-Info my credentials object (https://github.com/Noovolari/leapp/blob/master/packages/core/src/models/credentials-info.ts)
*/
async applySessionAction(session: Session, credentials: any): Promise<void> {
/* Add your plugin code here...
*
* You can also access this.pluginEnvironment which have 3 useful methods
*
* log("MESSAGE", PluginLogLevel, display?);
* e.g. this.pluginEnvironment.log("Starting opening Web Console", PluginLogLevel.info, true);
*
* fetch("MYURL");
* e.g. this.pluginEnvironment.fetch("https://www.google.it");
*
* openExternalUrl("MYURL");
* e.g. this.plugin.pluginEnvironment.openExternalUrl("https://www.google.it");
*/
}
}