@shipfox/api-integration-core-dto 2.0.0

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.
Files changed (60) hide show
  1. package/.turbo/turbo-build.log +2 -0
  2. package/.turbo/turbo-type$colon$emit.log +1 -0
  3. package/.turbo/turbo-type.log +1 -0
  4. package/CHANGELOG.md +70 -0
  5. package/LICENSE +21 -0
  6. package/dist/contracts/index.d.ts +3 -0
  7. package/dist/contracts/index.d.ts.map +1 -0
  8. package/dist/contracts/index.js +3 -0
  9. package/dist/contracts/index.js.map +1 -0
  10. package/dist/contracts/integrations.d.ts +191 -0
  11. package/dist/contracts/integrations.d.ts.map +1 -0
  12. package/dist/contracts/integrations.js +44 -0
  13. package/dist/contracts/integrations.js.map +1 -0
  14. package/dist/errors.d.ts +4 -0
  15. package/dist/errors.d.ts.map +1 -0
  16. package/dist/errors.js +10 -0
  17. package/dist/errors.js.map +1 -0
  18. package/dist/events.d.ts +87 -0
  19. package/dist/events.d.ts.map +1 -0
  20. package/dist/events.js +56 -0
  21. package/dist/events.js.map +1 -0
  22. package/dist/index.d.ts +7 -0
  23. package/dist/index.d.ts.map +1 -0
  24. package/dist/index.js +8 -0
  25. package/dist/index.js.map +1 -0
  26. package/dist/ports.d.ts +59 -0
  27. package/dist/ports.d.ts.map +1 -0
  28. package/dist/ports.js +3 -0
  29. package/dist/ports.js.map +1 -0
  30. package/dist/schemas/index.d.ts +2 -0
  31. package/dist/schemas/index.d.ts.map +1 -0
  32. package/dist/schemas/index.js +3 -0
  33. package/dist/schemas/index.js.map +1 -0
  34. package/dist/schemas/integrations.d.ts +162 -0
  35. package/dist/schemas/integrations.d.ts.map +1 -0
  36. package/dist/schemas/integrations.js +82 -0
  37. package/dist/schemas/integrations.js.map +1 -0
  38. package/dist/slug.d.ts +7 -0
  39. package/dist/slug.d.ts.map +1 -0
  40. package/dist/slug.js +14 -0
  41. package/dist/slug.js.map +1 -0
  42. package/dist/tsconfig.test.tsbuildinfo +1 -0
  43. package/package.json +55 -0
  44. package/src/contracts/index.ts +43 -0
  45. package/src/contracts/integrations.test.ts +64 -0
  46. package/src/contracts/integrations.ts +312 -0
  47. package/src/errors.ts +6 -0
  48. package/src/events.test.ts +109 -0
  49. package/src/events.ts +91 -0
  50. package/src/index.ts +6 -0
  51. package/src/ports.ts +73 -0
  52. package/src/schemas/index.ts +35 -0
  53. package/src/schemas/integrations.ts +109 -0
  54. package/src/slug.test.ts +32 -0
  55. package/src/slug.ts +26 -0
  56. package/tsconfig.build.json +9 -0
  57. package/tsconfig.build.tsbuildinfo +1 -0
  58. package/tsconfig.json +3 -0
  59. package/tsconfig.test.json +8 -0
  60. package/vitest.config.ts +3 -0
@@ -0,0 +1,2 @@
1
+ $ shipfox-swc
2
+ Successfully compiled: 9 files with swc (42.59ms)
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-emit
@@ -0,0 +1 @@
1
+ $ shipfox-tsc-check
package/CHANGELOG.md ADDED
@@ -0,0 +1,70 @@
1
+ # @shipfox/api-integration-core-dto
2
+
3
+ ## 2.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 1b0d344: Publishes the complete API runtime closure with packed-consumer-safe internal imports and records its exact package set in application releases.
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 115655e: Moves source-event translation to the integration module: source-control providers emit a typed, provider-agnostic `INTEGRATION_SOURCE_COMMIT_PUSHED` event via one transactional publisher, projects subscribes to it instead of decoding GitHub payloads, and branch-deletion pushes are dropped at the source.
14
+ - b8e49ff: Add the client-side Sentry install/connect flow and a workspace settings
15
+ integrations hub.
16
+ - `@shipfox/client-integrations`: shared `IntegrationGallerySection` (capability
17
+ filter, lifecycle pills, "Added" date, external link, connected-first
18
+ ordering, degraded status mode), shared `RedirectInstallPage` powering the
19
+ GitHub and new Sentry install pages, `SentryCallbackPage` with an explicit
20
+ workspace confirm (sessionStorage only pre-selects), two-tier retry, and the
21
+ Sentry hooks (`useCreateSentryInstallMutation`, `connectSentry`,
22
+ `useIntegrationConnectionsQuery`).
23
+ - `@shipfox/client-workspace-settings`: new `/workspaces/$wid/settings/integrations`
24
+ page and an Integrations entry in the settings nav.
25
+ - `@shipfox/client-router`: routes for the Sentry install page, the root-level
26
+ Sentry callback, and the settings integrations page.
27
+ - `@shipfox/react-ui`: `sentry` icon (monochrome, theme-aware).
28
+ - `@shipfox/api-integration-core-dto`: optional `external_url` on the connection
29
+ DTO and an optional `connectionExternalUrl` method on `IntegrationProvider`.
30
+ - `@shipfox/api-integration-core`: `GET /integration-connections` now returns
31
+ connections of every lifecycle status (the active-only filter prevented
32
+ clients from surfacing disabled/error state) and resolves `external_url`
33
+ per connection best-effort.
34
+ - `@shipfox/api-integration-sentry` / `@shipfox/api-integration-github`:
35
+ implement `connectionExternalUrl` (Sentry org URL via a new
36
+ by-connection-id installation lookup; GitHub installation settings URL).
37
+
38
+ - d6d4862: Add a Sentry integration provider that ingests issue webhooks.
39
+ - New `@shipfox/api-integration-sentry` + `-sentry-dto` packages: a webhook
40
+ receiver that verifies the HMAC-SHA256 signature (keyed with the app client
41
+ secret), dedups on `Request-ID`, normalizes the issue payload, and publishes
42
+ `integrations.event.received` with `source: 'sentry'` and `event:
43
+ issue.<action>`. A raw `ignored` action is normalized to `archived`. Malformed,
44
+ bad-JSON, unknown-action, and unknown-resource deliveries are recorded-and-dropped
45
+ with a 204 (deliberate deviation from GitHub's 400 to avoid Sentry disabling the
46
+ webhook).
47
+ - `@shipfox/api-integration-core-dto`: add the `SentryIssuePayload` contract.
48
+ - `@shipfox/api-integration-core`: register the Sentry provider behind
49
+ `INTEGRATIONS_ENABLE_SENTRY_PROVIDER`, add the
50
+ `updateIntegrationConnectionLifecycleStatus` helper, and pin stable
51
+ migration-tracking table names per provider database.
52
+ - `@shipfox/node-fastify`: add the shared `rawBodyPlugin` and `WEBHOOK_BODY_LIMIT`
53
+ exports for webhook receivers.
54
+ - `@shipfox/node-module`: add an optional `migrationsTableName` to `ModuleDatabase`
55
+ so conditionally-composed databases get a position-independent migration table.
56
+ - `@shipfox/api-integration-github`: consume the shared `rawBodyPlugin` instead of
57
+ a local copy (internal refactor, no behavior change).
58
+
59
+ Deploy note: environments with GitHub enabled must rename the existing
60
+ `__drizzle_migrations_integrations_1` table to
61
+ `__drizzle_migrations_integrations_github` as part of this release, or GitHub
62
+ migrations re-run against existing tables.
63
+
64
+ ### Patch Changes
65
+
66
+ - ce062a9: Validates authored agent step integrations against provider tool catalogs and workspace connection capabilities.
67
+ - f3614ae: Add `createCheckoutSpec()` to the integration source-control service and the GitHub provider. GitHub mints a short-lived, repo-scoped installation access token and returns it as structured `CheckoutCredentials` alongside a clean `repositoryUrl`; the secret is never embedded in the URL. `ref` defaults to the repository default branch, providers without checkout support raise a typed `IntegrationCheckoutUnsupportedError`, and a `redactCheckoutSpec()` helper masks the token for logging. Dormant until the checkout-token endpoint and runner enrichment are wired in; no runtime behavior changes yet.
68
+ - f8f339a: Add the `@shipfox/redact` package with shared credential-redaction helpers: `redactUrlCredentials` (scheme-agnostic free-text scrubber), `stripUrlCredentials` (structured single-URL stripper), `redactSecrets` (literal-secret scrubber), and the `REDACTION_PLACEHOLDER` constant. Move `redactCheckoutSpec` from `@shipfox/api-integration-core-dto` into `@shipfox/api-integration-core` so it can reuse the shared `stripUrlCredentials` without breaking the dto-only-dependency rule; its public export path (`@shipfox/api-integration-core`) is unchanged. No behavior change.
69
+ - 01be723: Adds a shared GitHub installation token provider with broad REST minting, in-memory reuse, refresh-margin reminting, single-flight dedupe, and a missing-installation provider error reason.
70
+ - 2933c33: Adds drain-boundary Zod validation for current outbox publisher event payloads.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Shipfox
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,3 @@
1
+ export type { AgentToolCallInput, AgentToolCatalogEntry, AgentToolCatalogMethod, AgentToolJsonSchema, AgentToolSelectionCatalog, AgentToolSelector, AgentToolSelectorKind, AgentToolSensitivity, AgentToolSession, AgentToolsProvider, CheckoutCredentials, CheckoutPermissions, CheckoutSpec, CreateCheckoutSpecInput, FetchFileInput, FileEntry, FilePage, FileSnapshot, IntegrationCapability, IntegrationConnection, IntegrationConnectionLifecycleStatus, IntegrationProvider, IntegrationProviderAdapters, IntegrationProviderErrorReason, IntegrationProviderKind, ListFilesInput, ListRepositoriesInput, OpenAgentToolsSessionInput, RegisteredIntegrationProvider, RepositoryPage, RepositorySnapshot, RepositoryVisibility, ResolveRepositoryInput, SourceControlProvider, } from './integrations.js';
2
+ export { buildProviderRepositoryId, IntegrationProviderError, MAX_REPOSITORY_FILE_BYTES, parseProviderRepositoryId, toIntegrationConnectionDto, } from './integrations.js';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,YAAY,EACZ,uBAAuB,EACvB,cAAc,EACd,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,oCAAoC,EACpC,mBAAmB,EACnB,2BAA2B,EAC3B,8BAA8B,EAC9B,uBAAuB,EACvB,cAAc,EACd,qBAAqB,EACrB,0BAA0B,EAC1B,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { buildProviderRepositoryId, IntegrationProviderError, MAX_REPOSITORY_FILE_BYTES, parseProviderRepositoryId, toIntegrationConnectionDto } from './integrations.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/contracts/index.ts"],"sourcesContent":["export type {\n AgentToolCallInput,\n AgentToolCatalogEntry,\n AgentToolCatalogMethod,\n AgentToolJsonSchema,\n AgentToolSelectionCatalog,\n AgentToolSelector,\n AgentToolSelectorKind,\n AgentToolSensitivity,\n AgentToolSession,\n AgentToolsProvider,\n CheckoutCredentials,\n CheckoutPermissions,\n CheckoutSpec,\n CreateCheckoutSpecInput,\n FetchFileInput,\n FileEntry,\n FilePage,\n FileSnapshot,\n IntegrationCapability,\n IntegrationConnection,\n IntegrationConnectionLifecycleStatus,\n IntegrationProvider,\n IntegrationProviderAdapters,\n IntegrationProviderErrorReason,\n IntegrationProviderKind,\n ListFilesInput,\n ListRepositoriesInput,\n OpenAgentToolsSessionInput,\n RegisteredIntegrationProvider,\n RepositoryPage,\n RepositorySnapshot,\n RepositoryVisibility,\n ResolveRepositoryInput,\n SourceControlProvider,\n} from './integrations.js';\nexport {\n buildProviderRepositoryId,\n IntegrationProviderError,\n MAX_REPOSITORY_FILE_BYTES,\n parseProviderRepositoryId,\n toIntegrationConnectionDto,\n} from './integrations.js';\n"],"names":["buildProviderRepositoryId","IntegrationProviderError","MAX_REPOSITORY_FILE_BYTES","parseProviderRepositoryId","toIntegrationConnectionDto"],"mappings":"AAoCA,SACEA,yBAAyB,EACzBC,wBAAwB,EACxBC,yBAAyB,EACzBC,yBAAyB,EACzBC,0BAA0B,QACrB,oBAAoB"}
@@ -0,0 +1,191 @@
1
+ export type IntegrationProviderKind = string;
2
+ export type IntegrationCapability = 'source_control' | 'agent_tools';
3
+ export type IntegrationConnectionLifecycleStatus = 'active' | 'disabled' | 'error';
4
+ export interface IntegrationConnection<ProviderKind extends IntegrationProviderKind = IntegrationProviderKind> {
5
+ id: string;
6
+ workspaceId: string;
7
+ provider: ProviderKind;
8
+ externalAccountId: string;
9
+ slug: string;
10
+ displayName: string;
11
+ lifecycleStatus: IntegrationConnectionLifecycleStatus;
12
+ createdAt: Date;
13
+ updatedAt: Date;
14
+ }
15
+ export type RepositoryVisibility = 'public' | 'private' | 'internal' | 'unknown';
16
+ export interface RepositorySnapshot {
17
+ externalRepositoryId: string;
18
+ owner: string;
19
+ name: string;
20
+ fullName: string;
21
+ defaultBranch: string;
22
+ visibility: RepositoryVisibility;
23
+ cloneUrl: string;
24
+ htmlUrl: string;
25
+ }
26
+ export interface RepositoryPage {
27
+ repositories: RepositorySnapshot[];
28
+ nextCursor: string | null;
29
+ }
30
+ export interface ListRepositoriesInput<Connection extends IntegrationConnection = IntegrationConnection> {
31
+ connection: Connection;
32
+ limit: number;
33
+ cursor?: string | undefined;
34
+ search?: string | undefined;
35
+ }
36
+ export interface ResolveRepositoryInput<Connection extends IntegrationConnection = IntegrationConnection> {
37
+ connection: Connection;
38
+ externalRepositoryId: string;
39
+ }
40
+ export interface FileSnapshot {
41
+ path: string;
42
+ ref: string;
43
+ content: string;
44
+ }
45
+ export interface FileEntry {
46
+ path: string;
47
+ type: 'file';
48
+ size: number | null;
49
+ }
50
+ export interface FilePage {
51
+ files: FileEntry[];
52
+ nextCursor: string | null;
53
+ }
54
+ export interface ListFilesInput<Connection extends IntegrationConnection = IntegrationConnection> extends ResolveRepositoryInput<Connection> {
55
+ ref: string;
56
+ prefix: string;
57
+ limit: number;
58
+ cursor?: string | undefined;
59
+ }
60
+ export interface FetchFileInput<Connection extends IntegrationConnection = IntegrationConnection> extends ResolveRepositoryInput<Connection> {
61
+ ref: string;
62
+ path: string;
63
+ }
64
+ export interface CheckoutCredentials {
65
+ username: string;
66
+ token: string;
67
+ expiresAt: Date;
68
+ }
69
+ export interface CheckoutGitAuthor {
70
+ name: string;
71
+ email: string;
72
+ }
73
+ export interface CheckoutPermissions {
74
+ contents: 'read' | 'write';
75
+ }
76
+ export interface CheckoutSpec {
77
+ /**
78
+ * Clone URL that must never embed authentication material. Credentials live
79
+ * only in `credentials` so a redaction helper can mask them; a provider that
80
+ * embeds a token in this URL would bypass redaction and leak it into logs,
81
+ * `git remote -v`, and persisted job rows.
82
+ */
83
+ repositoryUrl: string;
84
+ ref: string;
85
+ credentials?: CheckoutCredentials | undefined;
86
+ gitAuthor?: CheckoutGitAuthor | undefined;
87
+ }
88
+ export interface CreateCheckoutSpecInput<Connection extends IntegrationConnection = IntegrationConnection> extends ResolveRepositoryInput<Connection> {
89
+ ref?: string | undefined;
90
+ permissions?: CheckoutPermissions | undefined;
91
+ }
92
+ export interface SourceControlProvider<Connection extends IntegrationConnection = IntegrationConnection> {
93
+ listRepositories(input: ListRepositoriesInput<Connection>): Promise<RepositoryPage>;
94
+ resolveRepository(input: ResolveRepositoryInput<Connection>): Promise<RepositorySnapshot>;
95
+ listFiles(input: ListFilesInput<Connection>): Promise<FilePage>;
96
+ fetchFile(input: FetchFileInput<Connection>): Promise<FileSnapshot>;
97
+ createCheckoutSpec?(input: CreateCheckoutSpecInput<Connection>): Promise<CheckoutSpec>;
98
+ }
99
+ export type AgentToolSensitivity = 'read' | 'write';
100
+ export type AgentToolJsonSchema = Record<string, unknown>;
101
+ export interface AgentToolCatalogMethod<RequiredScope = unknown> {
102
+ id: string;
103
+ description: string;
104
+ sensitivity: AgentToolSensitivity;
105
+ sensitive: boolean;
106
+ requiredScope: RequiredScope;
107
+ }
108
+ export interface AgentToolCatalogEntry<RequiredScope = unknown> {
109
+ id: string;
110
+ description: string;
111
+ sensitivity: AgentToolSensitivity;
112
+ sensitive: boolean;
113
+ requiredScope: RequiredScope;
114
+ inputSchema: AgentToolJsonSchema;
115
+ outputSchema?: AgentToolJsonSchema | undefined;
116
+ methods?: readonly AgentToolCatalogMethod<RequiredScope>[] | undefined;
117
+ }
118
+ export type AgentToolSelectorKind = 'family' | 'family_wildcard' | 'method' | 'standalone';
119
+ export interface AgentToolSelector {
120
+ readonly token: string;
121
+ readonly kind: AgentToolSelectorKind;
122
+ readonly sensitivity: AgentToolSensitivity;
123
+ readonly sensitive: boolean;
124
+ }
125
+ export interface AgentToolSelectionCatalog {
126
+ readonly selectors: readonly AgentToolSelector[];
127
+ }
128
+ export interface AgentToolCallInput {
129
+ toolId: string;
130
+ arguments: Record<string, unknown>;
131
+ }
132
+ export interface AgentToolSession<CallResult = unknown> {
133
+ call(input: AgentToolCallInput): Promise<CallResult>;
134
+ close?(): Promise<void>;
135
+ }
136
+ export interface OpenAgentToolsSessionInput<Connection extends IntegrationConnection = IntegrationConnection, RequiredScope = unknown, ProviderScope = unknown> {
137
+ connection: Connection;
138
+ tools: readonly AgentToolCatalogEntry<RequiredScope>[];
139
+ scope: ProviderScope;
140
+ }
141
+ export interface AgentToolsProvider<Connection extends IntegrationConnection = IntegrationConnection, RequiredScope = unknown, ProviderScope = unknown, CallResult = unknown> {
142
+ catalog(): readonly AgentToolCatalogEntry<RequiredScope>[] | Promise<readonly AgentToolCatalogEntry<RequiredScope>[]>;
143
+ selectionCatalog(): AgentToolSelectionCatalog | Promise<AgentToolSelectionCatalog>;
144
+ openSession(input: OpenAgentToolsSessionInput<Connection, RequiredScope, ProviderScope>): Promise<AgentToolSession<CallResult>>;
145
+ }
146
+ export interface IntegrationProviderAdapters<Connection extends IntegrationConnection = IntegrationConnection> {
147
+ source_control?: SourceControlProvider<Connection> | undefined;
148
+ agent_tools?: AgentToolsProvider<Connection> | undefined;
149
+ }
150
+ export interface IntegrationProvider<ProviderKind extends IntegrationProviderKind = IntegrationProviderKind, Route = unknown, Connection extends IntegrationConnection<ProviderKind> = IntegrationConnection<ProviderKind>> {
151
+ provider: ProviderKind;
152
+ displayName: string;
153
+ adapters?: IntegrationProviderAdapters<Connection> | undefined;
154
+ routes?: Route[] | undefined;
155
+ /**
156
+ * Resolves the provider-side home of a connection (e.g. the Sentry org or the
157
+ * GitHub installation settings page). Returns undefined when the connection has
158
+ * no external home or the provider-side record is missing.
159
+ */
160
+ connectionExternalUrl?(connection: Connection): Promise<string | undefined>;
161
+ }
162
+ export interface RegisteredIntegrationProvider<ProviderKind extends IntegrationProviderKind = IntegrationProviderKind, Route = unknown, Connection extends IntegrationConnection<ProviderKind> = IntegrationConnection<ProviderKind>> extends IntegrationProvider<ProviderKind, Route, Connection> {
163
+ adapters: IntegrationProviderAdapters<Connection>;
164
+ capabilities: IntegrationCapability[];
165
+ }
166
+ export type IntegrationProviderErrorReason = 'repository-not-found' | 'installation-not-found' | 'file-not-found' | 'access-denied' | 'rate-limited' | 'timeout' | 'provider-unavailable' | 'malformed-provider-response' | 'content-too-large' | 'too-many-files';
167
+ export declare class IntegrationProviderError extends Error {
168
+ readonly reason: IntegrationProviderErrorReason;
169
+ readonly retryAfterSeconds?: number | undefined;
170
+ constructor(reason: IntegrationProviderErrorReason, message: string, retryAfterSeconds?: number | undefined);
171
+ }
172
+ export declare const MAX_REPOSITORY_FILE_BYTES = 1000000;
173
+ export declare function toIntegrationConnectionDto(connection: IntegrationConnection, options: {
174
+ capabilities: IntegrationCapability[];
175
+ externalUrl?: string | undefined;
176
+ }): {
177
+ created_at: string;
178
+ updated_at: string;
179
+ external_url?: string;
180
+ id: string;
181
+ workspace_id: string;
182
+ provider: string;
183
+ external_account_id: string;
184
+ slug: string;
185
+ display_name: string;
186
+ lifecycle_status: IntegrationConnectionLifecycleStatus;
187
+ capabilities: IntegrationCapability[];
188
+ };
189
+ export declare function buildProviderRepositoryId(provider: IntegrationProviderKind, value: string): string;
190
+ export declare function parseProviderRepositoryId(externalRepositoryId: string, expectedProvider: IntegrationProviderKind): string;
191
+ //# sourceMappingURL=integrations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integrations.d.ts","sourceRoot":"","sources":["../../src/contracts/integrations.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAC7C,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAAG,aAAa,CAAC;AACrE,MAAM,MAAM,oCAAoC,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,CAAC;AAEnF,MAAM,WAAW,qBAAqB,CACpC,YAAY,SAAS,uBAAuB,GAAG,uBAAuB;IAEtE,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,YAAY,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,oCAAoC,CAAC;IACtD,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjF,MAAM,WAAW,kBAAkB;IACjC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAA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MAAM,EACC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS;CAKzD;AAED,eAAO,MAAM,yBAAyB,UAAY,CAAC;AAEnD,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,qBAAqB,EACjC,OAAO,EAAE;IACP,YAAY,EAAE,qBAAqB,EAAE,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;;;;;;;;;;;;EAeF;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,uBAAuB,EACjC,KAAK,EAAE,MAAM,GACZ,MAAM,CAER;AAED,wBAAgB,yBAAyB,CACvC,oBAAoB,EAAE,MAAM,EAC5B,gBAAgB,EAAE,uBAAuB,GACxC,MAAM,CAuBR"}
@@ -0,0 +1,44 @@
1
+ export class IntegrationProviderError extends Error {
2
+ constructor(reason, message, retryAfterSeconds){
3
+ super(message), this.reason = reason, this.retryAfterSeconds = retryAfterSeconds;
4
+ this.name = 'IntegrationProviderError';
5
+ }
6
+ }
7
+ export const MAX_REPOSITORY_FILE_BYTES = 1_000_000;
8
+ export function toIntegrationConnectionDto(connection, options) {
9
+ return {
10
+ id: connection.id,
11
+ workspace_id: connection.workspaceId,
12
+ provider: connection.provider,
13
+ external_account_id: connection.externalAccountId,
14
+ slug: connection.slug,
15
+ display_name: connection.displayName,
16
+ lifecycle_status: connection.lifecycleStatus,
17
+ capabilities: options.capabilities,
18
+ ...options.externalUrl ? {
19
+ external_url: options.externalUrl
20
+ } : {},
21
+ created_at: connection.createdAt.toISOString(),
22
+ updated_at: connection.updatedAt.toISOString()
23
+ };
24
+ }
25
+ export function buildProviderRepositoryId(provider, value) {
26
+ return `${provider}:${value}`;
27
+ }
28
+ export function parseProviderRepositoryId(externalRepositoryId, expectedProvider) {
29
+ const separatorIndex = externalRepositoryId.indexOf(':');
30
+ if (separatorIndex <= 0) {
31
+ throw new IntegrationProviderError('repository-not-found', `External repository id is missing a provider prefix: ${externalRepositoryId}`);
32
+ }
33
+ const prefix = externalRepositoryId.slice(0, separatorIndex);
34
+ const value = externalRepositoryId.slice(separatorIndex + 1);
35
+ if (prefix !== expectedProvider) {
36
+ throw new IntegrationProviderError('repository-not-found', `External repository id ${externalRepositoryId} is not owned by provider ${expectedProvider}`);
37
+ }
38
+ if (!value) {
39
+ throw new IntegrationProviderError('repository-not-found', `External repository id ${externalRepositoryId} is missing a provider-owned value`);
40
+ }
41
+ return value;
42
+ }
43
+
44
+ //# sourceMappingURL=integrations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/contracts/integrations.ts"],"sourcesContent":["export type IntegrationProviderKind = string;\nexport type IntegrationCapability = 'source_control' | 'agent_tools';\nexport type IntegrationConnectionLifecycleStatus = 'active' | 'disabled' | 'error';\n\nexport interface IntegrationConnection<\n ProviderKind extends IntegrationProviderKind = IntegrationProviderKind,\n> {\n id: string;\n workspaceId: string;\n provider: ProviderKind;\n externalAccountId: string;\n slug: string;\n displayName: string;\n lifecycleStatus: IntegrationConnectionLifecycleStatus;\n createdAt: Date;\n updatedAt: Date;\n}\n\nexport type RepositoryVisibility = 'public' | 'private' | 'internal' | 'unknown';\n\nexport interface RepositorySnapshot {\n externalRepositoryId: string;\n owner: string;\n name: string;\n fullName: string;\n defaultBranch: string;\n visibility: RepositoryVisibility;\n cloneUrl: string;\n htmlUrl: string;\n}\n\nexport interface RepositoryPage {\n repositories: RepositorySnapshot[];\n nextCursor: string | null;\n}\n\nexport interface ListRepositoriesInput<\n Connection extends IntegrationConnection = IntegrationConnection,\n> {\n connection: Connection;\n limit: number;\n cursor?: string | undefined;\n search?: string | undefined;\n}\n\nexport interface ResolveRepositoryInput<\n Connection extends IntegrationConnection = IntegrationConnection,\n> {\n connection: Connection;\n externalRepositoryId: string;\n}\n\nexport interface FileSnapshot {\n path: string;\n ref: string;\n content: string;\n}\n\nexport interface FileEntry {\n path: string;\n type: 'file';\n size: number | null;\n}\n\nexport interface FilePage {\n files: FileEntry[];\n nextCursor: string | null;\n}\n\nexport interface ListFilesInput<Connection extends IntegrationConnection = IntegrationConnection>\n extends ResolveRepositoryInput<Connection> {\n ref: string;\n prefix: string;\n limit: number;\n cursor?: string | undefined;\n}\n\nexport interface FetchFileInput<Connection extends IntegrationConnection = IntegrationConnection>\n extends ResolveRepositoryInput<Connection> {\n ref: string;\n path: string;\n}\n\nexport interface CheckoutCredentials {\n username: string;\n token: string;\n expiresAt: Date;\n}\n\nexport interface CheckoutGitAuthor {\n name: string;\n email: string;\n}\n\nexport interface CheckoutPermissions {\n contents: 'read' | 'write';\n}\n\nexport interface CheckoutSpec {\n /**\n * Clone URL that must never embed authentication material. Credentials live\n * only in `credentials` so a redaction helper can mask them; a provider that\n * embeds a token in this URL would bypass redaction and leak it into logs,\n * `git remote -v`, and persisted job rows.\n */\n repositoryUrl: string;\n ref: string;\n credentials?: CheckoutCredentials | undefined;\n gitAuthor?: CheckoutGitAuthor | undefined;\n}\n\nexport interface CreateCheckoutSpecInput<\n Connection extends IntegrationConnection = IntegrationConnection,\n> extends ResolveRepositoryInput<Connection> {\n ref?: string | undefined;\n permissions?: CheckoutPermissions | undefined;\n}\n\nexport interface SourceControlProvider<\n Connection extends IntegrationConnection = IntegrationConnection,\n> {\n listRepositories(input: ListRepositoriesInput<Connection>): Promise<RepositoryPage>;\n resolveRepository(input: ResolveRepositoryInput<Connection>): Promise<RepositorySnapshot>;\n listFiles(input: ListFilesInput<Connection>): Promise<FilePage>;\n fetchFile(input: FetchFileInput<Connection>): Promise<FileSnapshot>;\n createCheckoutSpec?(input: CreateCheckoutSpecInput<Connection>): Promise<CheckoutSpec>;\n}\n\nexport type AgentToolSensitivity = 'read' | 'write';\nexport type AgentToolJsonSchema = Record<string, unknown>;\n\nexport interface AgentToolCatalogMethod<RequiredScope = unknown> {\n id: string;\n description: string;\n sensitivity: AgentToolSensitivity;\n sensitive: boolean;\n requiredScope: RequiredScope;\n}\n\nexport interface AgentToolCatalogEntry<RequiredScope = unknown> {\n id: string;\n description: string;\n sensitivity: AgentToolSensitivity;\n sensitive: boolean;\n requiredScope: RequiredScope;\n inputSchema: AgentToolJsonSchema;\n outputSchema?: AgentToolJsonSchema | undefined;\n methods?: readonly AgentToolCatalogMethod<RequiredScope>[] | undefined;\n}\n\nexport type AgentToolSelectorKind = 'family' | 'family_wildcard' | 'method' | 'standalone';\n\nexport interface AgentToolSelector {\n readonly token: string;\n readonly kind: AgentToolSelectorKind;\n readonly sensitivity: AgentToolSensitivity;\n readonly sensitive: boolean;\n}\n\nexport interface AgentToolSelectionCatalog {\n readonly selectors: readonly AgentToolSelector[];\n}\n\nexport interface AgentToolCallInput {\n toolId: string;\n arguments: Record<string, unknown>;\n}\n\nexport interface AgentToolSession<CallResult = unknown> {\n call(input: AgentToolCallInput): Promise<CallResult>;\n close?(): Promise<void>;\n}\n\nexport interface OpenAgentToolsSessionInput<\n Connection extends IntegrationConnection = IntegrationConnection,\n RequiredScope = unknown,\n ProviderScope = unknown,\n> {\n connection: Connection;\n tools: readonly AgentToolCatalogEntry<RequiredScope>[];\n scope: ProviderScope;\n}\n\nexport interface AgentToolsProvider<\n Connection extends IntegrationConnection = IntegrationConnection,\n RequiredScope = unknown,\n ProviderScope = unknown,\n CallResult = unknown,\n> {\n catalog():\n | readonly AgentToolCatalogEntry<RequiredScope>[]\n | Promise<readonly AgentToolCatalogEntry<RequiredScope>[]>;\n selectionCatalog(): AgentToolSelectionCatalog | Promise<AgentToolSelectionCatalog>;\n openSession(\n input: OpenAgentToolsSessionInput<Connection, RequiredScope, ProviderScope>,\n ): Promise<AgentToolSession<CallResult>>;\n}\n\nexport interface IntegrationProviderAdapters<\n Connection extends IntegrationConnection = IntegrationConnection,\n> {\n source_control?: SourceControlProvider<Connection> | undefined;\n agent_tools?: AgentToolsProvider<Connection> | undefined;\n}\n\nexport interface IntegrationProvider<\n ProviderKind extends IntegrationProviderKind = IntegrationProviderKind,\n Route = unknown,\n Connection extends IntegrationConnection<ProviderKind> = IntegrationConnection<ProviderKind>,\n> {\n provider: ProviderKind;\n displayName: string;\n adapters?: IntegrationProviderAdapters<Connection> | undefined;\n routes?: Route[] | undefined;\n /**\n * Resolves the provider-side home of a connection (e.g. the Sentry org or the\n * GitHub installation settings page). Returns undefined when the connection has\n * no external home or the provider-side record is missing.\n */\n connectionExternalUrl?(connection: Connection): Promise<string | undefined>;\n}\n\nexport interface RegisteredIntegrationProvider<\n ProviderKind extends IntegrationProviderKind = IntegrationProviderKind,\n Route = unknown,\n Connection extends IntegrationConnection<ProviderKind> = IntegrationConnection<ProviderKind>,\n> extends IntegrationProvider<ProviderKind, Route, Connection> {\n adapters: IntegrationProviderAdapters<Connection>;\n capabilities: IntegrationCapability[];\n}\n\nexport type IntegrationProviderErrorReason =\n | 'repository-not-found'\n | 'installation-not-found'\n | 'file-not-found'\n | 'access-denied'\n | 'rate-limited'\n | 'timeout'\n | 'provider-unavailable'\n | 'malformed-provider-response'\n | 'content-too-large'\n | 'too-many-files';\n\nexport class IntegrationProviderError extends Error {\n constructor(\n public readonly reason: IntegrationProviderErrorReason,\n message: string,\n public readonly retryAfterSeconds?: number | undefined,\n ) {\n super(message);\n this.name = 'IntegrationProviderError';\n }\n}\n\nexport const MAX_REPOSITORY_FILE_BYTES = 1_000_000;\n\nexport function toIntegrationConnectionDto(\n connection: IntegrationConnection,\n options: {\n capabilities: IntegrationCapability[];\n externalUrl?: string | undefined;\n },\n) {\n return {\n id: connection.id,\n workspace_id: connection.workspaceId,\n provider: connection.provider,\n external_account_id: connection.externalAccountId,\n slug: connection.slug,\n display_name: connection.displayName,\n lifecycle_status: connection.lifecycleStatus,\n capabilities: options.capabilities,\n ...(options.externalUrl ? {external_url: options.externalUrl} : {}),\n created_at: connection.createdAt.toISOString(),\n updated_at: connection.updatedAt.toISOString(),\n };\n}\n\nexport function buildProviderRepositoryId(\n provider: IntegrationProviderKind,\n value: string,\n): string {\n return `${provider}:${value}`;\n}\n\nexport function parseProviderRepositoryId(\n externalRepositoryId: string,\n expectedProvider: IntegrationProviderKind,\n): string {\n const separatorIndex = externalRepositoryId.indexOf(':');\n if (separatorIndex <= 0) {\n throw new IntegrationProviderError(\n 'repository-not-found',\n `External repository id is missing a provider prefix: ${externalRepositoryId}`,\n );\n }\n const prefix = externalRepositoryId.slice(0, separatorIndex);\n const value = externalRepositoryId.slice(separatorIndex + 1);\n if (prefix !== expectedProvider) {\n throw new IntegrationProviderError(\n 'repository-not-found',\n `External repository id ${externalRepositoryId} is not owned by provider ${expectedProvider}`,\n );\n }\n if (!value) {\n throw new IntegrationProviderError(\n 'repository-not-found',\n `External repository id ${externalRepositoryId} is missing a provider-owned value`,\n );\n }\n return value;\n}\n"],"names":["IntegrationProviderError","Error","reason","message","retryAfterSeconds","name","MAX_REPOSITORY_FILE_BYTES","toIntegrationConnectionDto","connection","options","id","workspace_id","workspaceId","provider","external_account_id","externalAccountId","slug","display_name","displayName","lifecycle_status","lifecycleStatus","capabilities","externalUrl","external_url","created_at","createdAt","toISOString","updated_at","updatedAt","buildProviderRepositoryId","value","parseProviderRepositoryId","externalRepositoryId","expectedProvider","separatorIndex","indexOf","prefix","slice"],"mappings":"AAmPA,OAAO,MAAMA,iCAAiCC;IAC5C,YACE,AAAgBC,MAAsC,EACtDC,OAAe,EACf,AAAgBC,iBAAsC,CACtD;QACA,KAAK,CAACD,eAJUD,SAAAA,aAEAE,oBAAAA;QAGhB,IAAI,CAACC,IAAI,GAAG;IACd;AACF;AAEA,OAAO,MAAMC,4BAA4B,UAAU;AAEnD,OAAO,SAASC,2BACdC,UAAiC,EACjCC,OAGC;IAED,OAAO;QACLC,IAAIF,WAAWE,EAAE;QACjBC,cAAcH,WAAWI,WAAW;QACpCC,UAAUL,WAAWK,QAAQ;QAC7BC,qBAAqBN,WAAWO,iBAAiB;QACjDC,MAAMR,WAAWQ,IAAI;QACrBC,cAAcT,WAAWU,WAAW;QACpCC,kBAAkBX,WAAWY,eAAe;QAC5CC,cAAcZ,QAAQY,YAAY;QAClC,GAAIZ,QAAQa,WAAW,GAAG;YAACC,cAAcd,QAAQa,WAAW;QAAA,IAAI,CAAC,CAAC;QAClEE,YAAYhB,WAAWiB,SAAS,CAACC,WAAW;QAC5CC,YAAYnB,WAAWoB,SAAS,CAACF,WAAW;IAC9C;AACF;AAEA,OAAO,SAASG,0BACdhB,QAAiC,EACjCiB,KAAa;IAEb,OAAO,GAAGjB,SAAS,CAAC,EAAEiB,OAAO;AAC/B;AAEA,OAAO,SAASC,0BACdC,oBAA4B,EAC5BC,gBAAyC;IAEzC,MAAMC,iBAAiBF,qBAAqBG,OAAO,CAAC;IACpD,IAAID,kBAAkB,GAAG;QACvB,MAAM,IAAIlC,yBACR,wBACA,CAAC,qDAAqD,EAAEgC,sBAAsB;IAElF;IACA,MAAMI,SAASJ,qBAAqBK,KAAK,CAAC,GAAGH;IAC7C,MAAMJ,QAAQE,qBAAqBK,KAAK,CAACH,iBAAiB;IAC1D,IAAIE,WAAWH,kBAAkB;QAC/B,MAAM,IAAIjC,yBACR,wBACA,CAAC,uBAAuB,EAAEgC,qBAAqB,0BAA0B,EAAEC,kBAAkB;IAEjG;IACA,IAAI,CAACH,OAAO;QACV,MAAM,IAAI9B,yBACR,wBACA,CAAC,uBAAuB,EAAEgC,qBAAqB,kCAAkC,CAAC;IAEtF;IACA,OAAOF;AACT"}
@@ -0,0 +1,4 @@
1
+ export declare class ConnectionSlugConflictError extends Error {
2
+ constructor(cause: unknown);
3
+ }
4
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,KAAK,EAAE,OAAO;CAI3B"}
package/dist/errors.js ADDED
@@ -0,0 +1,10 @@
1
+ export class ConnectionSlugConflictError extends Error {
2
+ constructor(cause){
3
+ super('Could not allocate a unique integration connection slug. Try again.', {
4
+ cause
5
+ });
6
+ this.name = 'ConnectionSlugConflictError';
7
+ }
8
+ }
9
+
10
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/errors.ts"],"sourcesContent":["export class ConnectionSlugConflictError extends Error {\n constructor(cause: unknown) {\n super('Could not allocate a unique integration connection slug. Try again.', {cause});\n this.name = 'ConnectionSlugConflictError';\n }\n}\n"],"names":["ConnectionSlugConflictError","Error","cause","name"],"mappings":"AAAA,OAAO,MAAMA,oCAAoCC;IAC/C,YAAYC,KAAc,CAAE;QAC1B,KAAK,CAAC,uEAAuE;YAACA;QAAK;QACnF,IAAI,CAACC,IAAI,GAAG;IACd;AACF"}
@@ -0,0 +1,87 @@
1
+ import { z } from 'zod';
2
+ export declare const INTEGRATION_EVENT_RECEIVED: "integrations.event.received";
3
+ export declare const integrationEventReceivedSchema: z.ZodObject<{
4
+ provider: z.ZodString;
5
+ source: z.ZodString;
6
+ event: z.ZodString;
7
+ workspaceId: z.ZodString;
8
+ connectionId: z.ZodString;
9
+ connectionName: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
10
+ deliveryId: z.ZodString;
11
+ receivedAt: z.ZodString;
12
+ payload: z.ZodCustom<unknown, unknown>;
13
+ }, z.core.$strip>;
14
+ export type IntegrationEventReceivedEvent = z.infer<typeof integrationEventReceivedSchema>;
15
+ export declare const sourcePushSchema: z.ZodObject<{
16
+ externalRepositoryId: z.ZodString;
17
+ ref: z.ZodString;
18
+ headCommitSha: z.ZodString;
19
+ defaultBranch: z.ZodString;
20
+ isDefaultBranch: z.ZodBoolean;
21
+ }, z.core.$strip>;
22
+ export type SourcePushPayload = z.infer<typeof sourcePushSchema>;
23
+ export declare const INTEGRATION_SOURCE_COMMIT_PUSHED: "integrations.source_control.commit_pushed";
24
+ export declare const integrationSourceCommitPushedSchema: z.ZodObject<{
25
+ provider: z.ZodString;
26
+ workspaceId: z.ZodString;
27
+ connectionId: z.ZodString;
28
+ deliveryId: z.ZodString;
29
+ receivedAt: z.ZodString;
30
+ push: z.ZodObject<{
31
+ externalRepositoryId: z.ZodString;
32
+ ref: z.ZodString;
33
+ headCommitSha: z.ZodString;
34
+ defaultBranch: z.ZodString;
35
+ isDefaultBranch: z.ZodBoolean;
36
+ }, z.core.$strip>;
37
+ }, z.core.$strip>;
38
+ export type IntegrationSourceCommitPushedEvent = z.infer<typeof integrationSourceCommitPushedSchema>;
39
+ export interface SentryIssuePayload {
40
+ action: SentryIssueAction;
41
+ issueId: string;
42
+ shortId: string | null;
43
+ title: string;
44
+ culprit: string | null;
45
+ level: string | null;
46
+ status: string | null;
47
+ platform: string | null;
48
+ webUrl: string | null;
49
+ issueUrl: string | null;
50
+ projectUrl: string | null;
51
+ firstSeenAt: string | null;
52
+ lastSeenAt: string | null;
53
+ }
54
+ export declare const SENTRY_ISSUE_ACTIONS: readonly ["created", "resolved", "assigned", "archived", "unresolved"];
55
+ export type SentryIssueAction = (typeof SENTRY_ISSUE_ACTIONS)[number];
56
+ export interface IntegrationsEventMap {
57
+ [INTEGRATION_EVENT_RECEIVED]: IntegrationEventReceivedEvent;
58
+ [INTEGRATION_SOURCE_COMMIT_PUSHED]: IntegrationSourceCommitPushedEvent;
59
+ }
60
+ export declare const integrationsEventSchemas: {
61
+ "integrations.event.received": z.ZodObject<{
62
+ provider: z.ZodString;
63
+ source: z.ZodString;
64
+ event: z.ZodString;
65
+ workspaceId: z.ZodString;
66
+ connectionId: z.ZodString;
67
+ connectionName: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
68
+ deliveryId: z.ZodString;
69
+ receivedAt: z.ZodString;
70
+ payload: z.ZodCustom<unknown, unknown>;
71
+ }, z.core.$strip>;
72
+ "integrations.source_control.commit_pushed": z.ZodObject<{
73
+ provider: z.ZodString;
74
+ workspaceId: z.ZodString;
75
+ connectionId: z.ZodString;
76
+ deliveryId: z.ZodString;
77
+ receivedAt: z.ZodString;
78
+ push: z.ZodObject<{
79
+ externalRepositoryId: z.ZodString;
80
+ ref: z.ZodString;
81
+ headCommitSha: z.ZodString;
82
+ defaultBranch: z.ZodString;
83
+ isDefaultBranch: z.ZodBoolean;
84
+ }, z.core.$strip>;
85
+ }, z.core.$strip>;
86
+ };
87
+ //# sourceMappingURL=events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../src/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,eAAO,MAAM,0BAA0B,EAAG,6BAAsC,CAAC;AAOjF,eAAO,MAAM,8BAA8B;;;;;;;;;;iBAYzC,CAAC;AACH,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAI3F,eAAO,MAAM,gBAAgB;;;;;;iBAM3B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEjE,eAAO,MAAM,gCAAgC,EAC3C,2CAAoD,CAAC;AAKvD,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;iBAO9C,CAAC;AACH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,mCAAmC,CAC3C,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,iBAAiB,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAKD,eAAO,MAAM,oBAAoB,wEAMvB,CAAC;AAEX,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACnC,CAAC,0BAA0B,CAAC,EAAE,6BAA6B,CAAC;IAC5D,CAAC,gCAAgC,CAAC,EAAE,kCAAkC,CAAC;CACxE;AAED,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;CAGoB,CAAC"}
package/dist/events.js ADDED
@@ -0,0 +1,56 @@
1
+ import { z } from 'zod';
2
+ export const INTEGRATION_EVENT_RECEIVED = 'integrations.event.received';
3
+ const nonEmptyStringSchema = z.string().nonempty();
4
+ const isoDateTimeSchema = z.string().datetime();
5
+ const requiredUnknownSchema = z.custom((value)=>value !== undefined);
6
+ const nullableConnectionNameSchema = nonEmptyStringSchema.nullish().default(null);
7
+ export const integrationEventReceivedSchema = z.object({
8
+ provider: nonEmptyStringSchema,
9
+ source: nonEmptyStringSchema,
10
+ event: nonEmptyStringSchema,
11
+ workspaceId: nonEmptyStringSchema,
12
+ connectionId: nonEmptyStringSchema,
13
+ // Denormalized so trigger consumers can render the connection name without a
14
+ // synchronous callback into the integrations module.
15
+ connectionName: nullableConnectionNameSchema,
16
+ deliveryId: nonEmptyStringSchema,
17
+ receivedAt: isoDateTimeSchema,
18
+ payload: requiredUnknownSchema
19
+ });
20
+ // A source-control push, normalized by the producing provider and carried by
21
+ // `INTEGRATION_SOURCE_COMMIT_PUSHED` for domain consumers.
22
+ export const sourcePushSchema = z.object({
23
+ externalRepositoryId: nonEmptyStringSchema,
24
+ ref: nonEmptyStringSchema,
25
+ headCommitSha: nonEmptyStringSchema,
26
+ defaultBranch: nonEmptyStringSchema,
27
+ isDefaultBranch: z.boolean()
28
+ });
29
+ export const INTEGRATION_SOURCE_COMMIT_PUSHED = 'integrations.source_control.commit_pushed';
30
+ // Typed, provider-agnostic source-control event. The producing provider owns the
31
+ // translation from its raw webhook into this shape, so domain consumers never decode
32
+ // provider payloads. `isDefaultBranch` is a fact; the branch policy lives in the consumer.
33
+ export const integrationSourceCommitPushedSchema = z.object({
34
+ provider: nonEmptyStringSchema,
35
+ workspaceId: nonEmptyStringSchema,
36
+ connectionId: nonEmptyStringSchema,
37
+ deliveryId: nonEmptyStringSchema,
38
+ receivedAt: isoDateTimeSchema,
39
+ push: sourcePushSchema
40
+ });
41
+ // Single source of truth for Sentry issue actions: the sentry-dto webhook schema
42
+ // builds its z.enum from this tuple, so accepted webhook actions and the published
43
+ // SentryIssuePayload contract cannot drift.
44
+ export const SENTRY_ISSUE_ACTIONS = [
45
+ 'created',
46
+ 'resolved',
47
+ 'assigned',
48
+ 'archived',
49
+ 'unresolved'
50
+ ];
51
+ export const integrationsEventSchemas = {
52
+ [INTEGRATION_EVENT_RECEIVED]: integrationEventReceivedSchema,
53
+ [INTEGRATION_SOURCE_COMMIT_PUSHED]: integrationSourceCommitPushedSchema
54
+ };
55
+
56
+ //# sourceMappingURL=events.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/events.ts"],"sourcesContent":["import {z} from 'zod';\n\nexport const INTEGRATION_EVENT_RECEIVED = 'integrations.event.received' as const;\n\nconst nonEmptyStringSchema = z.string().nonempty();\nconst isoDateTimeSchema = z.string().datetime();\nconst requiredUnknownSchema = z.custom<unknown>((value) => value !== undefined);\nconst nullableConnectionNameSchema = nonEmptyStringSchema.nullish().default(null);\n\nexport const integrationEventReceivedSchema = z.object({\n provider: nonEmptyStringSchema,\n source: nonEmptyStringSchema,\n event: nonEmptyStringSchema,\n workspaceId: nonEmptyStringSchema,\n connectionId: nonEmptyStringSchema,\n // Denormalized so trigger consumers can render the connection name without a\n // synchronous callback into the integrations module.\n connectionName: nullableConnectionNameSchema,\n deliveryId: nonEmptyStringSchema,\n receivedAt: isoDateTimeSchema,\n payload: requiredUnknownSchema,\n});\nexport type IntegrationEventReceivedEvent = z.infer<typeof integrationEventReceivedSchema>;\n\n// A source-control push, normalized by the producing provider and carried by\n// `INTEGRATION_SOURCE_COMMIT_PUSHED` for domain consumers.\nexport const sourcePushSchema = z.object({\n externalRepositoryId: nonEmptyStringSchema,\n ref: nonEmptyStringSchema,\n headCommitSha: nonEmptyStringSchema,\n defaultBranch: nonEmptyStringSchema,\n isDefaultBranch: z.boolean(),\n});\nexport type SourcePushPayload = z.infer<typeof sourcePushSchema>;\n\nexport const INTEGRATION_SOURCE_COMMIT_PUSHED =\n 'integrations.source_control.commit_pushed' as const;\n\n// Typed, provider-agnostic source-control event. The producing provider owns the\n// translation from its raw webhook into this shape, so domain consumers never decode\n// provider payloads. `isDefaultBranch` is a fact; the branch policy lives in the consumer.\nexport const integrationSourceCommitPushedSchema = z.object({\n provider: nonEmptyStringSchema,\n workspaceId: nonEmptyStringSchema,\n connectionId: nonEmptyStringSchema,\n deliveryId: nonEmptyStringSchema,\n receivedAt: isoDateTimeSchema,\n push: sourcePushSchema,\n});\nexport type IntegrationSourceCommitPushedEvent = z.infer<\n typeof integrationSourceCommitPushedSchema\n>;\n\nexport interface SentryIssuePayload {\n action: SentryIssueAction;\n issueId: string;\n shortId: string | null;\n title: string;\n culprit: string | null;\n level: string | null;\n status: string | null;\n platform: string | null;\n webUrl: string | null;\n issueUrl: string | null;\n projectUrl: string | null;\n firstSeenAt: string | null;\n lastSeenAt: string | null;\n}\n\n// Single source of truth for Sentry issue actions: the sentry-dto webhook schema\n// builds its z.enum from this tuple, so accepted webhook actions and the published\n// SentryIssuePayload contract cannot drift.\nexport const SENTRY_ISSUE_ACTIONS = [\n 'created',\n 'resolved',\n 'assigned',\n 'archived',\n 'unresolved',\n] as const;\n\nexport type SentryIssueAction = (typeof SENTRY_ISSUE_ACTIONS)[number];\n\nexport interface IntegrationsEventMap {\n [INTEGRATION_EVENT_RECEIVED]: IntegrationEventReceivedEvent;\n [INTEGRATION_SOURCE_COMMIT_PUSHED]: IntegrationSourceCommitPushedEvent;\n}\n\nexport const integrationsEventSchemas = {\n [INTEGRATION_EVENT_RECEIVED]: integrationEventReceivedSchema,\n [INTEGRATION_SOURCE_COMMIT_PUSHED]: integrationSourceCommitPushedSchema,\n} satisfies Record<keyof IntegrationsEventMap, z.ZodType>;\n"],"names":["z","INTEGRATION_EVENT_RECEIVED","nonEmptyStringSchema","string","nonempty","isoDateTimeSchema","datetime","requiredUnknownSchema","custom","value","undefined","nullableConnectionNameSchema","nullish","default","integrationEventReceivedSchema","object","provider","source","event","workspaceId","connectionId","connectionName","deliveryId","receivedAt","payload","sourcePushSchema","externalRepositoryId","ref","headCommitSha","defaultBranch","isDefaultBranch","boolean","INTEGRATION_SOURCE_COMMIT_PUSHED","integrationSourceCommitPushedSchema","push","SENTRY_ISSUE_ACTIONS","integrationsEventSchemas"],"mappings":"AAAA,SAAQA,CAAC,QAAO,MAAM;AAEtB,OAAO,MAAMC,6BAA6B,8BAAuC;AAEjF,MAAMC,uBAAuBF,EAAEG,MAAM,GAAGC,QAAQ;AAChD,MAAMC,oBAAoBL,EAAEG,MAAM,GAAGG,QAAQ;AAC7C,MAAMC,wBAAwBP,EAAEQ,MAAM,CAAU,CAACC,QAAUA,UAAUC;AACrE,MAAMC,+BAA+BT,qBAAqBU,OAAO,GAAGC,OAAO,CAAC;AAE5E,OAAO,MAAMC,iCAAiCd,EAAEe,MAAM,CAAC;IACrDC,UAAUd;IACVe,QAAQf;IACRgB,OAAOhB;IACPiB,aAAajB;IACbkB,cAAclB;IACd,6EAA6E;IAC7E,qDAAqD;IACrDmB,gBAAgBV;IAChBW,YAAYpB;IACZqB,YAAYlB;IACZmB,SAASjB;AACX,GAAG;AAGH,6EAA6E;AAC7E,2DAA2D;AAC3D,OAAO,MAAMkB,mBAAmBzB,EAAEe,MAAM,CAAC;IACvCW,sBAAsBxB;IACtByB,KAAKzB;IACL0B,eAAe1B;IACf2B,eAAe3B;IACf4B,iBAAiB9B,EAAE+B,OAAO;AAC5B,GAAG;AAGH,OAAO,MAAMC,mCACX,4CAAqD;AAEvD,iFAAiF;AACjF,qFAAqF;AACrF,2FAA2F;AAC3F,OAAO,MAAMC,sCAAsCjC,EAAEe,MAAM,CAAC;IAC1DC,UAAUd;IACViB,aAAajB;IACbkB,cAAclB;IACdoB,YAAYpB;IACZqB,YAAYlB;IACZ6B,MAAMT;AACR,GAAG;AAqBH,iFAAiF;AACjF,mFAAmF;AACnF,4CAA4C;AAC5C,OAAO,MAAMU,uBAAuB;IAClC;IACA;IACA;IACA;IACA;CACD,CAAU;AASX,OAAO,MAAMC,2BAA2B;IACtC,CAACnC,2BAA2B,EAAEa;IAC9B,CAACkB,iCAAiC,EAAEC;AACtC,EAA0D"}
@@ -0,0 +1,7 @@
1
+ export * from '#contracts/index.js';
2
+ export * from '#errors.js';
3
+ export * from '#events.js';
4
+ export * from '#ports.js';
5
+ export * from '#schemas/index.js';
6
+ export * from '#slug.js';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from '#contracts/index.js';
2
+ export * from '#errors.js';
3
+ export * from '#events.js';
4
+ export * from '#ports.js';
5
+ export * from '#schemas/index.js';
6
+ export * from '#slug.js';
7
+
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from '#contracts/index.js';\nexport * from '#errors.js';\nexport * from '#events.js';\nexport * from '#ports.js';\nexport * from '#schemas/index.js';\nexport * from '#slug.js';\n"],"names":[],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,aAAa;AAC3B,cAAc,aAAa;AAC3B,cAAc,YAAY;AAC1B,cAAc,oBAAoB;AAClC,cAAc,WAAW"}