Unverified Commit 37f249be authored by Bradley Hilton's avatar Bradley Hilton Committed by GitHub
Browse files

Update the Apps to Support Latest (#11)

* Update the ts-definition package and reflect the changes in the apps

* Providing settings and commands must be awaited for it to show up
parent 3397ba6c
......@@ -3,8 +3,8 @@
"name": "ASCII Art Commands",
"nameSlug": "asciiart-commands",
"description": "Provides neat little asciiart commands for fun usage.",
"version": "1.0.2",
"requiredApiVersion": ">=0.9.6",
"version": "1.0.3",
"requiredApiVersion": ">=0.9.13",
"author": {
"name": "Bradley Hilton",
"homepage": "https://github.com/graywolf336/temporary-apps-dev-environment",
......
......@@ -5,8 +5,9 @@ export class GimmeCommand implements ISlashCommand {
public static CommandName = 'gimme';
public command: string = GimmeCommand.CommandName;
public paramsExample: string = 'your_message_optional';
public i18nParamsExample: string = 'your_message_optional';
public i18nDescription: string = 'Slash_Gimme_Description';
public providesPreview: boolean = false;
public async executor(context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp): Promise<void> {
const builder = modify.getCreator().startMessage()
......
......@@ -5,8 +5,9 @@ export class LennyCommand implements ISlashCommand {
public static CommandName = 'lennyface';
public command: string = LennyCommand.CommandName;
public paramsExample: string = 'your_message_optional';
public i18nParamsExample: string = 'your_message_optional';
public i18nDescription: string = 'Slash_LennyFace_Description';
public providesPreview: boolean = false;
public async executor(context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp): Promise<void> {
await modify.getCreator().finish(modify.getCreator().startMessage({
......
......@@ -5,8 +5,9 @@ export class ShrugCommand implements ISlashCommand {
public static CommandName = 'shrug';
public command: string = ShrugCommand.CommandName;
public paramsExample: string = 'your_message_optional';
public i18nParamsExample: string = 'your_message_optional';
public i18nDescription: string = 'Slash_Shrug_Description';
public providesPreview: boolean = false;
public async executor(context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp): Promise<void> {
const msgBuilder = modify.getCreator().startMessage()
......
......@@ -5,8 +5,9 @@ export class TableflipCommand implements ISlashCommand {
public static CommandName = 'tableflip';
public command: string = TableflipCommand.CommandName;
public paramsExample: string = 'your_message_optional';
public i18nParamsExample: string = 'your_message_optional';
public i18nDescription: string = 'Slash_Tableflip_Description';
public providesPreview: boolean = false;
public async executor(context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp): Promise<void> {
const msgBuilder = modify.getCreator().startMessage()
......
......@@ -5,8 +5,9 @@ export class UnflipCommand implements ISlashCommand {
public static CommandName = 'unflip';
public command: string = UnflipCommand.CommandName;
public paramsExample: string = 'your_message_optional';
public i18nParamsExample: string = 'your_message_optional';
public i18nDescription: string = 'Slash_TableUnflip_Description';
public providesPreview: boolean = false;
public async executor(context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp): Promise<void> {
const msgBuilder = modify.getCreator().startMessage()
......
......@@ -3,8 +3,8 @@
"name": "Guggy Command",
"nameSlug": "guggy-command",
"description": "Provides a command for generating gifs based upon text provided.",
"version": "1.0.9",
"requiredApiVersion": ">=0.9.6",
"version": "1.0.10",
"requiredApiVersion": ">=0.9.13",
"author": {
"name": "Bradley Hilton",
"homepage": "https://github.com/graywolf336/temporary-apps-dev-environment",
......
......@@ -4,8 +4,9 @@ import { GuggyGetter } from '../getters/GuggyGetter';
export class GuggyCommand implements ISlashCommand {
public command = 'guggy';
public paramsExample = 'Guggy_Text_On_Image';
public i18nParamsExample = 'Guggy_Text_On_Image';
public i18nDescription = 'Guggy_Command_Description';
public providesPreview = false; // TODO: Convert this to true! :D
constructor(private readonly getter: GuggyGetter) { }
......
......@@ -7,8 +7,9 @@ import { IOutOfOfficeStorage } from './IOutOfOfficeStorage';
export class OutOfOfficeCommand implements ISlashCommand {
public command = 'out-of-office';
public paramsExample = 'outOfOfficeParamExample';
public i18nParamsExample = 'outOfOfficeParamExample';
public i18nDescription = 'outOfOfficeDescription';
public providesPreview = false;
// tslint:disable-next-line:max-line-length
public async executor(context: SlashCommandContext, read: IRead, modify: IModify, http: IHttp, persis: IPersistence): Promise<void> {
......
......@@ -3,8 +3,8 @@
"name": "Out of Office Responder",
"nameSlug": "out-of-office",
"description": "Provides a command and auto responder for being out of office",
"version": "1.0.1",
"requiredApiVersion": ">=0.9.6",
"version": "1.0.2",
"requiredApiVersion": ">=0.9.13",
"author": {
"name": "Bradley Hilton",
"homepage": "https://github.com/RocketChat/Rocket.Chat.Apps-dev-environment",
......
......@@ -124,10 +124,10 @@ export class TestingApp extends App implements IPreMessageSentPrevent, IPreMessa
// Test out various configuration extentions
protected async extendConfiguration(configuration: IConfigurationExtend, environmentRead: IEnvironmentRead): Promise<void> {
configuration.slashCommands.provideSlashCommand(new TestingNoPermission());
configuration.slashCommands.provideSlashCommand(new TestingWithPermission());
await configuration.slashCommands.provideSlashCommand(new TestingNoPermission());
await configuration.slashCommands.provideSlashCommand(new TestingWithPermission());
configuration.settings.provideSetting({
await configuration.settings.provideSetting({
id: TestingSettingsEnum.TESTING_PREFIX,
type: SettingType.STRING,
packageValue: 'testing-apps',
......@@ -137,7 +137,7 @@ export class TestingApp extends App implements IPreMessageSentPrevent, IPreMessa
i18nDescription: 'TestingApp_TestingPrefix_Description',
});
configuration.settings.provideSetting({
await configuration.settings.provideSetting({
id: TestingSettingsEnum.TESTING_A_BOOLEAN,
type: SettingType.BOOLEAN,
packageValue: true,
......@@ -147,7 +147,7 @@ export class TestingApp extends App implements IPreMessageSentPrevent, IPreMessa
i18nDescription: 'TestingApp_TestingBoolean_Description',
});
configuration.settings.provideSetting({
await configuration.settings.provideSetting({
id: TestingSettingsEnum.TESTING_A_COLOR,
type: SettingType.COLOR,
packageValue: '#00ff33',
......@@ -157,7 +157,7 @@ export class TestingApp extends App implements IPreMessageSentPrevent, IPreMessa
i18nDescription: 'TestingApp_TestingColor_Description',
});
configuration.settings.provideSetting({
await configuration.settings.provideSetting({
id: TestingSettingsEnum.TESTING_A_NUMBER,
type: SettingType.NUMBER,
packageValue: 1337,
......@@ -167,7 +167,7 @@ export class TestingApp extends App implements IPreMessageSentPrevent, IPreMessa
i18nDescription: 'TestingApp_TestingNumber_Description',
});
configuration.settings.provideSetting({
await configuration.settings.provideSetting({
id: TestingSettingsEnum.TESTING_A_SELECT,
type: SettingType.SELECT,
packageValue: 'second',
......@@ -195,7 +195,7 @@ export class TestingApp extends App implements IPreMessageSentPrevent, IPreMessa
],
});
configuration.settings.provideSetting({
await configuration.settings.provideSetting({
id: TestingSettingsEnum.TESTING_A_MULTI_LINE_STRING,
type: SettingType.STRING,
multiline: true,
......@@ -207,7 +207,7 @@ export class TestingApp extends App implements IPreMessageSentPrevent, IPreMessa
i18nDescription: 'TestingApp_TestingMultiString_Description',
});
configuration.settings.provideSetting({
await configuration.settings.provideSetting({
id: TestingSettingsEnum.TESTING_A_CODE,
type: SettingType.CODE,
packageValue: 'export class TestingSetting implements ISetting {\n public id: \'something-cool\'\n}',
......
......@@ -3,8 +3,8 @@
"name": "Testing App",
"nameSlug": "testing-app",
"description": "A Rocket.Chat Application used to test out the various features.",
"version": "0.0.8",
"requiredApiVersion": ">=0.9.6",
"version": "0.0.10",
"requiredApiVersion": ">=0.9.13",
"author": {
"name": "Bradley Hilton",
"homepage": "https://github.com/RocketChat/Rocket.Chat.Apps-ts-definitions",
......
......@@ -3,13 +3,15 @@ import { ISlashCommand, SlashCommandContext } from '@rocket.chat/apps-ts-definit
export class TestingNoPermission implements ISlashCommand {
public command: string;
public paramsExample: string;
public i18nParamsExample: string;
public i18nDescription: string;
public providesPreview: boolean;
constructor() {
this.command = 'testing-no-permission';
this.paramsExample = 'TestingApp_NoParams';
this.i18nParamsExample = 'TestingApp_NoParams';
this.i18nDescription = 'TestingApp_CmdNoPerm';
this.providesPreview = false;
}
// tslint:disable-next-line:max-line-length
......
......@@ -3,15 +3,17 @@ import { ISlashCommand, SlashCommandContext } from '@rocket.chat/apps-ts-definit
export class TestingWithPermission implements ISlashCommand {
public command: string;
public paramsExample: string;
public i18nParamsExample: string;
public i18nDescription: string;
public permission: string;
public providesPreview: boolean;
constructor() {
this.command = 'testing-with-permission';
this.paramsExample = 'TestingApp_NoParams';
this.i18nParamsExample = 'TestingApp_NoParams';
this.i18nDescription = 'TestingApp_CmdWithPerm';
this.permission = 'access-permissions';
this.providesPreview = false;
}
// tslint:disable-next-line:max-line-length
......
......@@ -12,19 +12,19 @@ export class TodoListApp extends App {
super(info, logger);
}
public initialize(configurationExtend: IConfigurationExtend): void {
this.extendConfiguration(configurationExtend);
public initialize(configurationExtend: IConfigurationExtend): Promise<void> {
return this.extendConfiguration(configurationExtend);
}
public onEnable(environment: IEnvironmentRead, configurationModify: IConfigurationModify): boolean {
return true;
public onEnable(environment: IEnvironmentRead, configurationModify: IConfigurationModify): Promise<boolean> {
return Promise.resolve(true);
}
public onDisable(configurationModify: IConfigurationModify): void {
return;
public onDisable(configurationModify: IConfigurationModify): Promise<void> {
return Promise.resolve();
}
protected extendConfiguration(configuration: IConfigurationExtend): void {
return;
protected extendConfiguration(configuration: IConfigurationExtend): Promise<void> {
return Promise.resolve();
}
}
......@@ -3,7 +3,7 @@
"name": "To Do Lists",
"nameSlug": "to-do-lists",
"version": "0.0.1",
"requiredApiVersion": ">=0.9.6",
"requiredApiVersion": ">=0.9.13",
"description": "App which provides to do lists per channels, including associated commands.",
"author": {
"name": "Bradley Hilton <bradley.hilton@rocket.chat>",
......
......@@ -32,12 +32,12 @@
"resolved": "https://registry.npmjs.org/@rocket.chat/apps-engine/-/apps-engine-0.5.11.tgz",
"integrity": "sha512-9NGTnWrnVlRyMyRxYvjiAKjr0K+Of7m7ij2zMRDx6MSH2fvLbjJyiVnkk2k3kagykTdVA1ir80kKSQz7J9FXDQ==",
"requires": {
"@rocket.chat/apps-ts-definition": "0.9.6",
"@rocket.chat/apps-ts-definition": "0.9.13",
"adm-zip": "0.4.8",
"lodash.clonedeep": "4.5.0",
"semver": "5.5.0",
"stack-trace": "0.0.10",
"typescript": "2.8.1",
"typescript": "2.8.3",
"uuid": "3.2.1"
},
"dependencies": {
......@@ -47,9 +47,9 @@
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA=="
},
"typescript": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.1.tgz",
"integrity": "sha512-Ao/f6d/4EPLq0YwzsQz8iXflezpTkQzqAyenTiw4kCUGr1uPiFLC3+fZ+gMZz6eeI/qdRUqvC+HxIJzUAzEFdg=="
"version": "2.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.8.3.tgz",
"integrity": "sha512-K7g15Bb6Ra4lKf7Iq2l/I5/En+hLIHmxWZGq3D4DIRNFxMNV6j2SHSvDOqs2tGd4UvD/fJvrwopzQXjLrT7Itw=="
},
"uuid": {
"version": "3.2.1",
......@@ -59,9 +59,9 @@
}
},
"@rocket.chat/apps-ts-definition": {
"version": "0.9.6",
"resolved": "https://registry.npmjs.org/@rocket.chat/apps-ts-definition/-/apps-ts-definition-0.9.6.tgz",
"integrity": "sha512-WY6OrZSvBnyAfsgIYk8ab4wgSWRd4x+wLYEUjm07hVG5EjE2SMB7HNybFWKKQPQ4CpV0oHt1dAObtSbEXwSQTA=="
"version": "0.9.13",
"resolved": "https://registry.npmjs.org/@rocket.chat/apps-ts-definition/-/apps-ts-definition-0.9.13.tgz",
"integrity": "sha512-2fqbJG8TPq19o2uZCE3UqRpNobAfAcgu0WkM8PAmhf1de459Z2gbmzbCBAsQJq6eOrGkqDry0GTzEneiCEvwZg=="
},
"@types/adm-zip": {
"version": "0.4.31",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment