Skip to content
Draft
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`) to the app manifest types
15 changes: 15 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 opt the app into the standardized user connection flow, where users
* connect the app to an account on an external provider.
*/
user_connections?: ManifestUserConnections;
}

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

interface ManifestUserConnections {
/** @description Whether the user connection flow is enabled for the app. */
is_enabled: boolean;
/**
* @description An array of hosts, without a scheme, that the provider's `auth_url` and `disconnect_url` may use.
* Subdomains of a listed host are also allowed. Between 1 and 25 hosts can be included in this array.
*/
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
53 changes: 53 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,33 @@ 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'],
},
},
},
},
]);
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