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
12 changes: 12 additions & 0 deletions .changeset/34730-s3b-slack-setup-entry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'@objectstack/service-messaging': patch
'@objectstack/platform-objects': patch
---

Clause-②: no
Metadata-protocol: none

feat(messaging): Setup lists the Slack page where connector-slack is composed

- **Setup › Integrations › Slack.** Where connector-slack is composed, Setup now lists a Slack entry under Integrations. It opens the console's Slack page (`messaging:slack`), where an organization administrator installs or replaces the organization's Slack token, removes the install, and reviews or removes each member's Slack link. The entry asks `setup.write`, the capability every Slack administrator door asks. `MessagingServicePlugin` registers it in the same `kernel:ready` hook, and on the same condition, as the `slack` channel. Without connector-slack, Setup lists no Slack entry. The label is translated in every locale the platform ships. The bundle is exported as `SLACK_SETUP_UI_BUNDLE`, with `SLACK_SETUP_COMPONENT_REF`.
- **The Slack link removal topic, on every deployment.** `GET /api/v1/messaging/preference-options` and `GET /api/v1/messaging/me/preferences` list the topic `messaging.slack_link_removed` on every deployment, including one without connector-slack. It is emitted only where connector-slack is composed, when an administrator removes a person's Slack link or removes the organization's Slack install.
11 changes: 11 additions & 0 deletions packages/cli/scripts/check-app-nav-i18n.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,17 @@ const CONTRIBUTORS = [
return { manifests: [CONNECTOR_CREDENTIALS_UI_BUNDLE] };
},
},
{
// `nav_slack` (Setup → Integrations). Registered by `MessagingServicePlugin`
// at `kernel:ready`, and only where connector-slack's `slack` service
// resolves, so the bundle is read directly — the row above's shape.
source: '@objectstack/service-messaging (SLACK_SETUP_UI_BUNDLE)',
apps: ['setup'],
async load() {
const { SLACK_SETUP_UI_BUNDLE } = await import('@objectstack/service-messaging');
return { manifests: [SLACK_SETUP_UI_BUNDLE] };
},
},
{
source: '@objectstack/cloud-connection (cloud + marketplace UI bundles)',
apps: ['setup'],
Expand Down
12 changes: 9 additions & 3 deletions packages/cli/test/setup-integrations-order.pin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// Datasources `@objectstack/service-datasource`
// Connector Credentials `@objectstack/service-automation`
// Connector Connections `@objectstack/service-automation` (same contribution)
// Slack `@objectstack/service-messaging` (with connector-slack composed)
// Cloud Connection `@objectstack/cloud-connection`
//
// Each contributor states the group's other priorities in its own header so
Expand All @@ -35,16 +36,18 @@
// Why it lives in `packages/cli/test/`
// ---------------------------------------------------------------------------
// The same reason as `connect-agent-both-halves-wire.pin.test.ts` beside it:
// this is a COMPOSED fact across five packages and the registry fold, and
// this is a COMPOSED fact across six packages and the registry fold, and
// `packages/cli` is the only workspace package that depends on all of them.
//
// Two of the five register their contribution from inside `init()` through
// Two of the six register their contribution from inside `init()` through
// the `manifest` service rather than exporting it, so they are booted here on
// a context that serves exactly that service — the shape
// `packages/cli/scripts/check-app-nav-i18n.mjs` boots the same two with.
// `@objectstack/service-automation` registers its bundle at `kernel:ready`,
// which this context never fires, so its exported bundle is read directly, as
// that gate does too.
// that gate does too. `@objectstack/service-messaging` registers its Slack
// bundle at `kernel:ready` too, and only with connector-slack composed; it is
// read the same way.

import { describe, expect, it } from 'vitest';
import { CLOUD_CONNECTION_UI_BUNDLE } from '@objectstack/cloud-connection';
Expand All @@ -54,6 +57,7 @@ import { SETUP_APP, SETUP_NAV_CONTRIBUTIONS } from '@objectstack/platform-object
import { WebhookOutboxPlugin } from '@objectstack/plugin-webhooks';
import { CONNECTOR_CREDENTIALS_UI_BUNDLE } from '@objectstack/service-automation';
import { DatasourceAdminServicePlugin } from '@objectstack/service-datasource';
import { SLACK_SETUP_UI_BUNDLE } from '@objectstack/service-messaging';

type AnyRec = Record<string, any>;

Expand All @@ -67,6 +71,7 @@ const EXPECTED_TIERS: readonly (readonly string[])[] = [
['nav_webhooks', 'nav_http_deliveries', 'nav_datasources'],
// One contribution carries both, in this order (ADR-0143 D5 added the second).
['nav_connector_credentials', 'nav_connector_connections'],
['nav_slack'],
['nav_cloud_connection'],
];

Expand Down Expand Up @@ -105,6 +110,7 @@ async function setupContributions(): Promise<Array<{ packageId: string; contribu
// reds if it moves back.
['@objectstack/mcp', [CONNECT_AGENT_UI_BUNDLE as AnyRec]],
['@objectstack/service-automation', [CONNECTOR_CREDENTIALS_UI_BUNDLE as AnyRec]],
['@objectstack/service-messaging', [SLACK_SETUP_UI_BUNDLE as AnyRec]],
['@objectstack/cloud-connection', [CLOUD_CONNECTION_UI_BUNDLE as AnyRec]],
];
const out: Array<{ packageId: string; contribution: AnyRec }> = SETUP_NAV_CONTRIBUTIONS.map((contribution) => ({
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,14 @@ export default defineConfig({
find: /^@objectstack\/service-push$/,
replacement: path.resolve(__dirname, '../services/service-push/src/index.ts'),
},
// `setup-integrations-order.pin.test.ts` reads `SLACK_SETUP_UI_BUNDLE`,
// the Setup › Integrations › Slack contribution. Resolved to source for
// the reason its neighbours give. `check:test-source-alias` names this
// import and fails without it.
{
find: /^@objectstack\/service-messaging$/,
replacement: path.resolve(__dirname, '../services/service-messaging/src/index.ts'),
},
],
},
test: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const arSourceHashes: Readonly<Record<string, string>> = {
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
'apps.studio.label': '5aaaaea2294ee893',
'apps.studio.description': 'c026a5795933995d',
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/ar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const ar: TranslationData = {
nav_datasources: { label: 'مصادر البيانات' },
nav_connector_credentials: { label: 'بيانات اعتماد الموصلات' },
nav_connector_connections: { label: 'اتصالات الموصلات' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'تطبيقات OAuth' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const deSourceHashes: Readonly<Record<string, string>> = {
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
'apps.studio.label': '5aaaaea2294ee893',
'apps.studio.description': 'c026a5795933995d',
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const de: TranslationData = {
nav_datasources: { label: 'Datenquellen' },
nav_connector_credentials: { label: 'Konnektor-Anmeldedaten' },
nav_connector_connections: { label: 'Konnektor-Verbindungen' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'OAuth-Anwendungen' },
},
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export const en: TranslationData = {
nav_datasources: { label: 'Datasources' },
nav_connector_credentials: { label: 'Connector Credentials' },
nav_connector_connections: { label: 'Connector Connections' },
nav_slack: { label: 'Slack' },

// Advanced
//
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/es-ES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const esES: TranslationData = {
nav_datasources: { label: 'Fuentes de datos' },
nav_connector_credentials: { label: 'Credenciales de conectores' },
nav_connector_connections: { label: 'Conexiones de conectores' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'Aplicaciones OAuth' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const frSourceHashes: Readonly<Record<string, string>> = {
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
'apps.studio.label': '5aaaaea2294ee893',
'apps.studio.description': 'c026a5795933995d',
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const fr: TranslationData = {
nav_datasources: { label: 'Sources de données' },
nav_connector_credentials: { label: 'Identifiants des connecteurs' },
nav_connector_connections: { label: 'Connexions des connecteurs' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'Applications OAuth' },
},
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/ja-JP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export const jaJP: TranslationData = {
nav_datasources: { label: 'データソース' },
nav_connector_credentials: { label: 'コネクタ認証情報' },
nav_connector_connections: { label: 'コネクタ接続' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'OAuth アプリケーション' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const koSourceHashes: Readonly<Record<string, string>> = {
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
'apps.studio.label': '5aaaaea2294ee893',
'apps.studio.description': 'c026a5795933995d',
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/ko.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export const ko: TranslationData = {
nav_datasources: { label: '데이터 소스' },
nav_connector_credentials: { label: '커넥터 자격 증명' },
nav_connector_connections: { label: '커넥터 연결' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'OAuth 애플리케이션' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const ptBRSourceHashes: Readonly<Record<string, string>> = {
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
'apps.studio.label': '5aaaaea2294ee893',
'apps.studio.description': 'c026a5795933995d',
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const ptBR: TranslationData = {
nav_datasources: { label: 'Fontes de dados' },
nav_connector_credentials: { label: 'Credenciais dos conectores' },
nav_connector_connections: { label: 'Conexões dos conectores' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'Aplicativos OAuth' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export const ruSourceHashes: Readonly<Record<string, string>> = {
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
'apps.studio.label': '5aaaaea2294ee893',
'apps.studio.description': 'c026a5795933995d',
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ export const ru: TranslationData = {
nav_datasources: { label: 'Источники данных' },
nav_connector_credentials: { label: 'Учётные данные коннекторов' },
nav_connector_connections: { label: 'Подключения коннекторов' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'Приложения OAuth' },
},
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export const zhCN: TranslationData = {
nav_datasources: { label: '数据源' },
nav_connector_credentials: { label: '连接器凭据' },
nav_connector_connections: { label: '连接器连接' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'OAuth 应用' },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export const zhHantSourceHashes: Readonly<Record<string, string>> = {
'apps.setup.navigation.nav_datasources.label': '2f0648ce23158e6f',
'apps.setup.navigation.nav_connector_credentials.label': '0504775224e05a81',
'apps.setup.navigation.nav_connector_connections.label': '949e9a8fd25c3d57',
'apps.setup.navigation.nav_slack.label': 'c3c9e181e8c74b22',
'apps.setup.navigation.nav_oauth_apps.label': '1b26cce61a4c10eb',
'apps.studio.label': '5aaaaea2294ee893',
'apps.studio.description': 'c026a5795933995d',
Expand Down
1 change: 1 addition & 0 deletions packages/platform-objects/src/apps/translations/zh-Hant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export const zhHant: TranslationData = {
nav_datasources: { label: '資料來源' },
nav_connector_credentials: { label: '連接器憑證' },
nav_connector_connections: { label: '連接器連線' },
nav_slack: { label: 'Slack' },

nav_oauth_apps: { label: 'OAuth 應用程式' },
},
Expand Down
1 change: 1 addition & 0 deletions packages/services/service-messaging/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export {
SLACK_ADMIN_CAPABILITY,
} from './slack-link-routes.js';
export type { SlackLinkRoutesDeps } from './slack-link-routes.js';
export { SLACK_SETUP_UI_BUNDLE, SLACK_SETUP_COMPONENT_REF } from './slack-setup-ui.js';

// [#24978] Keyed notification text — `EmitInput.keyedText`, rendered per
// recipient at delivery from the `i18n` service's catalog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
type SlackTriggerEngine,
} from './slack-links.js';
import { SLACK_ACCOUNT_ROUTE, SLACK_LINK_ROUTE, registerSlackLinkRoutes } from './slack-link-routes.js';
import { SLACK_SETUP_UI_BUNDLE } from './slack-setup-ui.js';
import {
NotificationTemplateStore,
TEMPLATE_BUILTINS,
Expand Down Expand Up @@ -641,7 +642,9 @@ export class MessagingServicePlugin implements Plugin {
// preference doors (`getKnownChannels`) answer as they do with no
// Slack in the composition. It sends a DM to a recipient's
// confirmed link with their organization's own install token
// (sys_channel_account).
// (sys_channel_account). [#34730 step 3] Setup's Slack entry
// (`slack-setup-ui.ts`) is registered on the same condition, so a
// composition without connector-slack lists no Slack page.
ctx.hook('kernel:ready', async () => {
if (!getSlack()) return;
service.registerChannelProvider('slack', lazyChannelMount({
Expand All @@ -650,6 +653,11 @@ export class MessagingServicePlugin implements Plugin {
announce: '[messaging] slack channel registered (a DM to the recipient\'s confirmed sys_channel_user_link, with their organization\'s sys_channel_account token)',
logger: ctx.logger,
}));
try {
ctx.getService<{ register(m: unknown): void }>('manifest').register(SLACK_SETUP_UI_BUNDLE);
} catch {
/* no manifest service: no console to carry the entry */
}
});
}

Expand Down
Loading
Loading