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 team.* APIs for rtm.start migration #1365

Merged
merged 1 commit into from Oct 29, 2021
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
12 changes: 12 additions & 0 deletions packages/web-api/src/methods.ts
Expand Up @@ -170,8 +170,10 @@ import {
StarsRemoveResponse,
TeamAccessLogsResponse,
TeamBillableInfoResponse,
TeamBillingInfoResponse,
TeamInfoResponse,
TeamIntegrationLogsResponse,
TeamPreferencesListResponse,
TeamProfileGetResponse,
UsergroupsCreateResponse,
UsergroupsDisableResponse,
Expand Down Expand Up @@ -645,9 +647,15 @@ export abstract class Methods extends EventEmitter<WebClientEvent> {
public readonly team = {
accessLogs: bindApiCall<TeamAccessLogsArguments, TeamAccessLogsResponse>(this, 'team.accessLogs'),
billableInfo: bindApiCall<TeamBillableInfoArguments, TeamBillableInfoResponse>(this, 'team.billableInfo'),
billing: {
info: bindApiCall<TeamBillingInfoArguments, TeamBillingInfoResponse>(this, 'team.billing.info'),
},
info: bindApiCall<TeamInfoArguments, TeamInfoResponse>(this, 'team.info'),
integrationLogs:
bindApiCall<TeamIntegrationLogsArguments, TeamIntegrationLogsResponse>(this, 'team.integrationLogs'),
preferences: {
list: bindApiCall<TeamPreferencesListArguments, TeamPreferencesListResponse>(this, 'team.preferences.list'),
},
profile: {
get: bindApiCall<TeamProfileGetArguments, TeamProfileGetResponse>(this, 'team.profile.get'),
},
Expand Down Expand Up @@ -1906,6 +1914,8 @@ export interface TeamBillableInfoArguments extends WebAPICallOptions, TokenOverr
user?: string;
team_id?: string;
}
export interface TeamBillingInfoArguments extends WebAPICallOptions, TokenOverridable {
}
export interface TeamInfoArguments extends WebAPICallOptions, TokenOverridable {
// Team to get info on, if omitted, will return information about the current team.
// Will only return team that the authenticated token is allowed to see through external shared channels
Expand All @@ -1924,6 +1934,8 @@ export interface TeamProfileGetArguments extends WebAPICallOptions, TokenOverrid
visibility?: 'all' | 'visible' | 'hidden';
team_id?: string;
}
export interface TeamPreferencesListArguments extends WebAPICallOptions, TokenOverridable {
}

/*
* `usergroups.*`
Expand Down
13 changes: 9 additions & 4 deletions packages/web-api/src/response/AppsUninstallResponse.ts
Expand Up @@ -10,8 +10,13 @@

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

export interface ResponseMetadata {
messages?: string[];
}
18 changes: 18 additions & 0 deletions packages/web-api/src/response/TeamBillingInfoResponse.ts
@@ -0,0 +1,18 @@
/* 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 TeamBillingInfoResponse = WebAPICallResult & {
ok?: boolean;
error?: string;
needed?: string;
provided?: string;
plan?: string;
};
22 changes: 22 additions & 0 deletions packages/web-api/src/response/TeamPreferencesListResponse.ts
@@ -0,0 +1,22 @@
/* 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 TeamPreferencesListResponse = WebAPICallResult & {
ok?: boolean;
msg_edit_window_mins?: number;
allow_message_deletion?: boolean;
display_real_names?: boolean;
disable_file_uploads?: string;
who_can_post_general?: string;
error?: string;
needed?: string;
provided?: string;
};
2 changes: 2 additions & 0 deletions packages/web-api/src/response/index.ts
Expand Up @@ -222,8 +222,10 @@ export { StarsListResponse } from './StarsListResponse';
export { StarsRemoveResponse } from './StarsRemoveResponse';
export { TeamAccessLogsResponse } from './TeamAccessLogsResponse';
export { TeamBillableInfoResponse } from './TeamBillableInfoResponse';
export { TeamBillingInfoResponse } from './TeamBillingInfoResponse';
export { TeamInfoResponse } from './TeamInfoResponse';
export { TeamIntegrationLogsResponse } from './TeamIntegrationLogsResponse';
export { TeamPreferencesListResponse } from './TeamPreferencesListResponse';
export { TeamProfileGetResponse } from './TeamProfileGetResponse';
export { UsergroupsCreateResponse } from './UsergroupsCreateResponse';
export { UsergroupsDisableResponse } from './UsergroupsDisableResponse';
Expand Down
14 changes: 14 additions & 0 deletions prod-server-integration-tests/test/web-api.js
Expand Up @@ -122,4 +122,18 @@ describe('Web APIs', function () {
});
});
});

describe('team.* for rtm.start migration', function () {

it('should work with a bot token (team.billing.info)', async function () {
const response = await botClient.team.billing.info();
logger.info(response);
assert.isUndefined(response.error);
});
it('should work with a bot token (team.preferences.list)', async function () {
const response = await botClient.team.preferences.list();
logger.info(response);
assert.isUndefined(response.error);
});
});
});