Skip to content

Commit

Permalink
[MM-33462] Extend manifest type (mattermost#7883)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kochell <[email protected]>
  • Loading branch information
hanzei and mickmister committed May 19, 2021
1 parent 2d01af3 commit 0ec7325
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
29 changes: 28 additions & 1 deletion packages/mattermost-redux/src/types/apps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,38 @@
// This file's contents belong to the Apps Framework feature.
// Apps Framework feature is experimental, and the contents of this file are
// susceptible to breaking changes without pushing the major version of this package.

export enum AppType {
HTTP = 'http',
AWSLambda = 'aws_lambda',
Builtin = 'builtin',
}

export enum Permission {
UserJoinedChannelNotification = 'user_joined_channel_notification',
ActAsBot = 'act_as_bot',
ActAsUser = 'act_as_user',
PermissionActAsAdmin = 'act_as_admin',
RemoteOAuth2 = 'remote_oauth2',
RemoteWebhooks = 'remote_webhooks',
}

export enum Locations {
PostMenu = '/post_menu',
ChannelHeader = '/channel_header',
Command = '/command',
InPost = '/in_post',
}

export type AppManifest = {
app_id: string;
app_type: AppType;
version?: string;
homepage_url?: string;
display_name: string;
description?: string;
homepage_url?: string;
requested_permissions?: Permission[];
requested_locations?: Locations[];
root_url?: string;
}

Expand Down
3 changes: 3 additions & 0 deletions selectors/views/marketplace.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.

import {AppType} from 'mattermost-redux/types/apps';
import {AuthorType, MarketplaceApp, MarketplacePlugin, ReleaseStage} from 'mattermost-redux/types/marketplace';

import {
Expand Down Expand Up @@ -56,6 +57,7 @@ describe('marketplace', () => {
enterprise: false,
manifest: {
app_id: 'some.id',
app_type: AppType.HTTP,
display_name: 'Some App',
root_url: 'https://example.org/install',
},
Expand All @@ -68,6 +70,7 @@ describe('marketplace', () => {
enterprise: false,
manifest: {
app_id: 'some.other.id',
app_type: AppType.HTTP,
display_name: 'Some other App',
root_url: 'https://example.org/install2',
},
Expand Down

0 comments on commit 0ec7325

Please sign in to comment.