diff --git a/package.json b/package.json index 9a13913..b690a4a 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "ts-autofix": "^1.0.0", "tsx": "^4.19.1", "typedoc": "^0.26.10", - "typescript": "^5.6.3", + "typescript": "5.7.0-beta", "typescript-eslint": "^8.10.0", "vitest": "^2.1.3" }, @@ -78,9 +78,17 @@ "types": "./dist/cloud/index.d.ts", "default": "./dist/cloud/index.js" }, + "./cloud/openapi": { + "types": "./dist/cloud/openapi/index.d.ts", + "default": "./dist/cloud/openapi/index.js" + }, "./server": { "types": "./dist/server/index.d.ts", "default": "./dist/server/index.js" + }, + "./server/openapi": { + "types": "./dist/server/openapi/index.d.ts", + "default": "./dist/server/openapi/index.js" } }, "types": "dist/index.d.ts", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a5bc528..c0f4365 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,7 +35,7 @@ importers: version: 0.14.0 openapi-typescript: specifier: ^7.4.1 - version: 7.4.1(typescript@5.6.3) + version: 7.4.1(typescript@5.7.0-beta) prettier: specifier: ^3.3.3 version: 3.3.3 @@ -47,13 +47,13 @@ importers: version: 4.19.1 typedoc: specifier: ^0.26.10 - version: 0.26.10(typescript@5.6.3) + version: 0.26.10(typescript@5.7.0-beta) typescript: - specifier: ^5.6.3 - version: 5.6.3 + specifier: 5.7.0-beta + version: 5.7.0-beta typescript-eslint: specifier: ^8.10.0 - version: 8.10.0(eslint@9.12.0)(typescript@5.6.3) + version: 8.10.0(eslint@9.12.0)(typescript@5.7.0-beta) vitest: specifier: ^2.1.3 version: 2.1.3(@types/node@22.7.6) @@ -1373,8 +1373,8 @@ packages: engines: {node: '>=4.2.0'} hasBin: true - typescript@5.6.3: - resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} + typescript@5.7.0-beta: + resolution: {integrity: sha512-opDlmEnzKdl082N5piLS43lsyugg0aORdv+XnNzMv5yP5VtBWuZhFDxU8lizmhW+PEFa/fZiShYRBxKsrkTDMQ==} engines: {node: '>=14.17'} hasBin: true @@ -1860,34 +1860,34 @@ snapshots: '@types/unist@3.0.3': {} - '@typescript-eslint/eslint-plugin@8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0)(typescript@5.6.3))(eslint@9.12.0)(typescript@5.6.3)': + '@typescript-eslint/eslint-plugin@8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0)(typescript@5.7.0-beta))(eslint@9.12.0)(typescript@5.7.0-beta)': dependencies: '@eslint-community/regexpp': 4.11.1 - '@typescript-eslint/parser': 8.10.0(eslint@9.12.0)(typescript@5.6.3) + '@typescript-eslint/parser': 8.10.0(eslint@9.12.0)(typescript@5.7.0-beta) '@typescript-eslint/scope-manager': 8.10.0 - '@typescript-eslint/type-utils': 8.10.0(eslint@9.12.0)(typescript@5.6.3) - '@typescript-eslint/utils': 8.10.0(eslint@9.12.0)(typescript@5.6.3) + '@typescript-eslint/type-utils': 8.10.0(eslint@9.12.0)(typescript@5.7.0-beta) + '@typescript-eslint/utils': 8.10.0(eslint@9.12.0)(typescript@5.7.0-beta) '@typescript-eslint/visitor-keys': 8.10.0 eslint: 9.12.0 graphemer: 1.4.0 ignore: 5.3.2 natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.3.0(typescript@5.7.0-beta) optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.10.0(eslint@9.12.0)(typescript@5.6.3)': + '@typescript-eslint/parser@8.10.0(eslint@9.12.0)(typescript@5.7.0-beta)': dependencies: '@typescript-eslint/scope-manager': 8.10.0 '@typescript-eslint/types': 8.10.0 - '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.7.0-beta) '@typescript-eslint/visitor-keys': 8.10.0 debug: 4.3.7(supports-color@9.4.0) eslint: 9.12.0 optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - supports-color @@ -1896,21 +1896,21 @@ snapshots: '@typescript-eslint/types': 8.10.0 '@typescript-eslint/visitor-keys': 8.10.0 - '@typescript-eslint/type-utils@8.10.0(eslint@9.12.0)(typescript@5.6.3)': + '@typescript-eslint/type-utils@8.10.0(eslint@9.12.0)(typescript@5.7.0-beta)': dependencies: - '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) - '@typescript-eslint/utils': 8.10.0(eslint@9.12.0)(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.7.0-beta) + '@typescript-eslint/utils': 8.10.0(eslint@9.12.0)(typescript@5.7.0-beta) debug: 4.3.7(supports-color@9.4.0) - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.3.0(typescript@5.7.0-beta) optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - eslint - supports-color '@typescript-eslint/types@8.10.0': {} - '@typescript-eslint/typescript-estree@8.10.0(typescript@5.6.3)': + '@typescript-eslint/typescript-estree@8.10.0(typescript@5.7.0-beta)': dependencies: '@typescript-eslint/types': 8.10.0 '@typescript-eslint/visitor-keys': 8.10.0 @@ -1919,18 +1919,18 @@ snapshots: is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.6.3 - ts-api-utils: 1.3.0(typescript@5.6.3) + ts-api-utils: 1.3.0(typescript@5.7.0-beta) optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.10.0(eslint@9.12.0)(typescript@5.6.3)': + '@typescript-eslint/utils@8.10.0(eslint@9.12.0)(typescript@5.7.0-beta)': dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@9.12.0) '@typescript-eslint/scope-manager': 8.10.0 '@typescript-eslint/types': 8.10.0 - '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.6.3) + '@typescript-eslint/typescript-estree': 8.10.0(typescript@5.7.0-beta) eslint: 9.12.0 transitivePeerDependencies: - supports-color @@ -2521,14 +2521,14 @@ snapshots: openapi-typescript-helpers@0.0.13: {} - openapi-typescript@7.4.1(typescript@5.6.3): + openapi-typescript@7.4.1(typescript@5.7.0-beta): dependencies: '@redocly/openapi-core': 1.25.7(supports-color@9.4.0) ansi-colors: 4.1.3 change-case: 5.4.4 parse-json: 8.1.0 supports-color: 9.4.0 - typescript: 5.6.3 + typescript: 5.7.0-beta yargs-parser: 21.1.1 transitivePeerDependencies: - encoding @@ -2700,9 +2700,9 @@ snapshots: trim-lines@3.0.1: {} - ts-api-utils@1.3.0(typescript@5.6.3): + ts-api-utils@1.3.0(typescript@5.7.0-beta): dependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta ts-autofix@1.0.0: dependencies: @@ -2724,29 +2724,29 @@ snapshots: type-fest@4.26.1: {} - typedoc@0.26.10(typescript@5.6.3): + typedoc@0.26.10(typescript@5.7.0-beta): dependencies: lunr: 2.3.9 markdown-it: 14.1.0 minimatch: 9.0.5 shiki: 1.22.0 - typescript: 5.6.3 + typescript: 5.7.0-beta yaml: 2.6.0 - typescript-eslint@8.10.0(eslint@9.12.0)(typescript@5.6.3): + typescript-eslint@8.10.0(eslint@9.12.0)(typescript@5.7.0-beta): dependencies: - '@typescript-eslint/eslint-plugin': 8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0)(typescript@5.6.3))(eslint@9.12.0)(typescript@5.6.3) - '@typescript-eslint/parser': 8.10.0(eslint@9.12.0)(typescript@5.6.3) - '@typescript-eslint/utils': 8.10.0(eslint@9.12.0)(typescript@5.6.3) + '@typescript-eslint/eslint-plugin': 8.10.0(@typescript-eslint/parser@8.10.0(eslint@9.12.0)(typescript@5.7.0-beta))(eslint@9.12.0)(typescript@5.7.0-beta) + '@typescript-eslint/parser': 8.10.0(eslint@9.12.0)(typescript@5.7.0-beta) + '@typescript-eslint/utils': 8.10.0(eslint@9.12.0)(typescript@5.7.0-beta) optionalDependencies: - typescript: 5.6.3 + typescript: 5.7.0-beta transitivePeerDependencies: - eslint - supports-color typescript@4.9.5: {} - typescript@5.6.3: {} + typescript@5.7.0-beta: {} uc.micro@2.1.0: {} diff --git a/src/base64.test.ts b/src/base64.test.ts index fd91cba..63c5556 100644 --- a/src/base64.test.ts +++ b/src/base64.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { fromBase64, toBase64 } from "./base64.js" +import { fromBase64, toBase64 } from "./base64.ts" test("toBase64", ({ expect }) => { const based = toBase64("Copyright © 2024 CodeRabbit") diff --git a/src/cloud/client.test.ts b/src/cloud/client.test.ts index 8869c8e..374f5dd 100644 --- a/src/cloud/client.test.ts +++ b/src/cloud/client.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { createBitbucketCloudClient } from "./client.js" +import { createBitbucketCloudClient } from "./client.ts" test("createBitbucketCloudClient", ({ expect }) => { const client = createBitbucketCloudClient() diff --git a/src/cloud/client.ts b/src/cloud/client.ts index 2074729..19e8221 100644 --- a/src/cloud/client.ts +++ b/src/cloud/client.ts @@ -1,6 +1,6 @@ import type { Client, ClientOptions } from "openapi-fetch" import createClient from "openapi-fetch" -import type { paths } from "./openapi/index.js" +import type { paths } from "./openapi/index.ts" /** * Creates an `openapi-fetch` client using {@link createClient}. diff --git a/src/cloud/index.ts b/src/cloud/index.ts index f7e9a95..5a40987 100644 --- a/src/cloud/index.ts +++ b/src/cloud/index.ts @@ -1,2 +1,2 @@ -export * from "./client.js" -export type * from "./openapi/index.js" +export * from "./client.ts" +export type * as OpenApi from "./openapi/index.ts" diff --git a/src/cloud/openapi/index.ts b/src/cloud/openapi/index.ts index 2606b7b..61adde5 100644 --- a/src/cloud/openapi/index.ts +++ b/src/cloud/openapi/index.ts @@ -1 +1 @@ -export type * from "./openapi-typescript.js" +export type * from "./openapi-typescript.ts" diff --git a/src/index.test.ts b/src/index.test.ts index 4fc7164..7d82afc 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import * as index from "./index.js" +import * as index from "./index.ts" test("index", ({ expect }) => { expect(index).toBeDefined() diff --git a/src/index.ts b/src/index.ts index f9be965..e6d6029 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,3 +1,3 @@ -export * from "./base64.js" -export * as cloud from "./cloud/index.js" -export * as server from "./server/index.js" +export * from "./base64.ts" +export * as BitbucketCloud from "./cloud/index.ts" +export * as BitbucketServer from "./server/index.ts" diff --git a/src/server/client.test.ts b/src/server/client.test.ts index 2bb124b..97681b5 100644 --- a/src/server/client.test.ts +++ b/src/server/client.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { createBitbucketServerClient } from "./client.js" +import { createBitbucketServerClient } from "./client.ts" test("createBitbucketServerClient", ({ expect }) => { const client = createBitbucketServerClient() diff --git a/src/server/client.ts b/src/server/client.ts index 5c6c6d5..43fbf00 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -1,6 +1,6 @@ import type { Client, ClientOptions } from "openapi-fetch" import createClient from "openapi-fetch" -import type { paths } from "./openapi/index.js" +import type { paths } from "./openapi/index.ts" /** * Creates an `openapi-fetch` client using {@link createClient}. diff --git a/src/server/index.ts b/src/server/index.ts index b8c6429..92e8ae1 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -1,3 +1,4 @@ -export * from "./client.js" -export type * from "./openapi/index.js" -export * from "./webhooks/index.js" +export * from "./client.ts" +export * from "./interfaces/index.ts" +export type * as OpenApi from "./openapi/index.ts" +export * from "./webhooks/index.ts" diff --git a/src/server/interfaces/index.ts b/src/server/interfaces/index.ts new file mode 100644 index 0000000..761c971 --- /dev/null +++ b/src/server/interfaces/index.ts @@ -0,0 +1 @@ +export * from "./schema_rest_pull_request_activity.ts" diff --git a/src/server/interfaces/schema_rest_pull_request_activity.ts b/src/server/interfaces/schema_rest_pull_request_activity.ts new file mode 100644 index 0000000..421088d --- /dev/null +++ b/src/server/interfaces/schema_rest_pull_request_activity.ts @@ -0,0 +1,47 @@ +import type { + SchemaRestComment, + SchemaRestPullRequestActivity as SchemaRestPullRequestActivityBase, +} from "../openapi/index.ts" + +export type SchemaRestPullRequestActivity = + | SchemaRestPullRequestActivityCommented + | SchemaRestPullRequestActivityOpened + | SchemaRestPullRequestActivityUpdated +type User = SchemaRestPullRequestActivityBase["user"] + +export interface SchemaRestPullRequestActivityCommented + extends SchemaRestPullRequestActivityBase { + readonly action: "COMMENTED" + readonly comment?: SchemaRestComment + readonly commentAnchor?: SchemaRestComment["anchor"] +} + +export interface SchemaRestPullRequestActivityOpened + extends SchemaRestPullRequestActivityBase { + readonly action: "OPENED" +} + +export interface SchemaRestPullRequestActivityUpdated + extends SchemaRestPullRequestActivityBase { + readonly action: "UPDATED" + readonly addedReviewers: User[] + readonly removedReviewers: User[] +} + +export function isSchemaRestPullRequestActivityCommented( + activity: SchemaRestPullRequestActivity, +): activity is SchemaRestPullRequestActivityCommented { + return activity.action === "COMMENTED" +} + +export function isSchemaRestPullRequestActivityOpened( + activity: SchemaRestPullRequestActivity, +): activity is SchemaRestPullRequestActivityOpened { + return activity.action === "OPENED" +} + +export function isSchemaRestPullRequestActivityUpdated( + activity: SchemaRestPullRequestActivity, +): activity is SchemaRestPullRequestActivityUpdated { + return activity.action === "UPDATED" +} diff --git a/src/server/openapi/index.ts b/src/server/openapi/index.ts index 2606b7b..61adde5 100644 --- a/src/server/openapi/index.ts +++ b/src/server/openapi/index.ts @@ -1 +1 @@ -export type * from "./openapi-typescript.js" +export type * from "./openapi-typescript.ts" diff --git a/src/server/webhooks/events/event.ts b/src/server/webhooks/events/event.ts index b2bd604..041cf19 100644 --- a/src/server/webhooks/events/event.ts +++ b/src/server/webhooks/events/event.ts @@ -1,9 +1,9 @@ -import type { PrEvent } from "./pr/event.js" -import { prEventKeys } from "./pr/event.js" -import type { ProjectEvent } from "./project/event.js" -import { projectEventKeys } from "./project/event.js" -import type { RepoEvent } from "./repo/event.js" -import { repoEventKeys } from "./repo/event.js" +import type { PrEvent } from "./pr/event.ts" +import { prEventKeys } from "./pr/event.ts" +import type { ProjectEvent } from "./project/event.ts" +import { projectEventKeys } from "./project/event.ts" +import type { RepoEvent } from "./repo/event.ts" +import { repoEventKeys } from "./repo/event.ts" /** * When you have a webhook with an event, Bitbucket Data Center sends the event diff --git a/src/server/webhooks/events/index.ts b/src/server/webhooks/events/index.ts index 5fbf626..cc423e0 100644 --- a/src/server/webhooks/events/index.ts +++ b/src/server/webhooks/events/index.ts @@ -1,5 +1,5 @@ -export * from "./event.js" -export * as pr from "./pr/index.js" -export * as project from "./project/index.js" -export * as repo from "./repo/index.js" -export * from "./suggestion_state.js" +export * from "./event.ts" +export * as pr from "./pr/index.ts" +export * as project from "./project/index.ts" +export * as repo from "./repo/index.ts" +export * from "./suggestion_state.ts" diff --git a/src/server/webhooks/events/pr/comment_added.ts b/src/server/webhooks/events/pr/comment_added.ts index 39057b0..c3d8a81 100644 --- a/src/server/webhooks/events/pr/comment_added.ts +++ b/src/server/webhooks/events/pr/comment_added.ts @@ -6,8 +6,8 @@ import type { SchemaPullRequestParticipant, SchemaRepository, SchemaRestMinimalRef, -} from "../../../openapi/openapi-typescript.js" -import type { SuggestionState } from "../suggestion_state.js" +} from "../../../openapi/openapi-typescript.ts" +import type { SuggestionState } from "../suggestion_state.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/comment_deleted.ts b/src/server/webhooks/events/pr/comment_deleted.ts index 253d85f..e208af6 100644 --- a/src/server/webhooks/events/pr/comment_deleted.ts +++ b/src/server/webhooks/events/pr/comment_deleted.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/comment_edited.ts b/src/server/webhooks/events/pr/comment_edited.ts index cea9434..5fc8970 100644 --- a/src/server/webhooks/events/pr/comment_edited.ts +++ b/src/server/webhooks/events/pr/comment_edited.ts @@ -6,7 +6,7 @@ import type { SchemaPullRequestParticipant, SchemaRepository, SchemaRestMinimalRef, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/declined.ts b/src/server/webhooks/events/pr/declined.ts index cf0bd2f..4d568e8 100644 --- a/src/server/webhooks/events/pr/declined.ts +++ b/src/server/webhooks/events/pr/declined.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/deleted.ts b/src/server/webhooks/events/pr/deleted.ts index 19730b4..2be928b 100644 --- a/src/server/webhooks/events/pr/deleted.ts +++ b/src/server/webhooks/events/pr/deleted.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/event.test.ts b/src/server/webhooks/events/pr/event.test.ts index 856736b..5a22eb5 100644 --- a/src/server/webhooks/events/pr/event.test.ts +++ b/src/server/webhooks/events/pr/event.test.ts @@ -1,6 +1,6 @@ import { describe, test } from "vitest" -import type { Event } from "../event.js" -import { isPrEvent, isPrEventKey } from "./event.js" +import type { Event } from "../event.ts" +import { isPrEvent, isPrEventKey } from "./event.ts" describe("isPrEventKey", () => { test("pr:comment:added", ({ expect }) => { diff --git a/src/server/webhooks/events/pr/event.ts b/src/server/webhooks/events/pr/event.ts index 85fd09a..05a57dd 100644 --- a/src/server/webhooks/events/pr/event.ts +++ b/src/server/webhooks/events/pr/event.ts @@ -1,17 +1,17 @@ -import type { Event } from "../event.js" -import type { PRCommentAdded } from "./comment_added.js" -import type { PRCommentDeleted } from "./comment_deleted.js" -import type { PRCommentEdited } from "./comment_edited.js" -import type { PRDeclined } from "./declined.js" -import type { PRDeleted } from "./deleted.js" -import type { PRFromRefUpdated } from "./from_ref_updated.js" -import type { PRMerged } from "./merged.js" -import type { PRModified } from "./modified.js" -import type { PROpened } from "./opened.js" -import type { PRReviewerApproved } from "./reviewer_approved.js" -import type { PRReviewerChangesRequested } from "./reviewer_changes_requested.js" -import type { PRReviewerUnapproved } from "./reviewer_unapproved.js" -import type { PRReviewerUpdated } from "./reviewer_updated.js" +import type { Event } from "../event.ts" +import type { PRCommentAdded } from "./comment_added.ts" +import type { PRCommentDeleted } from "./comment_deleted.ts" +import type { PRCommentEdited } from "./comment_edited.ts" +import type { PRDeclined } from "./declined.ts" +import type { PRDeleted } from "./deleted.ts" +import type { PRFromRefUpdated } from "./from_ref_updated.ts" +import type { PRMerged } from "./merged.ts" +import type { PRModified } from "./modified.ts" +import type { PROpened } from "./opened.ts" +import type { PRReviewerApproved } from "./reviewer_approved.ts" +import type { PRReviewerChangesRequested } from "./reviewer_changes_requested.ts" +import type { PRReviewerUnapproved } from "./reviewer_unapproved.ts" +import type { PRReviewerUpdated } from "./reviewer_updated.ts" /** You can create webhooks for events that occur on a pull request. */ export type PrEvent = diff --git a/src/server/webhooks/events/pr/from_ref_updated.ts b/src/server/webhooks/events/pr/from_ref_updated.ts index 79d09f4..ab43556 100644 --- a/src/server/webhooks/events/pr/from_ref_updated.ts +++ b/src/server/webhooks/events/pr/from_ref_updated.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/index.ts b/src/server/webhooks/events/pr/index.ts index 356c0b8..200936d 100644 --- a/src/server/webhooks/events/pr/index.ts +++ b/src/server/webhooks/events/pr/index.ts @@ -1,13 +1,13 @@ -export type * as commentAdded from "./comment_added.js" -export type * as commentEdited from "./comment_edited.js" -export type * as declined from "./declined.js" -export type * as deleted from "./deleted.js" -export * from "./event.js" -export type * as fromRefUpdated from "./from_ref_updated.js" -export type * as merged from "./merged.js" -export type * as modified from "./modified.js" -export type * as opened from "./opened.js" -export type * as reviewerApproved from "./reviewer_approved.js" -export type * as reviewerChangesRequested from "./reviewer_changes_requested.js" -export type * as reviewerUnapproved from "./reviewer_unapproved.js" -export type * as reviewerUpdated from "./reviewer_updated.js" +export type * as commentAdded from "./comment_added.ts" +export type * as commentEdited from "./comment_edited.ts" +export type * as declined from "./declined.ts" +export type * as deleted from "./deleted.ts" +export * from "./event.ts" +export type * as fromRefUpdated from "./from_ref_updated.ts" +export type * as merged from "./merged.ts" +export type * as modified from "./modified.ts" +export type * as opened from "./opened.ts" +export type * as reviewerApproved from "./reviewer_approved.ts" +export type * as reviewerChangesRequested from "./reviewer_changes_requested.ts" +export type * as reviewerUnapproved from "./reviewer_unapproved.ts" +export type * as reviewerUpdated from "./reviewer_updated.ts" diff --git a/src/server/webhooks/events/pr/merged.ts b/src/server/webhooks/events/pr/merged.ts index b11a4f5..6e7766a 100644 --- a/src/server/webhooks/events/pr/merged.ts +++ b/src/server/webhooks/events/pr/merged.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/index.js" +} from "../../../openapi/index.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/modified.ts b/src/server/webhooks/events/pr/modified.ts index 7950c8a..15abd98 100644 --- a/src/server/webhooks/events/pr/modified.ts +++ b/src/server/webhooks/events/pr/modified.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/index.js" +} from "../../../openapi/index.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/opened.ts b/src/server/webhooks/events/pr/opened.ts index 88d18af..4d82cc0 100644 --- a/src/server/webhooks/events/pr/opened.ts +++ b/src/server/webhooks/events/pr/opened.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/index.js" +} from "../../../openapi/index.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/reviewer_approved.ts b/src/server/webhooks/events/pr/reviewer_approved.ts index 2c6bdeb..07e7a8c 100644 --- a/src/server/webhooks/events/pr/reviewer_approved.ts +++ b/src/server/webhooks/events/pr/reviewer_approved.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/reviewer_changes_requested.ts b/src/server/webhooks/events/pr/reviewer_changes_requested.ts index 7739b62..7c2bc85 100644 --- a/src/server/webhooks/events/pr/reviewer_changes_requested.ts +++ b/src/server/webhooks/events/pr/reviewer_changes_requested.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/reviewer_unapproved.ts b/src/server/webhooks/events/pr/reviewer_unapproved.ts index 9f96e3e..7abe51c 100644 --- a/src/server/webhooks/events/pr/reviewer_unapproved.ts +++ b/src/server/webhooks/events/pr/reviewer_unapproved.ts @@ -1,7 +1,7 @@ import type { SchemaPullRequest, SchemaRepository, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/pr/reviewer_updated.ts b/src/server/webhooks/events/pr/reviewer_updated.ts index fc4eb05..399a1fa 100644 --- a/src/server/webhooks/events/pr/reviewer_updated.ts +++ b/src/server/webhooks/events/pr/reviewer_updated.ts @@ -4,7 +4,7 @@ import type { SchemaPullRequest, SchemaRepository, SchemaRestMinimalRef, -} from "../../../openapi/openapi-typescript.js" +} from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/project/event.test.ts b/src/server/webhooks/events/project/event.test.ts index d6e6434..b6914a7 100644 --- a/src/server/webhooks/events/project/event.test.ts +++ b/src/server/webhooks/events/project/event.test.ts @@ -1,6 +1,6 @@ import { describe, test } from "vitest" -import type { Event } from "../event.js" -import { isProjectEvent, isProjectEventKey } from "./event.js" +import type { Event } from "../event.ts" +import { isProjectEvent, isProjectEventKey } from "./event.ts" describe("isProjectEventKey", () => { test("project:modified", ({ expect }) => { diff --git a/src/server/webhooks/events/project/event.ts b/src/server/webhooks/events/project/event.ts index c872d9b..eed8cb5 100644 --- a/src/server/webhooks/events/project/event.ts +++ b/src/server/webhooks/events/project/event.ts @@ -1,5 +1,5 @@ -import type { Event } from "../event.js" -import type { ProjectModified } from "./modified.js" +import type { Event } from "../event.ts" +import type { ProjectModified } from "./modified.ts" /** You can create webhooks for events that occur in a project. */ export type ProjectEvent = ProjectModified diff --git a/src/server/webhooks/events/project/index.ts b/src/server/webhooks/events/project/index.ts index 8316ef0..8a22d28 100644 --- a/src/server/webhooks/events/project/index.ts +++ b/src/server/webhooks/events/project/index.ts @@ -1,2 +1,2 @@ -export * from "./event.js" -export type * from "./modified.js" +export * from "./event.ts" +export type * from "./modified.ts" diff --git a/src/server/webhooks/events/repo/comment_added.ts b/src/server/webhooks/events/repo/comment_added.ts index 7b7c575..02c8240 100644 --- a/src/server/webhooks/events/repo/comment_added.ts +++ b/src/server/webhooks/events/repo/comment_added.ts @@ -1,4 +1,4 @@ -import type { SchemaRepository } from "../../../openapi/openapi-typescript.js" +import type { SchemaRepository } from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/repo/comment_deleted.ts b/src/server/webhooks/events/repo/comment_deleted.ts index 4d17d1f..da96f99 100644 --- a/src/server/webhooks/events/repo/comment_deleted.ts +++ b/src/server/webhooks/events/repo/comment_deleted.ts @@ -1,4 +1,4 @@ -import type { SchemaRepository } from "../../../openapi/openapi-typescript.js" +import type { SchemaRepository } from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/repo/comment_edited.ts b/src/server/webhooks/events/repo/comment_edited.ts index 62096ce..9d00c07 100644 --- a/src/server/webhooks/events/repo/comment_edited.ts +++ b/src/server/webhooks/events/repo/comment_edited.ts @@ -1,4 +1,4 @@ -import type { SchemaRepository } from "../../../openapi/openapi-typescript.js" +import type { SchemaRepository } from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/repo/event.test.ts b/src/server/webhooks/events/repo/event.test.ts index 1e410c3..0377451 100644 --- a/src/server/webhooks/events/repo/event.test.ts +++ b/src/server/webhooks/events/repo/event.test.ts @@ -1,6 +1,6 @@ import { describe, test } from "vitest" -import type { Event } from "../event.js" -import { isRepoEvent, isRepoEventKey } from "./event.js" +import type { Event } from "../event.ts" +import { isRepoEvent, isRepoEventKey } from "./event.ts" describe("isRepoEventKey", () => { test("mirror:repo_synchronized", ({ expect }) => { diff --git a/src/server/webhooks/events/repo/event.ts b/src/server/webhooks/events/repo/event.ts index 6960607..f0b5061 100644 --- a/src/server/webhooks/events/repo/event.ts +++ b/src/server/webhooks/events/repo/event.ts @@ -1,12 +1,12 @@ -import type { Event } from "../event.js" -import type { RepoCommentAdded } from "./comment_added.js" -import type { RepoCommentDeleted } from "./comment_deleted.js" -import type { RepoCommentEdited } from "./comment_edited.js" -import type { RepoForked } from "./forked.js" -import type { RepoModified } from "./modified.js" -import type { RepoRefsChanged } from "./refs_changed.js" -import type { RepoSecretDetected } from "./secret_detected.js" -import type { MirrorRepoSynchronized } from "./synchronized.js" +import type { Event } from "../event.ts" +import type { RepoCommentAdded } from "./comment_added.ts" +import type { RepoCommentDeleted } from "./comment_deleted.ts" +import type { RepoCommentEdited } from "./comment_edited.ts" +import type { RepoForked } from "./forked.ts" +import type { RepoModified } from "./modified.ts" +import type { RepoRefsChanged } from "./refs_changed.ts" +import type { RepoSecretDetected } from "./secret_detected.ts" +import type { MirrorRepoSynchronized } from "./synchronized.ts" /** You can create webhooks for events that occur in a repository. */ export type RepoEvent = diff --git a/src/server/webhooks/events/repo/forked.ts b/src/server/webhooks/events/repo/forked.ts index 567b906..8d271fc 100644 --- a/src/server/webhooks/events/repo/forked.ts +++ b/src/server/webhooks/events/repo/forked.ts @@ -1,4 +1,4 @@ -import type { SchemaRepository } from "../../../openapi/openapi-typescript.js" +import type { SchemaRepository } from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/repo/index.ts b/src/server/webhooks/events/repo/index.ts index 7547f6b..cfe3a67 100644 --- a/src/server/webhooks/events/repo/index.ts +++ b/src/server/webhooks/events/repo/index.ts @@ -1,9 +1,9 @@ -export type * as commentAdded from "./comment_added.js" -export type * as commentDeleted from "./comment_deleted.js" -export type * as commentEdited from "./comment_edited.js" -export * from "./event.js" -export type * as forked from "./forked.js" -export type * as modified from "./modified.js" -export type * as refsChanged from "./refs_changed.js" -export type * as secretDetected from "./secret_detected.js" -export type * as synchronized from "./synchronized.js" +export type * as commentAdded from "./comment_added.ts" +export type * as commentDeleted from "./comment_deleted.ts" +export type * as commentEdited from "./comment_edited.ts" +export * from "./event.ts" +export type * as forked from "./forked.ts" +export type * as modified from "./modified.ts" +export type * as refsChanged from "./refs_changed.ts" +export type * as secretDetected from "./secret_detected.ts" +export type * as synchronized from "./synchronized.ts" diff --git a/src/server/webhooks/events/repo/modified.ts b/src/server/webhooks/events/repo/modified.ts index 70bf423..cb324f2 100644 --- a/src/server/webhooks/events/repo/modified.ts +++ b/src/server/webhooks/events/repo/modified.ts @@ -1,4 +1,4 @@ -import type { SchemaRepository } from "../../../openapi/openapi-typescript.js" +import type { SchemaRepository } from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/repo/refs_changed.ts b/src/server/webhooks/events/repo/refs_changed.ts index 326dfcd..f6dcc48 100644 --- a/src/server/webhooks/events/repo/refs_changed.ts +++ b/src/server/webhooks/events/repo/refs_changed.ts @@ -1,4 +1,4 @@ -import type { SchemaRepository } from "../../../openapi/openapi-typescript.js" +import type { SchemaRepository } from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/repo/secret_detected.ts b/src/server/webhooks/events/repo/secret_detected.ts index f7a36e4..34fbc13 100644 --- a/src/server/webhooks/events/repo/secret_detected.ts +++ b/src/server/webhooks/events/repo/secret_detected.ts @@ -1,4 +1,4 @@ -import type { SchemaRepository } from "../../../openapi/openapi-typescript.js" +import type { SchemaRepository } from "../../../openapi/openapi-typescript.ts" export interface Actor { readonly active: boolean diff --git a/src/server/webhooks/events/repo/synchronized.ts b/src/server/webhooks/events/repo/synchronized.ts index 0678bd0..1e05b43 100644 --- a/src/server/webhooks/events/repo/synchronized.ts +++ b/src/server/webhooks/events/repo/synchronized.ts @@ -1,4 +1,4 @@ -import type { SchemaRepository } from "../../../openapi/openapi-typescript.js" +import type { SchemaRepository } from "../../../openapi/openapi-typescript.ts" export interface Change { readonly fromHash: string diff --git a/src/server/webhooks/headers.ts b/src/server/webhooks/headers.ts index dd1ff74..5805ade 100644 --- a/src/server/webhooks/headers.ts +++ b/src/server/webhooks/headers.ts @@ -1,5 +1,5 @@ import type { UUID } from "crypto" -import type { EventKey } from "./events/event.js" +import type { EventKey } from "./events/event.ts" /** * All event payload requests may have these HTTP headers. diff --git a/src/server/webhooks/index.ts b/src/server/webhooks/index.ts index f56de1f..3ce69e5 100644 --- a/src/server/webhooks/index.ts +++ b/src/server/webhooks/index.ts @@ -1,2 +1,2 @@ -export * from "./events/index.js" -export type * from "./headers.js" +export * from "./events/index.ts" +export type * from "./headers.ts" diff --git a/tests/cloud/client.ts b/tests/cloud/client.ts index f47280f..094d29f 100644 --- a/tests/cloud/client.ts +++ b/tests/cloud/client.ts @@ -1,10 +1,10 @@ -import { createBitbucketCloudClient } from "../../src/cloud/index.js" -import { toBase64 } from "../../src/index.js" +import { createBitbucketCloudClient } from "../../src/cloud/index.ts" +import { toBase64 } from "../../src/index.ts" import { BITBUCKET_CLOUD_APP_PASSWORD, BITBUCKET_CLOUD_URL, BITBUCKET_CLOUD_USERNAME, -} from "../env.js" +} from "../env.ts" const basic = toBase64( `${BITBUCKET_CLOUD_USERNAME}:${BITBUCKET_CLOUD_APP_PASSWORD}`, diff --git a/tests/cloud/repositories.test.ts b/tests/cloud/repositories.test.ts index 1ccf2d5..3bb3d3f 100644 --- a/tests/cloud/repositories.test.ts +++ b/tests/cloud/repositories.test.ts @@ -1,5 +1,5 @@ import { test } from "vitest" -import { client } from "./client.js" +import { client } from "./client.ts" test("GET /repositories", async ({ expect }) => { const got = await client.GET("/repositories") diff --git a/tests/server/client.ts b/tests/server/client.ts index d97526a..11c0797 100644 --- a/tests/server/client.ts +++ b/tests/server/client.ts @@ -1,5 +1,5 @@ -import { createBitbucketServerClient } from "../../src/server/index.js" -import { BITBUCKET_SERVER_TOKEN, BITBUCKET_SERVER_URL } from "../env.js" +import { createBitbucketServerClient } from "../../src/server/index.ts" +import { BITBUCKET_SERVER_TOKEN, BITBUCKET_SERVER_URL } from "../env.ts" export const client = createBitbucketServerClient({ baseUrl: BITBUCKET_SERVER_URL.toString(), diff --git a/tests/server/projects.test.ts b/tests/server/projects.test.ts index 11cad52..9b5b9f4 100644 --- a/tests/server/projects.test.ts +++ b/tests/server/projects.test.ts @@ -2,8 +2,8 @@ import { describe, test } from "vitest" import { BITBUCKET_SERVER_TEST_PROJECT_KEY, BITBUCKET_SERVER_TEST_PROJECT_NAME, -} from "../env.js" -import { client } from "./client.js" +} from "../env.ts" +import { client } from "./client.ts" describe("Projects", () => { const key = BITBUCKET_SERVER_TEST_PROJECT_KEY diff --git a/tests/server/repositories.test.ts b/tests/server/repositories.test.ts index 2da0285..d77c1df 100644 --- a/tests/server/repositories.test.ts +++ b/tests/server/repositories.test.ts @@ -2,8 +2,8 @@ import { describe, test } from "vitest" import { BITBUCKET_SERVER_TEST_PROJECT_KEY, BITBUCKET_SERVER_TEST_PROJECT_NAME, -} from "../env.js" -import { client } from "./client.js" +} from "../env.ts" +import { client } from "./client.ts" describe("Repositories", { concurrent: false, sequential: true }, () => { const projectKey = BITBUCKET_SERVER_TEST_PROJECT_KEY diff --git a/tsconfig.json b/tsconfig.json index ed504f4..5cc25bc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,7 @@ "rootDir": "./src", "moduleResolution": "NodeNext", "typeRoots": ["./node_modules/@types", "./src/types"], + "rewriteRelativeImportExtensions": true, "resolvePackageJsonExports": true, "resolvePackageJsonImports": true, "resolveJsonModule": true,