Skip to content

Commit

Permalink
Document migration.* methods and split out their arguments into own f…
Browse files Browse the repository at this point in the history
…ile.
  • Loading branch information
Filip Maj committed Oct 31, 2023
1 parent 0e24e84 commit 352f985
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
14 changes: 5 additions & 9 deletions packages/web-api/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ import type { ReactionsAddArguments, ReactionsGetArguments, ReactionsListArgumen
import type { PinsAddArguments, PinsListArguments, PinsRemoveArguments } from './types/request/pins';
import type { OpenIDConnectTokenArguments, OpenIDConnectUserInfoArguments } from './types/request/openid';
import type { OAuthAccessArguments, OAuthV2AccessArguments, OAuthV2ExchangeArguments } from './types/request/oauth';
import type { MigrationExchangeArguments } from './types/request/migration';

/**
* Generic method definition
Expand Down Expand Up @@ -757,6 +758,10 @@ export abstract class Methods extends EventEmitter<WebClientEvent> {
};

public readonly migration = {
/**
* @description For Enterprise Grid workspaces, map local user IDs to global user IDs.
* @see {@link https://api.slack.com/methods/migration.exchange `migration.exchange` API reference}.
*/
exchange: bindApiCall<MigrationExchangeArguments, MigrationExchangeResponse>(this, 'migration.exchange'),
};

Expand Down Expand Up @@ -2284,13 +2289,4 @@ export interface FilesRemoteShareArguments extends TokenOverridable {
external_id?: string;
}

/*
* `migration.*`
*/
// https://api.slack.com/methods/migration.exchange
export interface MigrationExchangeArguments extends TokenOverridable, OptionalTeamAssignable {
users: string; // comma-separated list of users
to_old?: boolean;
}

export * from '@slack/types';
9 changes: 9 additions & 0 deletions packages/web-api/src/types/request/migration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type { OptionalTeamAssignable, TokenOverridable } from './common';

// https://api.slack.com/methods/migration.exchange
export interface MigrationExchangeArguments extends TokenOverridable, OptionalTeamAssignable {
/** @description A comma-separated list of user IDs, up to 400 per request. */
users: string;
/** @description Specify `true` to convert `W` global user IDs to workspace-specific `U` IDs. Defaults to `false`. */
to_old?: boolean;
}

0 comments on commit 352f985

Please sign in to comment.