Showing the changes to apps/server/src/sourceControl/BitbucketSourceControlProvider.ts (1 of 42 files). Show all
Unified · Split
| @@ -4,9 +4,9 @@ import * as Option from "effect/Option"; · 3 unmodified lines | |||
| 4 | import { SourceControlProviderError, type ChangeRequest } from "@t3tools/contracts"; | 4 | import { SourceControlProviderError, type ChangeRequest } from "@t3tools/contracts"; |
| 5 | 5 | ||
| 6 | import * as BitbucketApi from "./BitbucketApi.ts"; | 6 | import * as BitbucketApi from "./BitbucketApi.ts"; |
| 7 | import * as BitbucketPullRequests from "./bitbucketPullRequests.ts"; | 7 | import type { NormalizedBitbucketPullRequestRecord } from "./bitbucketPullRequests.ts"; |
| 8 | import * as SourceControlProvider from "./SourceControlProvider.ts"; | 8 | import * as SourceControlProvider from "./SourceControlProvider.ts"; |
| 9 | import type * as SourceControlProviderDiscovery from "./SourceControlProviderDiscovery.ts"; | 9 | import type { SourceControlApiDiscoverySpec } from "./SourceControlProviderDiscovery.ts"; |
| 10 | 10 | ||
| 11 | function providerError( | 11 | function providerError( |
| 12 | operation: string, | 12 | operation: string, |
| @@ -20,9 +20,7 @@ function providerError( · 7 unmodified lines | |||
| 20 | }); | 20 | }); |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | function toChangeRequest( | 23 | function toChangeRequest(summary: NormalizedBitbucketPullRequestRecord): ChangeRequest { |
| 24 | summary: BitbucketPullRequests.NormalizedBitbucketPullRequestRecord, | ||
| 25 | ): ChangeRequest { | ||
| 26 | return { | 24 | return { |
| 27 | provider: "bitbucket", | 25 | provider: "bitbucket", |
| 28 | number: summary.number, | 26 | number: summary.number, |
| @@ -44,7 +42,7 @@ function toChangeRequest( · 15 unmodified lines | |||
| 44 | }; | 42 | }; |
| 45 | } | 43 | } |
| 46 | 44 | ||
| 47 | export const make = Effect.fn("makeBitbucketSourceControlProvider")(function* () { | 45 | export const make = Effect.gen(function* () { |
| 48 | const bitbucket = yield* BitbucketApi.BitbucketApi; | 46 | const bitbucket = yield* BitbucketApi.BitbucketApi; |
| 49 | 47 | ||
| 50 | return SourceControlProvider.SourceControlProvider.of({ | 48 | return SourceControlProvider.SourceControlProvider.of({ |
| @@ -112,9 +110,9 @@ export const make = Effect.fn("makeBitbucketSourceControlProvider")(function* () · 61 unmodified lines | |||
| 112 | }); | 110 | }); |
| 113 | }); | 111 | }); |
| 114 | 112 | ||
| 115 | export const layer = Layer.effect(SourceControlProvider.SourceControlProvider, make()); | 113 | export const layer = Layer.effect(SourceControlProvider.SourceControlProvider, make); |
| 116 | 114 | ||
| 117 | export const makeDiscovery = Effect.fn("makeBitbucketSourceControlProviderDiscovery")(function* () { | 115 | export const makeDiscovery = Effect.gen(function* () { |
| 118 | const bitbucket = yield* BitbucketApi.BitbucketApi; | 116 | const bitbucket = yield* BitbucketApi.BitbucketApi; |
| 119 | 117 | ||
| 120 | return { | 118 | return { |
| @@ -124,5 +122,5 @@ export const makeDiscovery = Effect.fn("makeBitbucketSourceControlProviderDiscov · 3 unmodified lines | |||
| 124 | installHint: | 122 | installHint: |
| 125 | "Set T3CODE_BITBUCKET_EMAIL and T3CODE_BITBUCKET_API_TOKEN on the server (use a Bitbucket API token with pull request and repository scopes).", | 123 | "Set T3CODE_BITBUCKET_EMAIL and T3CODE_BITBUCKET_API_TOKEN on the server (use a Bitbucket API token with pull request and repository scopes).", |
| 126 | probeAuth: bitbucket.probeAuth, | 124 | probeAuth: bitbucket.probeAuth, |
| 127 | } satisfies SourceControlProviderDiscovery.SourceControlApiDiscoverySpec; | 125 | } satisfies SourceControlApiDiscoverySpec; |
| 128 | }); | 126 | }); |