@shipfox/api-integration-linear 8.0.0 → 9.0.2
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 +45 -0
- package/dist/core/agent-tools-provider.d.ts +2 -2
- 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 +4 -5
- package/dist/presentation/dto/integrations.d.ts.map +1 -1
- package/dist/presentation/dto/integrations.js +15 -2
- 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 +20 -13
- 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.ts +1 -1
- package/src/core/webhook-processor.test.ts +2 -2
- package/src/core/webhook-processor.ts +5 -5
- package/src/core/webhook.test.ts +2 -2
- package/src/core/webhook.ts +6 -6
- package/src/presentation/dto/integrations.ts +20 -3
- 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-linear",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "9.0.2",
|
|
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",
|
|
@@ -26,14 +22,25 @@
|
|
|
26
22
|
"drizzle-orm": "^0.45.2",
|
|
27
23
|
"ky": "^2.0.0",
|
|
28
24
|
"zod": "^4.4.3",
|
|
29
|
-
"@shipfox/api-auth-context": "
|
|
30
|
-
"@shipfox/api-integration-
|
|
31
|
-
"@shipfox/api-integration-linear-dto": "
|
|
32
|
-
"@shipfox/config": "1.2.
|
|
33
|
-
"@shipfox/node-drizzle": "0.3.
|
|
34
|
-
"@shipfox/node-fastify": "0.3.
|
|
35
|
-
"@shipfox/node-opentelemetry": "0.6.
|
|
36
|
-
"@shipfox/node-postgres": "0.4.
|
|
25
|
+
"@shipfox/api-auth-context": "9.0.2",
|
|
26
|
+
"@shipfox/api-integration-spi": "0.2.2",
|
|
27
|
+
"@shipfox/api-integration-linear-dto": "9.0.2",
|
|
28
|
+
"@shipfox/config": "1.2.4",
|
|
29
|
+
"@shipfox/node-drizzle": "0.3.4",
|
|
30
|
+
"@shipfox/node-fastify": "0.3.2",
|
|
31
|
+
"@shipfox/node-opentelemetry": "0.6.2",
|
|
32
|
+
"@shipfox/node-postgres": "0.4.4"
|
|
33
|
+
},
|
|
34
|
+
"imports": {
|
|
35
|
+
"#*": "./dist/*"
|
|
36
|
+
},
|
|
37
|
+
"shipfox": {
|
|
38
|
+
"architecture": {
|
|
39
|
+
"schema": 1,
|
|
40
|
+
"realm": "source-available",
|
|
41
|
+
"kind": "implementation",
|
|
42
|
+
"context": "integrations"
|
|
43
|
+
}
|
|
37
44
|
},
|
|
38
45
|
"scripts": {
|
|
39
46
|
"build": "shipfox-swc",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {createServer, type IncomingMessage, type ServerResponse} from 'node:http';
|
|
2
2
|
import type {CallToolResult} from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-
|
|
3
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
4
4
|
import {linearAgentToolCatalog, linearAgentToolSelectionCatalog} from '#core/agent-tools.js';
|
|
5
5
|
import {LinearAgentToolsProvider} from '#core/agent-tools-provider.js';
|
|
6
6
|
import {LinearAccessTokenMissingError} from '#core/errors.js';
|
package/src/core/agent-tools.ts
CHANGED
package/src/core/errors.ts
CHANGED
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 {LinearApiClient} from '#api/client.js';
|
|
5
5
|
import type {LinearTokenStore} 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 {upsertLinearInstallation} from '#db/installations.js';
|
|
6
6
|
import {linearInstallations} from '#db/schema/installations.js';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import {Buffer} from 'node:buffer';
|
|
2
|
+
import {
|
|
3
|
+
LINEAR_PROVIDER,
|
|
4
|
+
linearWebhookBaseEnvelopeSchema,
|
|
5
|
+
} from '@shipfox/api-integration-linear-dto';
|
|
2
6
|
import {
|
|
3
7
|
decodeWebhookBody,
|
|
4
8
|
type GetIntegrationConnectionByIdFn,
|
|
@@ -6,11 +10,7 @@ import {
|
|
|
6
10
|
type RecordDeliveryOnlyFn,
|
|
7
11
|
type StoredWebhookRequest,
|
|
8
12
|
type WebhookProcessingResult,
|
|
9
|
-
} from '@shipfox/api-integration-
|
|
10
|
-
import {
|
|
11
|
-
LINEAR_PROVIDER,
|
|
12
|
-
linearWebhookBaseEnvelopeSchema,
|
|
13
|
-
} from '@shipfox/api-integration-linear-dto';
|
|
13
|
+
} from '@shipfox/api-integration-spi';
|
|
14
14
|
import {verifyHexHmacSignature} from '@shipfox/node-fastify';
|
|
15
15
|
import {logger} from '@shipfox/node-opentelemetry';
|
|
16
16
|
import type {NodePgDatabase} from 'drizzle-orm/node-postgres';
|
package/src/core/webhook.test.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {randomUUID} from 'node:crypto';
|
|
2
|
+
import type {LinearWebhookBaseEnvelopeDto} from '@shipfox/api-integration-linear-dto';
|
|
2
3
|
import type {
|
|
3
4
|
GetIntegrationConnectionByIdFn,
|
|
4
5
|
IntegrationConnection,
|
|
5
6
|
PublishIntegrationEventReceivedFn,
|
|
6
7
|
RecordDeliveryOnlyFn,
|
|
7
|
-
} from '@shipfox/api-integration-
|
|
8
|
-
import type {LinearWebhookBaseEnvelopeDto} from '@shipfox/api-integration-linear-dto';
|
|
8
|
+
} from '@shipfox/api-integration-spi';
|
|
9
9
|
import {db} from '#db/db.js';
|
|
10
10
|
import {upsertLinearInstallation} from '#db/installations.js';
|
|
11
11
|
import {linearInstallations} from '#db/schema/installations.js';
|
package/src/core/webhook.ts
CHANGED
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
GetIntegrationConnectionByIdFn,
|
|
3
|
-
IntegrationTx,
|
|
4
|
-
PublishIntegrationEventReceivedFn,
|
|
5
|
-
RecordDeliveryOnlyFn,
|
|
6
|
-
} from '@shipfox/api-integration-core-dto';
|
|
7
1
|
import {
|
|
8
2
|
LINEAR_PROVIDER,
|
|
9
3
|
type LinearWebhookBaseEnvelopeDto,
|
|
@@ -11,6 +5,12 @@ import {
|
|
|
11
5
|
type LinearWebhookEventName,
|
|
12
6
|
linearWebhookEnvelopeSchema,
|
|
13
7
|
} from '@shipfox/api-integration-linear-dto';
|
|
8
|
+
import type {
|
|
9
|
+
GetIntegrationConnectionByIdFn,
|
|
10
|
+
IntegrationTx,
|
|
11
|
+
PublishIntegrationEventReceivedFn,
|
|
12
|
+
RecordDeliveryOnlyFn,
|
|
13
|
+
} from '@shipfox/api-integration-spi';
|
|
14
14
|
import {logger} from '@shipfox/node-opentelemetry';
|
|
15
15
|
import {getLinearInstallationByOrganizationId} from '#db/installations.js';
|
|
16
16
|
|
|
@@ -1,9 +1,26 @@
|
|
|
1
|
-
import type {IntegrationCapability, IntegrationConnection} from '@shipfox/api-integration-
|
|
2
|
-
import {toIntegrationConnectionDto as toCoreIntegrationConnectionDto} from '@shipfox/api-integration-core-dto';
|
|
1
|
+
import type {IntegrationCapability, IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
3
2
|
|
|
4
3
|
export function toIntegrationConnectionDto(
|
|
5
4
|
connection: IntegrationConnection,
|
|
6
5
|
params: {capabilities: IntegrationCapability[]},
|
|
7
6
|
) {
|
|
8
|
-
return
|
|
7
|
+
return mapIntegrationConnection(connection, params.capabilities);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function mapIntegrationConnection(
|
|
11
|
+
connection: IntegrationConnection,
|
|
12
|
+
capabilities: IntegrationCapability[],
|
|
13
|
+
) {
|
|
14
|
+
return {
|
|
15
|
+
id: connection.id,
|
|
16
|
+
workspace_id: connection.workspaceId,
|
|
17
|
+
provider: connection.provider,
|
|
18
|
+
external_account_id: connection.externalAccountId,
|
|
19
|
+
slug: connection.slug,
|
|
20
|
+
display_name: connection.displayName,
|
|
21
|
+
lifecycle_status: connection.lifecycleStatus,
|
|
22
|
+
capabilities,
|
|
23
|
+
created_at: connection.createdAt.toISOString(),
|
|
24
|
+
updated_at: connection.updatedAt.toISOString(),
|
|
25
|
+
};
|
|
9
26
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {IntegrationCapability, IntegrationConnection} from '@shipfox/api-integration-core-dto';
|
|
2
1
|
import {
|
|
3
2
|
createE2eLinearConnectionBodySchema,
|
|
4
3
|
createE2eLinearConnectionResponseSchema,
|
|
5
4
|
} from '@shipfox/api-integration-linear-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 {ConnectLinearInstallationInput} 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 {ClientError} from '@shipfox/node-fastify';
|
|
6
6
|
import {
|
|
7
7
|
LinearAuthorizationScopeMismatchError,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
ConnectionSlugConflictError,
|
|
9
9
|
type IntegrationConnection,
|
|
10
|
-
} from '@shipfox/api-integration-
|
|
10
|
+
} from '@shipfox/api-integration-spi';
|
|
11
11
|
import {type AuthMethod, ClientError, closeApp, createApp} from '@shipfox/node-fastify';
|
|
12
12
|
import type {FastifyInstance, FastifyRequest} from 'fastify';
|
|
13
13
|
import type {LinearApiClient} 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
|
createLinearInstallBodySchema,
|
|
5
4
|
createLinearInstallResponseSchema,
|
|
@@ -7,6 +6,7 @@ import {
|
|
|
7
6
|
linearCallbackQuerySchema,
|
|
8
7
|
linearCallbackResponseSchema,
|
|
9
8
|
} from '@shipfox/api-integration-linear-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 {LinearApiClient} 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 type {FastifyInstance} from 'fastify';
|
|
6
6
|
import {db} from '#db/db.js';
|
|
@@ -5,11 +5,8 @@ import type {
|
|
|
5
5
|
RecordDeliveryOnlyFn,
|
|
6
6
|
StoredWebhookRequest,
|
|
7
7
|
WebhookProcessingResult,
|
|
8
|
-
} from '@shipfox/api-integration-
|
|
9
|
-
import {
|
|
10
|
-
createStoredWebhookRequest,
|
|
11
|
-
WEBHOOK_MAX_RAW_BODY_BYTES,
|
|
12
|
-
} from '@shipfox/api-integration-core-dto';
|
|
8
|
+
} from '@shipfox/api-integration-spi';
|
|
9
|
+
import {createStoredWebhookRequest, WEBHOOK_MAX_RAW_BODY_BYTES} from '@shipfox/api-integration-spi';
|
|
13
10
|
import {
|
|
14
11
|
ClientError,
|
|
15
12
|
defineRoute,
|