Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/manifest-user-connections.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@slack/web-api": minor
---

feat: add the `user_connections` feature (`is_enabled`, `auth_hosts`) and the `user_connection` and `user_connection_status_requested` events to the app manifest types
18 changes: 18 additions & 0 deletions packages/web-api/src/types/request/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ interface ManifestFeatures {
* @see {@link https://docs.slack.dev/messaging/unfurling-links-in-messages Link unfurling: configuring domains}.
*/
unfurl_domains?: string[];
/**
* @description A subgroup of settings that describe {@link https://docs.slack.dev/authentication/standardized-auth standardized app authentication}
* configuration.
*/
user_connections?: ManifestUserConnections;
}

interface ManifestAgentView {
Expand Down Expand Up @@ -189,6 +194,17 @@ interface ManifestSlashCommand {
usage_hint?: string;
}

interface ManifestUserConnections {
/** @description A boolean that specifies whether or not standardized app authentication is enabled for the app. */
is_enabled: boolean;
/**
* @description An array of strings containing the hosts, without a scheme, that a provider's `auth_url` and
* `disconnect_url` may use. Subdomains of a listed host are also allowed. The hosts are kept while `is_enabled` is
* false, so turning standardized app authentication off only flips `is_enabled`.
*/
auth_hosts: string[];
}

interface ManifestOAuthConfig {
/**
* @description An array of strings containing {@link https://docs.slack.dev/authentication/installing-with-oauth OAuth redirect URLs}.
Expand Down Expand Up @@ -604,6 +620,8 @@ type ManifestEvent =
| 'tokens_revoked'
| 'url_verification'
| 'user_change'
| 'user_connection'
| 'user_connection_status_requested'
| 'user_huddle_changed'
| 'user_profile_changed'
| 'user_resource_denied'
Expand Down
59 changes: 59 additions & 0 deletions packages/web-api/test/types/methods/apps.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,32 @@ expectAssignable<Parameters<typeof web.apps.event.authorizations.list>>([
// -- sad path
expectError(web.apps.manifest.create()); // lacking argument
expectError(web.apps.manifest.create({})); // empty argument
expectError(
web.apps.manifest.create({
manifest: {
display_information: { name: 'Connector' },
features: {
user_connections: {
// missing is_enabled
auth_hosts: ['example.com'],
},
},
},
}),
);
expectError(
web.apps.manifest.create({
manifest: {
display_information: { name: 'Connector' },
features: {
user_connections: {
// missing auth_hosts
is_enabled: true,
},
},
},
}),
);
expectError(
web.apps.manifest.create({
manifest: {
Expand Down Expand Up @@ -75,6 +101,39 @@ expectAssignable<Parameters<typeof web.apps.manifest.create>>([
},
},
]);
// -- happy path: user_connections
expectAssignable<Parameters<typeof web.apps.manifest.create>>([
{
manifest: {
display_information: { name: 'Connector' },
features: {
user_connections: {
is_enabled: true,
auth_hosts: ['example.com', 'auth.example.com'],
},
},
settings: {
event_subscriptions: {
bot_events: ['user_connection', 'user_connection_status_requested'],
},
socket_mode_enabled: true,
},
},
},
]);
expectAssignable<Parameters<typeof web.apps.manifest.create>>([
{
manifest: {
display_information: { name: 'Connector' },
features: {
user_connections: {
is_enabled: false,
auth_hosts: ['example.com'],
},
},
},
},
]);

// apps.manifest.delete
// -- sad path
Expand Down
Loading