@shipfox/api-integration-slack 8.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +35 -0
- package/dist/core/agent-tools-provider.d.ts +9 -9
- package/dist/core/agent-tools-provider.d.ts.map +1 -1
- package/dist/core/agent-tools-provider.js.map +1 -1
- package/dist/core/agent-tools.d.ts +1 -1
- package/dist/core/agent-tools.d.ts.map +1 -1
- package/dist/core/agent-tools.js.map +1 -1
- package/dist/core/errors.d.ts +1 -1
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/errors.js +1 -1
- package/dist/core/errors.js.map +1 -1
- package/dist/core/install.d.ts +1 -1
- package/dist/core/install.d.ts.map +1 -1
- package/dist/core/install.js.map +1 -1
- package/dist/core/webhook-processor.d.ts +1 -1
- package/dist/core/webhook-processor.d.ts.map +1 -1
- package/dist/core/webhook-processor.js +1 -1
- package/dist/core/webhook-processor.js.map +1 -1
- package/dist/core/webhook.d.ts +1 -1
- package/dist/core/webhook.d.ts.map +1 -1
- package/dist/core/webhook.js.map +1 -1
- package/dist/presentation/dto/integrations.d.ts +15 -1
- package/dist/presentation/dto/integrations.d.ts.map +1 -1
- package/dist/presentation/dto/integrations.js +14 -1
- package/dist/presentation/dto/integrations.js.map +1 -1
- package/dist/presentation/e2eRoutes/create-connection.d.ts +1 -1
- package/dist/presentation/e2eRoutes/create-connection.d.ts.map +1 -1
- package/dist/presentation/e2eRoutes/create-connection.js.map +1 -1
- package/dist/presentation/routes/errors.js +1 -1
- package/dist/presentation/routes/errors.js.map +1 -1
- package/dist/presentation/routes/install.d.ts +1 -1
- package/dist/presentation/routes/install.d.ts.map +1 -1
- package/dist/presentation/routes/install.js.map +1 -1
- package/dist/presentation/routes/webhooks.d.ts +1 -1
- package/dist/presentation/routes/webhooks.d.ts.map +1 -1
- package/dist/presentation/routes/webhooks.js +1 -1
- package/dist/presentation/routes/webhooks.js.map +1 -1
- package/dist/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +14 -15
- package/src/core/agent-tools-provider.test.ts +1 -1
- package/src/core/agent-tools-provider.ts +1 -1
- package/src/core/agent-tools.ts +1 -1
- package/src/core/errors.ts +1 -1
- package/src/core/install.test.ts +1 -1
- package/src/core/install.ts +1 -1
- package/src/core/webhook-processor.test.ts +2 -2
- package/src/core/webhook-processor.ts +6 -6
- package/src/core/webhook.test.ts +1 -1
- package/src/core/webhook.ts +8 -8
- package/src/presentation/dto/integrations.ts +19 -1
- package/src/presentation/e2eRoutes/create-connection.ts +1 -1
- package/src/presentation/e2eRoutes/index.test.ts +1 -1
- package/src/presentation/routes/errors.ts +1 -1
- package/src/presentation/routes/install.test.ts +1 -1
- package/src/presentation/routes/install.ts +1 -1
- package/src/presentation/routes/webhooks.test.ts +2 -2
- package/src/presentation/routes/webhooks.ts +2 -5
- package/tsconfig.build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shipfox/api-integration-slack",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "9.0.1",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/ShipfoxHQ/shipfox.git",
|
|
@@ -11,10 +11,6 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"main": "dist/index.js",
|
|
13
13
|
"types": "dist/index.d.ts",
|
|
14
|
-
"imports": {
|
|
15
|
-
"#test/*": "./test/*",
|
|
16
|
-
"#*": "./dist/*"
|
|
17
|
-
},
|
|
18
14
|
"exports": {
|
|
19
15
|
".": {
|
|
20
16
|
"types": "./dist/index.d.ts",
|
|
@@ -25,16 +21,19 @@
|
|
|
25
21
|
"drizzle-orm": "^0.45.2",
|
|
26
22
|
"ky": "^2.0.0",
|
|
27
23
|
"zod": "^4.4.3",
|
|
28
|
-
"@shipfox/api-
|
|
29
|
-
"@shipfox/api-
|
|
30
|
-
"@shipfox/api-integration-slack-dto": "
|
|
31
|
-
"@shipfox/
|
|
32
|
-
"@shipfox/
|
|
33
|
-
"@shipfox/inter-module": "0.2.
|
|
34
|
-
"@shipfox/node-
|
|
35
|
-
"@shipfox/node-
|
|
36
|
-
"@shipfox/node-opentelemetry": "0.6.
|
|
37
|
-
"@shipfox/node-postgres": "0.4.
|
|
24
|
+
"@shipfox/api-integration-spi": "0.2.1",
|
|
25
|
+
"@shipfox/api-auth-context": "9.0.1",
|
|
26
|
+
"@shipfox/api-integration-slack-dto": "9.0.1",
|
|
27
|
+
"@shipfox/config": "1.2.3",
|
|
28
|
+
"@shipfox/api-workspaces-dto": "9.0.1",
|
|
29
|
+
"@shipfox/inter-module": "0.2.1",
|
|
30
|
+
"@shipfox/node-fastify": "0.3.1",
|
|
31
|
+
"@shipfox/node-drizzle": "0.3.3",
|
|
32
|
+
"@shipfox/node-opentelemetry": "0.6.1",
|
|
33
|
+
"@shipfox/node-postgres": "0.4.3"
|
|
34
|
+
},
|
|
35
|
+
"imports": {
|
|
36
|
+
"#*": "./dist/*"
|
|
38
37
|
},
|
|
39
38
|
"scripts": {
|
|
40
39
|
"build": "shipfox-swc",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-
|
|
1
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
2
2
|
import type {SlackWebApiResponse} from '#api/client.js';
|
|
3
3
|
import {slackAgentToolCatalog, slackAgentToolSelectionCatalog} from '#core/agent-tools.js';
|
|
4
4
|
import {SlackAgentToolsProvider} from '#core/agent-tools-provider.js';
|
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
AgentToolsProvider,
|
|
4
4
|
IntegrationConnection,
|
|
5
5
|
OpenAgentToolsSessionInput,
|
|
6
|
-
} from '@shipfox/api-integration-
|
|
6
|
+
} from '@shipfox/api-integration-spi';
|
|
7
7
|
import {logger} from '@shipfox/node-opentelemetry';
|
|
8
8
|
import type {SlackApiClient, SlackWebApiResponse} from '#api/client.js';
|
|
9
9
|
import {
|
package/src/core/agent-tools.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
AgentToolJsonSchema,
|
|
4
4
|
AgentToolSelectionCatalog,
|
|
5
5
|
AgentToolSelector,
|
|
6
|
-
} from '@shipfox/api-integration-
|
|
6
|
+
} from '@shipfox/api-integration-spi';
|
|
7
7
|
|
|
8
8
|
export type SlackAgentToolRequiredScope = 'read' | 'write';
|
|
9
9
|
export type SlackAgentToolCatalogEntry = AgentToolCatalogEntry<SlackAgentToolRequiredScope>;
|
package/src/core/errors.ts
CHANGED
package/src/core/install.test.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {UserContextMembership} from '@shipfox/api-auth-context';
|
|
2
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-
|
|
2
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
3
3
|
import type {SlackApiClient} from '#api/client.js';
|
|
4
4
|
import type {ConnectSlackInstallationInput} from './install.js';
|
|
5
5
|
import {handleSlackCallback} from './install.js';
|
package/src/core/install.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type {UserContextMembership} from '@shipfox/api-auth-context';
|
|
2
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-
|
|
2
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
3
3
|
import {logger} from '@shipfox/node-opentelemetry';
|
|
4
4
|
import type {SlackApiClient} from '#api/client.js';
|
|
5
5
|
import type {SlackTokenStore} from '#core/tokens.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {createHmac, randomUUID} from 'node:crypto';
|
|
2
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-
|
|
3
|
-
import {createStoredWebhookRequest} from '@shipfox/api-integration-
|
|
2
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
3
|
+
import {createStoredWebhookRequest} from '@shipfox/api-integration-spi';
|
|
4
4
|
import {db} from '#db/db.js';
|
|
5
5
|
import {upsertSlackInstallation} from '#db/installations.js';
|
|
6
6
|
import {slackInstallations} from '#db/schema/installations.js';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import {Buffer} from 'node:buffer';
|
|
2
|
+
import {
|
|
3
|
+
slackEventsRequestSchema,
|
|
4
|
+
slackSlashCommandSchema,
|
|
5
|
+
} from '@shipfox/api-integration-slack-dto';
|
|
2
6
|
import type {
|
|
3
7
|
ClaimWebhookDeliveryFn,
|
|
4
8
|
GetIntegrationConnectionByIdFn,
|
|
@@ -6,12 +10,8 @@ import type {
|
|
|
6
10
|
RecordDeliveryOnlyFn,
|
|
7
11
|
StoredWebhookRequest,
|
|
8
12
|
WebhookProcessingResult,
|
|
9
|
-
} from '@shipfox/api-integration-
|
|
10
|
-
import {decodeWebhookBody} from '@shipfox/api-integration-
|
|
11
|
-
import {
|
|
12
|
-
slackEventsRequestSchema,
|
|
13
|
-
slackSlashCommandSchema,
|
|
14
|
-
} from '@shipfox/api-integration-slack-dto';
|
|
13
|
+
} from '@shipfox/api-integration-spi';
|
|
14
|
+
import {decodeWebhookBody} from '@shipfox/api-integration-spi';
|
|
15
15
|
import {logger} from '@shipfox/node-opentelemetry';
|
|
16
16
|
import type {NodePgDatabase} from 'drizzle-orm/node-postgres';
|
|
17
17
|
import {config} from '#config.js';
|
package/src/core/webhook.test.ts
CHANGED
|
@@ -2,7 +2,7 @@ import {randomUUID} from 'node:crypto';
|
|
|
2
2
|
import type {
|
|
3
3
|
GetIntegrationConnectionByIdFn,
|
|
4
4
|
IntegrationConnection,
|
|
5
|
-
} from '@shipfox/api-integration-
|
|
5
|
+
} from '@shipfox/api-integration-spi';
|
|
6
6
|
import {db} from '#db/db.js';
|
|
7
7
|
import {getSlackInstallationByTeamId, upsertSlackInstallation} from '#db/installations.js';
|
|
8
8
|
import {slackInstallations} from '#db/schema/installations.js';
|
package/src/core/webhook.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
ClaimWebhookDeliveryFn,
|
|
3
|
-
GetIntegrationConnectionByIdFn,
|
|
4
|
-
IntegrationConnection,
|
|
5
|
-
IntegrationTx,
|
|
6
|
-
PublishIntegrationEventReceivedFn,
|
|
7
|
-
RecordDeliveryOnlyFn,
|
|
8
|
-
} from '@shipfox/api-integration-core-dto';
|
|
9
1
|
import {
|
|
10
2
|
SLACK_APP_UNINSTALLED_EVENT,
|
|
11
3
|
SLACK_PROVIDER,
|
|
@@ -17,6 +9,14 @@ import {
|
|
|
17
9
|
slackLifecycleEventTypes,
|
|
18
10
|
slackTokensRevokedEventSchema,
|
|
19
11
|
} from '@shipfox/api-integration-slack-dto';
|
|
12
|
+
import type {
|
|
13
|
+
ClaimWebhookDeliveryFn,
|
|
14
|
+
GetIntegrationConnectionByIdFn,
|
|
15
|
+
IntegrationConnection,
|
|
16
|
+
IntegrationTx,
|
|
17
|
+
PublishIntegrationEventReceivedFn,
|
|
18
|
+
RecordDeliveryOnlyFn,
|
|
19
|
+
} from '@shipfox/api-integration-spi';
|
|
20
20
|
import {logger} from '@shipfox/node-opentelemetry';
|
|
21
21
|
import {z} from 'zod';
|
|
22
22
|
import {
|
|
@@ -1 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
import type {IntegrationCapability, IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
2
|
+
|
|
3
|
+
export function toIntegrationConnectionDto(
|
|
4
|
+
connection: IntegrationConnection,
|
|
5
|
+
params: {capabilities: IntegrationCapability[]},
|
|
6
|
+
) {
|
|
7
|
+
return {
|
|
8
|
+
id: connection.id,
|
|
9
|
+
workspace_id: connection.workspaceId,
|
|
10
|
+
provider: connection.provider,
|
|
11
|
+
external_account_id: connection.externalAccountId,
|
|
12
|
+
slug: connection.slug,
|
|
13
|
+
display_name: connection.displayName,
|
|
14
|
+
lifecycle_status: connection.lifecycleStatus,
|
|
15
|
+
capabilities: params.capabilities,
|
|
16
|
+
created_at: connection.createdAt.toISOString(),
|
|
17
|
+
updated_at: connection.updatedAt.toISOString(),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {IntegrationCapability, IntegrationConnection} from '@shipfox/api-integration-core-dto';
|
|
2
1
|
import {
|
|
3
2
|
createE2eSlackConnectionBodySchema,
|
|
4
3
|
createE2eSlackConnectionResponseSchema,
|
|
5
4
|
} from '@shipfox/api-integration-slack-dto';
|
|
5
|
+
import type {IntegrationCapability, IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
6
6
|
import {ClientError, defineRoute} from '@shipfox/node-fastify';
|
|
7
7
|
import {logger} from '@shipfox/node-opentelemetry';
|
|
8
8
|
import type {ConnectSlackInstallationInput} from '#core/install.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionSlugConflictError,
|
|
3
3
|
type IntegrationProviderErrorReason,
|
|
4
|
-
} from '@shipfox/api-integration-
|
|
4
|
+
} from '@shipfox/api-integration-spi';
|
|
5
5
|
import {workspacesInterModuleContract} from '@shipfox/api-workspaces-dto/inter-module';
|
|
6
6
|
import {isInterModuleKnownError} from '@shipfox/inter-module';
|
|
7
7
|
import {ClientError} from '@shipfox/node-fastify';
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
setUserContext,
|
|
5
5
|
type UserContextMembership,
|
|
6
6
|
} from '@shipfox/api-auth-context';
|
|
7
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-
|
|
7
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
8
8
|
import {type AuthMethod, ClientError, closeApp, createApp} from '@shipfox/node-fastify';
|
|
9
9
|
import type {FastifyInstance, FastifyRequest} from 'fastify';
|
|
10
10
|
import type {SlackApiClient} from '#api/client.js';
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {AUTH_USER, requireUserContext, requireWorkspaceAccess} from '@shipfox/api-auth-context';
|
|
2
|
-
import type {IntegrationCapability, IntegrationConnection} from '@shipfox/api-integration-core-dto';
|
|
3
2
|
import {
|
|
4
3
|
createSlackInstallBodySchema,
|
|
5
4
|
createSlackInstallResponseSchema,
|
|
@@ -7,6 +6,7 @@ import {
|
|
|
7
6
|
slackCallbackQuerySchema,
|
|
8
7
|
slackCallbackResponseSchema,
|
|
9
8
|
} from '@shipfox/api-integration-slack-dto';
|
|
9
|
+
import type {IntegrationCapability, IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
10
10
|
import {defineRoute, type RouteGroup} from '@shipfox/node-fastify';
|
|
11
11
|
import type {SlackApiClient} from '#api/client.js';
|
|
12
12
|
import {config} from '#config.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {createHmac, randomUUID} from 'node:crypto';
|
|
2
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-
|
|
3
|
-
import {WEBHOOK_MAX_RAW_BODY_BYTES} from '@shipfox/api-integration-
|
|
2
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
3
|
+
import {WEBHOOK_MAX_RAW_BODY_BYTES} from '@shipfox/api-integration-spi';
|
|
4
4
|
import {closeApp, createApp} from '@shipfox/node-fastify';
|
|
5
5
|
import {db} from '#db/db.js';
|
|
6
6
|
import {getSlackInstallationByTeamId, upsertSlackInstallation} from '#db/installations.js';
|
|
@@ -6,11 +6,8 @@ import type {
|
|
|
6
6
|
RecordDeliveryOnlyFn,
|
|
7
7
|
StoredWebhookRequest,
|
|
8
8
|
WebhookProcessingResult,
|
|
9
|
-
} from '@shipfox/api-integration-
|
|
10
|
-
import {
|
|
11
|
-
createStoredWebhookRequest,
|
|
12
|
-
WEBHOOK_MAX_RAW_BODY_BYTES,
|
|
13
|
-
} from '@shipfox/api-integration-core-dto';
|
|
9
|
+
} from '@shipfox/api-integration-spi';
|
|
10
|
+
import {createStoredWebhookRequest, WEBHOOK_MAX_RAW_BODY_BYTES} from '@shipfox/api-integration-spi';
|
|
14
11
|
import {
|
|
15
12
|
ClientError,
|
|
16
13
|
createRawBodyPlugin,
|