@shipfox/api-integration-sentry 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 +4 -4
- package/CHANGELOG.md +49 -0
- package/README.md +3 -8
- 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/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/presentation/dto/integrations.d.ts +6 -7
- package/dist/presentation/dto/integrations.d.ts.map +1 -1
- package/dist/presentation/dto/integrations.js +12 -4
- package/dist/presentation/dto/integrations.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/webhook-context.d.ts +1 -1
- package/dist/presentation/routes/webhook-context.d.ts.map +1 -1
- package/dist/presentation/routes/webhook-context.js.map +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 +21 -14
- 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 +1 -4
- package/src/core/webhook-processor.ts +5 -5
- package/src/core/webhook.ts +2 -2
- package/src/index.ts +1 -1
- package/src/presentation/dto/integrations.ts +13 -5
- 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/webhook-context.ts +1 -1
- package/src/presentation/routes/webhooks.test.ts +1 -1
- 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-sentry",
|
|
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,15 +22,26 @@
|
|
|
26
22
|
"drizzle-orm": "^0.45.2",
|
|
27
23
|
"ky": "^2.0.0",
|
|
28
24
|
"zod": "^4.4.3",
|
|
29
|
-
"@shipfox/api-
|
|
30
|
-
"@shipfox/api-
|
|
31
|
-
"@shipfox/
|
|
32
|
-
"@shipfox/
|
|
33
|
-
"@shipfox/node-
|
|
34
|
-
"@shipfox/
|
|
35
|
-
"@shipfox/node-
|
|
36
|
-
"@shipfox/node-
|
|
37
|
-
"@shipfox/node-
|
|
25
|
+
"@shipfox/api-integration-spi": "0.2.2",
|
|
26
|
+
"@shipfox/api-auth-context": "9.0.2",
|
|
27
|
+
"@shipfox/config": "1.2.4",
|
|
28
|
+
"@shipfox/node-drizzle": "0.3.4",
|
|
29
|
+
"@shipfox/node-fastify": "0.3.2",
|
|
30
|
+
"@shipfox/api-integration-sentry-dto": "9.0.2",
|
|
31
|
+
"@shipfox/node-opentelemetry": "0.6.2",
|
|
32
|
+
"@shipfox/node-postgres": "0.4.4",
|
|
33
|
+
"@shipfox/node-module": "1.0.1"
|
|
34
|
+
},
|
|
35
|
+
"imports": {
|
|
36
|
+
"#*": "./dist/*"
|
|
37
|
+
},
|
|
38
|
+
"shipfox": {
|
|
39
|
+
"architecture": {
|
|
40
|
+
"schema": 1,
|
|
41
|
+
"realm": "source-available",
|
|
42
|
+
"kind": "implementation",
|
|
43
|
+
"context": "integrations"
|
|
44
|
+
}
|
|
38
45
|
},
|
|
39
46
|
"scripts": {
|
|
40
47
|
"build": "shipfox-swc && shipfox-temporal-bundle dist/temporal/workflows/index.js",
|
package/src/core/errors.ts
CHANGED
package/src/core/install.test.ts
CHANGED
package/src/core/install.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {createHash, timingSafeEqual} from 'node:crypto';
|
|
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 {SentryApiClient, SentryAuthorization} from '#api/client.js';
|
|
5
5
|
import {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import {createHmac, randomUUID} from 'node:crypto';
|
|
2
|
-
import {
|
|
3
|
-
createStoredWebhookRequest,
|
|
4
|
-
type IntegrationConnection,
|
|
5
|
-
} from '@shipfox/api-integration-core-dto';
|
|
2
|
+
import {createStoredWebhookRequest, type IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
6
3
|
import {eq} from 'drizzle-orm';
|
|
7
4
|
import type {SentryApiClient} from '#api/client.js';
|
|
8
5
|
import {db} from '#db/db.js';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import {Buffer} from 'node:buffer';
|
|
2
|
+
import {
|
|
3
|
+
sentryInstallationWebhookSchema,
|
|
4
|
+
sentryIssueWebhookSchema,
|
|
5
|
+
} from '@shipfox/api-integration-sentry-dto';
|
|
2
6
|
import {
|
|
3
7
|
decodeWebhookBody,
|
|
4
8
|
type GetIntegrationConnectionByIdFn,
|
|
@@ -7,11 +11,7 @@ import {
|
|
|
7
11
|
type StoredWebhookRequest,
|
|
8
12
|
type UpdateIntegrationConnectionLifecycleStatusFn,
|
|
9
13
|
type WebhookProcessingResult,
|
|
10
|
-
} from '@shipfox/api-integration-
|
|
11
|
-
import {
|
|
12
|
-
sentryInstallationWebhookSchema,
|
|
13
|
-
sentryIssueWebhookSchema,
|
|
14
|
-
} from '@shipfox/api-integration-sentry-dto';
|
|
14
|
+
} 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 type {SentryApiClient} from '#api/client.js';
|
package/src/core/webhook.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type {SentryIssueWebhookDto} from '@shipfox/api-integration-sentry-dto';
|
|
1
2
|
import type {
|
|
2
3
|
GetIntegrationConnectionByIdFn,
|
|
3
4
|
IntegrationTx,
|
|
@@ -5,8 +6,7 @@ import type {
|
|
|
5
6
|
RecordDeliveryOnlyFn,
|
|
6
7
|
SentryIssuePayload,
|
|
7
8
|
UpdateIntegrationConnectionLifecycleStatusFn,
|
|
8
|
-
} from '@shipfox/api-integration-
|
|
9
|
-
import type {SentryIssueWebhookDto} from '@shipfox/api-integration-sentry-dto';
|
|
9
|
+
} from '@shipfox/api-integration-spi';
|
|
10
10
|
import {logger} from '@shipfox/node-opentelemetry';
|
|
11
11
|
import type {SentryApiClient} from '#api/client.js';
|
|
12
12
|
import {
|
package/src/index.ts
CHANGED
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
PublishIntegrationEventReceivedFn,
|
|
6
6
|
RecordDeliveryOnlyFn,
|
|
7
7
|
UpdateIntegrationConnectionLifecycleStatusFn,
|
|
8
|
-
} from '@shipfox/api-integration-
|
|
8
|
+
} from '@shipfox/api-integration-spi';
|
|
9
9
|
import type {ModuleWorker} from '@shipfox/node-module';
|
|
10
10
|
import type {NodePgDatabase} from 'drizzle-orm/node-postgres';
|
|
11
11
|
import {createSentryApiClient, type SentryApiClient} from '#api/client.js';
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type IntegrationConnection,
|
|
3
|
-
toIntegrationConnectionDto as toCoreIntegrationConnectionDto,
|
|
4
|
-
} from '@shipfox/api-integration-core-dto';
|
|
1
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
5
2
|
|
|
6
3
|
// Sentry exposes no adapters, so its connections carry no capabilities.
|
|
7
4
|
export function toIntegrationConnectionDto(connection: IntegrationConnection<'sentry'>) {
|
|
8
|
-
return
|
|
5
|
+
return {
|
|
6
|
+
id: connection.id,
|
|
7
|
+
workspace_id: connection.workspaceId,
|
|
8
|
+
provider: connection.provider,
|
|
9
|
+
external_account_id: connection.externalAccountId,
|
|
10
|
+
slug: connection.slug,
|
|
11
|
+
display_name: connection.displayName,
|
|
12
|
+
lifecycle_status: connection.lifecycleStatus,
|
|
13
|
+
capabilities: [],
|
|
14
|
+
created_at: connection.createdAt.toISOString(),
|
|
15
|
+
updated_at: connection.updatedAt.toISOString(),
|
|
16
|
+
};
|
|
9
17
|
}
|
|
@@ -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 {SentryApiClient} from '#api/client.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {AUTH_USER, requireUserContext, requireWorkspaceAccess} from '@shipfox/api-auth-context';
|
|
2
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-core-dto';
|
|
3
2
|
import {
|
|
4
3
|
createSentryInstallBodySchema,
|
|
5
4
|
createSentryInstallResponseSchema,
|
|
6
5
|
sentryConnectBodySchema,
|
|
7
6
|
sentryConnectResponseSchema,
|
|
8
7
|
} from '@shipfox/api-integration-sentry-dto';
|
|
8
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
9
9
|
import {defineRoute, type RouteGroup} from '@shipfox/node-fastify';
|
|
10
10
|
import type {SentryApiClient} from '#api/client.js';
|
|
11
11
|
import {config} from '#config.js';
|
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
PublishIntegrationEventReceivedFn,
|
|
4
4
|
RecordDeliveryOnlyFn,
|
|
5
5
|
UpdateIntegrationConnectionLifecycleStatusFn,
|
|
6
|
-
} from '@shipfox/api-integration-
|
|
6
|
+
} from '@shipfox/api-integration-spi';
|
|
7
7
|
import type {NodePgDatabase} from 'drizzle-orm/node-postgres';
|
|
8
8
|
import type {SentryApiClient} from '#api/client.js';
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {createHmac, randomUUID} from 'node:crypto';
|
|
2
|
-
import type {IntegrationConnection} from '@shipfox/api-integration-core-dto';
|
|
3
2
|
import {sentryIssueActionSchema} from '@shipfox/api-integration-sentry-dto';
|
|
3
|
+
import type {IntegrationConnection} from '@shipfox/api-integration-spi';
|
|
4
4
|
import {closeApp, createApp} from '@shipfox/node-fastify';
|
|
5
5
|
import {eq} from 'drizzle-orm';
|
|
6
6
|
import type {FastifyInstance} from 'fastify';
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import {randomUUID} from 'node:crypto';
|
|
2
|
-
import {
|
|
3
|
-
createStoredWebhookRequest,
|
|
4
|
-
WEBHOOK_MAX_RAW_BODY_BYTES,
|
|
5
|
-
} from '@shipfox/api-integration-core-dto';
|
|
2
|
+
import {createStoredWebhookRequest, WEBHOOK_MAX_RAW_BODY_BYTES} from '@shipfox/api-integration-spi';
|
|
6
3
|
import {
|
|
7
4
|
ClientError,
|
|
8
5
|
defineRoute,
|
|
@@ -94,7 +91,7 @@ function sentryWebhookHeaders(headers: Record<string, string | string[] | undefi
|
|
|
94
91
|
|
|
95
92
|
function sendSentryWebhookResponse(
|
|
96
93
|
reply: {code(statusCode: number): void},
|
|
97
|
-
result: import('@shipfox/api-integration-
|
|
94
|
+
result: import('@shipfox/api-integration-spi').WebhookProcessingResult,
|
|
98
95
|
headers: Record<string, string | string[] | undefined>,
|
|
99
96
|
) {
|
|
100
97
|
if (result.outcome === 'discarded' && result.reason === 'invalid_signature') {
|