Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for apps.manifest.* endpoints #1690

Merged
merged 4 commits into from Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 49 additions & 0 deletions packages/web-api/src/methods.ts
Expand Up @@ -84,6 +84,11 @@ import {
ApiTestResponse,
AppsConnectionsOpenResponse,
AppsEventAuthorizationsListResponse,
AppsManifestCreateResponse,
AppsManifestDeleteResponse,
AppsManifestExportResponse,
AppsManifestUpdateResponse,
AppsManifestValidateResponse,
AppsUninstallResponse,
AuthRevokeResponse,
AuthTeamsListResponse,
Expand Down Expand Up @@ -183,6 +188,7 @@ import {
TeamIntegrationLogsResponse,
TeamPreferencesListResponse,
TeamProfileGetResponse,
ToolingTokensRotateResponse,
UsergroupsCreateResponse,
UsergroupsDisableResponse,
UsergroupsEnableResponse,
Expand Down Expand Up @@ -577,6 +583,13 @@ export abstract class Methods extends EventEmitter<WebClientEvent> {
),
},
},
manifest: {
create: bindApiCall<AppsManifestCreateArguments, AppsManifestCreateResponse>(this, 'apps.manifest.create'),
delete: bindApiCall<AppsManifestDeleteArguments, AppsManifestDeleteResponse>(this, 'apps.manifest.delete'),
export: bindApiCall<AppsManifestExportArguments, AppsManifestExportResponse>(this, 'apps.manifest.export'),
update: bindApiCall<AppsManifestUpdateArguments, AppsManifestUpdateResponse>(this, 'apps.manifest.update'),
validate: bindApiCall<AppsManifestValidateArguments, AppsManifestValidateResponse>(this, 'apps.manifest.validate'),
},
uninstall: bindApiCall<AppsUninstallArguments, AppsUninstallResponse>(this, 'apps.uninstall'),
};

Expand Down Expand Up @@ -813,6 +826,12 @@ export abstract class Methods extends EventEmitter<WebClientEvent> {
},
};

public readonly tooling = {
tokens: {
rotate: bindApiCall<ToolingTokensRotateArguments, ToolingTokensRotateResponse>(this, 'tooling.tokens.rotate'),
},
};

public readonly usergroups = {
create: bindApiCall<UsergroupsCreateArguments, UsergroupsCreateResponse>(this, 'usergroups.create'),
disable: bindApiCall<UsergroupsDisableArguments, UsergroupsDisableResponse>(this, 'usergroups.disable'),
Expand Down Expand Up @@ -1456,6 +1475,29 @@ export interface AppsEventAuthorizationsListArguments
event_context: string;
}
cursorPaginationEnabledMethods.add('apps.event.authorizations.list');

export interface AppsManifestCreateArguments extends WebAPICallOptions, TokenOverridable {
manifest: string;
}

export interface AppsManifestDeleteArguments extends WebAPICallOptions, TokenOverridable {
app_id: string;
}

export interface AppsManifestExportArguments extends WebAPICallOptions, TokenOverridable {
app_id: string;
}

export interface AppsManifestUpdateArguments extends WebAPICallOptions, TokenOverridable {
app_id: string;
manifest: string;
}

export interface AppsManifestValidateArguments extends WebAPICallOptions, TokenOverridable {
app_id?: string;
manifest: string;
misscoded marked this conversation as resolved.
Show resolved Hide resolved
}

export interface AppsUninstallArguments extends WebAPICallOptions {
client_id: string;
client_secret: string;
Expand Down Expand Up @@ -2357,6 +2399,13 @@ export interface TeamProfileGetArguments extends WebAPICallOptions, TokenOverrid
export interface TeamPreferencesListArguments extends WebAPICallOptions, TokenOverridable {
}

/*
* `tooling.*`
*/
export interface ToolingTokensRotateArguments extends WebAPICallOptions, TokenOverridable {
refresh_token: string;
}

/*
* `usergroups.*`
*/
Expand Down
39 changes: 39 additions & 0 deletions packages/web-api/src/response/AppsManifestCreateResponse.ts
@@ -0,0 +1,39 @@
/* eslint-disable */
/////////////////////////////////////////////////////////////////////////////////////////
// //
// !!! DO NOT EDIT THIS FILE !!! //
// //
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. //
// Please refer to the script code to learn how to update the source data. //
// //
/////////////////////////////////////////////////////////////////////////////////////////

import { WebAPICallResult } from '../WebClient';
export type AppsManifestCreateResponse = WebAPICallResult & {
app_id?: string;
credentials?: Credentials;
error?: string;
errors?: Error[];
needed?: string;
oauth_authorize_url?: string;
ok?: boolean;
provided?: string;
response_metadata?: ResponseMetadata;
};

export interface Credentials {
client_id?: string;
client_secret?: string;
signing_secret?: string;
verification_token?: string;
}

export interface Error {
code?: string;
message?: string;
pointer?: string;
}

export interface ResponseMetadata {
messages?: string[];
}
17 changes: 17 additions & 0 deletions packages/web-api/src/response/AppsManifestDeleteResponse.ts
@@ -0,0 +1,17 @@
/* eslint-disable */
/////////////////////////////////////////////////////////////////////////////////////////
// //
// !!! DO NOT EDIT THIS FILE !!! //
// //
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. //
// Please refer to the script code to learn how to update the source data. //
// //
/////////////////////////////////////////////////////////////////////////////////////////

import { WebAPICallResult } from '../WebClient';
export type AppsManifestDeleteResponse = WebAPICallResult & {
error?: string;
needed?: string;
ok?: boolean;
provided?: string;
};
106 changes: 106 additions & 0 deletions packages/web-api/src/response/AppsManifestExportResponse.ts
@@ -0,0 +1,106 @@
/* eslint-disable */
/////////////////////////////////////////////////////////////////////////////////////////
// //
// !!! DO NOT EDIT THIS FILE !!! //
// //
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. //
// Please refer to the script code to learn how to update the source data. //
// //
/////////////////////////////////////////////////////////////////////////////////////////

import { WebAPICallResult } from '../WebClient';
export type AppsManifestExportResponse = WebAPICallResult & {
error?: string;
manifest?: Manifest;
needed?: string;
ok?: boolean;
provided?: string;
};

export interface Manifest {
_metadata?: Metadata;
display_information?: DisplayInformation;
features?: Features;
oauth_config?: OauthConfig;
settings?: Settings;
}

export interface Metadata {
major_version?: string;
minor_version?: string;
}

export interface DisplayInformation {
background_color?: string;
description?: string;
long_description?: string;
name?: string;
}

export interface Features {
app_home?: AppHome;
bot_user?: BotUser;
shortcuts?: Shortcut[];
slash_commands?: SlashCommand[];
unfurl_domains?: string[];
}

export interface AppHome {
home_tab_enabled?: boolean;
messages_tab_enabled?: boolean;
messages_tab_read_only_enabled?: boolean;
}

export interface BotUser {
always_online?: boolean;
display_name?: string;
}

export interface Shortcut {
callback_id?: string;
description?: string;
name?: string;
type?: string;
}

export interface SlashCommand {
command?: string;
description?: string;
should_escape?: boolean;
url?: string;
usage_hint?: string;
}

export interface OauthConfig {
redirect_urls?: string[];
scopes?: Scopes;
}

export interface Scopes {
bot?: string[];
user?: string[];
}

export interface Settings {
allowed_ip_address_ranges?: string[];
background_color?: string;
description?: string;
event_subscriptions?: EventSubscriptions;
interactivity?: Interactivity;
long_description?: string;
org_deploy_enabled?: boolean;
socket_mode_enabled?: boolean;
token_rotation_enabled?: boolean;
}

export interface EventSubscriptions {
bot_events?: string[];
request_url?: string;
user_events?: string[];
}

export interface Interactivity {
is_enabled?: boolean;
message_menu_options_url?: string;
request_url?: string;
}
19 changes: 19 additions & 0 deletions packages/web-api/src/response/AppsManifestUpdateResponse.ts
@@ -0,0 +1,19 @@
/* eslint-disable */
/////////////////////////////////////////////////////////////////////////////////////////
// //
// !!! DO NOT EDIT THIS FILE !!! //
// //
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. //
// Please refer to the script code to learn how to update the source data. //
// //
/////////////////////////////////////////////////////////////////////////////////////////

import { WebAPICallResult } from '../WebClient';
export type AppsManifestUpdateResponse = WebAPICallResult & {
app_id?: string;
error?: string;
needed?: string;
ok?: boolean;
permissions_updated?: boolean;
provided?: string;
};
29 changes: 29 additions & 0 deletions packages/web-api/src/response/AppsManifestValidateResponse.ts
@@ -0,0 +1,29 @@
/* eslint-disable */
/////////////////////////////////////////////////////////////////////////////////////////
// //
// !!! DO NOT EDIT THIS FILE !!! //
// //
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. //
// Please refer to the script code to learn how to update the source data. //
// //
/////////////////////////////////////////////////////////////////////////////////////////

import { WebAPICallResult } from '../WebClient';
export type AppsManifestValidateResponse = WebAPICallResult & {
error?: string;
errors?: Error[];
needed?: string;
ok?: boolean;
provided?: string;
response_metadata?: ResponseMetadata;
};

export interface Error {
code?: string;
message?: string;
pointer?: string;
}

export interface ResponseMetadata {
messages?: string[];
}
28 changes: 28 additions & 0 deletions packages/web-api/src/response/ToolingTokensRotateResponse.ts
@@ -0,0 +1,28 @@
/* eslint-disable */
/////////////////////////////////////////////////////////////////////////////////////////
// //
// !!! DO NOT EDIT THIS FILE !!! //
// //
// This file is auto-generated by scripts/generate-web-api-types.sh in the repository. //
// Please refer to the script code to learn how to update the source data. //
// //
/////////////////////////////////////////////////////////////////////////////////////////

import { WebAPICallResult } from '../WebClient';
export type ToolingTokensRotateResponse = WebAPICallResult & {
error?: string;
exp?: number;
iat?: number;
needed?: string;
ok?: boolean;
provided?: string;
refresh_token?: string;
response_metadata?: ResponseMetadata;
team_id?: string;
token?: string;
user_id?: string;
};

export interface ResponseMetadata {
messages?: string[];
}
6 changes: 6 additions & 0 deletions packages/web-api/src/response/index.ts
Expand Up @@ -99,6 +99,11 @@ export { AdminWorkflowsUnpublishResponse } from './AdminWorkflowsUnpublishRespon
export { ApiTestResponse } from './ApiTestResponse';
export { AppsConnectionsOpenResponse } from './AppsConnectionsOpenResponse';
export { AppsEventAuthorizationsListResponse } from './AppsEventAuthorizationsListResponse';
export { AppsManifestCreateResponse } from './AppsManifestCreateResponse';
export { AppsManifestDeleteResponse } from './AppsManifestDeleteResponse';
export { AppsManifestExportResponse } from './AppsManifestExportResponse';
export { AppsManifestUpdateResponse } from './AppsManifestUpdateResponse';
export { AppsManifestValidateResponse } from './AppsManifestValidateResponse';
export { AppsPermissionsInfoResponse } from './AppsPermissionsInfoResponse';
export { AppsPermissionsRequestResponse } from './AppsPermissionsRequestResponse';
export { AppsPermissionsResourcesListResponse } from './AppsPermissionsResourcesListResponse';
Expand Down Expand Up @@ -255,6 +260,7 @@ export { TeamInfoResponse } from './TeamInfoResponse';
export { TeamIntegrationLogsResponse } from './TeamIntegrationLogsResponse';
export { TeamPreferencesListResponse } from './TeamPreferencesListResponse';
export { TeamProfileGetResponse } from './TeamProfileGetResponse';
export { ToolingTokensRotateResponse } from './ToolingTokensRotateResponse';
export { UsergroupsCreateResponse } from './UsergroupsCreateResponse';
export { UsergroupsDisableResponse } from './UsergroupsDisableResponse';
export { UsergroupsEnableResponse } from './UsergroupsEnableResponse';
Expand Down