Skip to content

Commit

Permalink
merging in latest main
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Maj committed Nov 15, 2023
2 parents e9ac27a + 1312f62 commit 7065af8
Show file tree
Hide file tree
Showing 12 changed files with 394 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slack/types",
"version": "2.9.0",
"version": "2.10.0",
"description": "Shared type definitions for the Node Slack SDK",
"author": "Slack Technologies, LLC",
"license": "MIT",
Expand Down
23 changes: 23 additions & 0 deletions packages/types/src/block-kit/block-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,29 @@ export interface EmailInput extends Actionable, Dispatchable, Focusable, Placeho
initial_value?: string;
}

/**
* @description Allows user to upload files. In order to use the `file_input` element within your app,
* your app must have the `files:read` scope.
* @see {@link https://api.slack.com/reference/block-kit/block-elements#file_input File input element reference}.
*/
export interface FileInput extends Actionable {
/**
* @description The type of element. In this case `type` is always `file_input`.
*/
type: 'file_input';
/**
* @description An array of valid {@link https://api.slack.com/types/file#types file extensions} that will be accepted
* for this element. All file extensions will be accepted if `filetypes` is not specified. This validation is provided
* for convenience only, and you should perform your own file type validation based on what you expect to receive.
*/
filetypes?: string[];
/**
* @description Maximum number of files that can be uploaded for this `file_input` element. Minimum of `1`, maximum of
* `10`. Defaults to `10` if not specified.
*/
max_files?: number;
}

/**
* @description Displays an image as part of a larger block of content. Use this `image` block if you want a block with
* only an image in it.
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/block-kit/blocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { PlainTextElement, MrkdwnElement } from './composition-objects';
import { Actionable } from './extensions';
import { Button, Checkboxes, Datepicker, DateTimepicker, EmailInput, ImageElement, MultiSelect, NumberInput, Overflow, PlainTextInput, RadioButtons, Select, Timepicker, URLInput, WorkflowButton, RichTextSection, RichTextList, RichTextQuote, RichTextPreformatted, RichTextInput } from './block-elements';
import { Button, Checkboxes, Datepicker, DateTimepicker, EmailInput, FileInput, ImageElement, MultiSelect, NumberInput, Overflow, PlainTextInput, RadioButtons, Select, Timepicker, URLInput, WorkflowButton, RichTextSection, RichTextList, RichTextQuote, RichTextPreformatted, RichTextInput } from './block-elements';

export interface Block {
type: string;
Expand Down Expand Up @@ -159,7 +159,7 @@ export interface InputBlock extends Block {
* @description A block element.
*/
element: Select | MultiSelect | Datepicker | Timepicker | DateTimepicker | PlainTextInput | URLInput | EmailInput
| NumberInput | RadioButtons | Checkboxes | RichTextInput;
| NumberInput | RadioButtons | Checkboxes | RichTextInput | FileInput;
/**
* @description A boolean that indicates whether or not the use of elements in this block should dispatch a
* {@link https://api.slack.com/reference/interaction-payloads/block-actions block_actions payload}. Defaults to `false`.
Expand Down
48 changes: 48 additions & 0 deletions packages/web-api/src/methods.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ import type {
ApiTestResponse,
AppsConnectionsOpenResponse,
AppsEventAuthorizationsListResponse,
AppsManifestCreateResponse,
AppsManifestDeleteResponse,
AppsManifestExportResponse,
AppsManifestUpdateResponse,
AppsManifestValidateResponse,
AppsUninstallResponse,
AuthRevokeResponse,
AuthTeamsListResponse,
Expand Down Expand Up @@ -183,6 +188,7 @@ import type {
TeamIntegrationLogsResponse,
TeamPreferencesListResponse,
TeamProfileGetResponse,
ToolingTokensRotateResponse,
UsergroupsCreateResponse,
UsergroupsDisableResponse,
UsergroupsEnableResponse,
Expand Down Expand Up @@ -595,6 +601,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 @@ -1010,6 +1023,12 @@ export abstract class Methods extends EventEmitter<WebClientEvent> {
},
};

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

public readonly usergroups = {
/**
* @description Create a User Group.
Expand Down Expand Up @@ -1778,6 +1797,28 @@ export interface AppsEventAuthorizationsListArguments
extends TokenOverridable, CursorPaginationEnabled {
event_context: string;
}

export interface AppsManifestCreateArguments extends TokenOverridable {
manifest: string;
}

export interface AppsManifestDeleteArguments extends TokenOverridable {
app_id: string;
}

export interface AppsManifestExportArguments extends TokenOverridable {
app_id: string;
}

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

export interface AppsManifestValidateArguments extends TokenOverridable {
app_id?: string;
manifest: string;
}
// https://api.slack.com/methods/apps.uninstall
export interface AppsUninstallArguments {
client_id: string;
Expand Down Expand Up @@ -2209,4 +2250,11 @@ export interface EmojiListArguments extends TokenOverridable {
include_categories?: boolean;
}

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

export * from '@slack/types';
39 changes: 39 additions & 0 deletions packages/web-api/src/types/response/AppsManifestCreateResponse.ts
Original file line number Diff line number Diff line change
@@ -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/types/response/AppsManifestDeleteResponse.ts
Original file line number Diff line number Diff line change
@@ -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/types/response/AppsManifestExportResponse.ts
Original file line number Diff line number Diff line change
@@ -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/types/response/AppsManifestUpdateResponse.ts
Original file line number Diff line number Diff line change
@@ -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;
};
Original file line number Diff line number Diff line change
@@ -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/types/response/ToolingTokensRotateResponse.ts
Original file line number Diff line number Diff line change
@@ -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[];
}
Loading

0 comments on commit 7065af8

Please sign in to comment.