@knpkv/codecommit-core 0.1.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.
- package/dist/AwsClient/createPullRequest.d.ts +9 -0
- package/dist/AwsClient/createPullRequest.d.ts.map +1 -0
- package/dist/AwsClient/createPullRequest.js +25 -0
- package/dist/AwsClient/createPullRequest.js.map +1 -0
- package/dist/AwsClient/getCallerIdentity.d.ts +9 -0
- package/dist/AwsClient/getCallerIdentity.d.ts.map +1 -0
- package/dist/AwsClient/getCallerIdentity.js +17 -0
- package/dist/AwsClient/getCallerIdentity.js.map +1 -0
- package/dist/AwsClient/getCommentsForPullRequest.d.ts +10 -0
- package/dist/AwsClient/getCommentsForPullRequest.d.ts.map +1 -0
- package/dist/AwsClient/getCommentsForPullRequest.js +111 -0
- package/dist/AwsClient/getCommentsForPullRequest.js.map +1 -0
- package/dist/AwsClient/getPullRequest.d.ts +9 -0
- package/dist/AwsClient/getPullRequest.d.ts.map +1 -0
- package/dist/AwsClient/getPullRequest.js +74 -0
- package/dist/AwsClient/getPullRequest.js.map +1 -0
- package/dist/AwsClient/getPullRequests.d.ts +13 -0
- package/dist/AwsClient/getPullRequests.d.ts.map +1 -0
- package/dist/AwsClient/getPullRequests.js +123 -0
- package/dist/AwsClient/getPullRequests.js.map +1 -0
- package/dist/AwsClient/index.d.ts +30 -0
- package/dist/AwsClient/index.d.ts.map +1 -0
- package/dist/AwsClient/index.js +42 -0
- package/dist/AwsClient/index.js.map +1 -0
- package/dist/AwsClient/internal.d.ts +83 -0
- package/dist/AwsClient/internal.d.ts.map +1 -0
- package/dist/AwsClient/internal.js +52 -0
- package/dist/AwsClient/internal.js.map +1 -0
- package/dist/AwsClient/listBranches.d.ts +9 -0
- package/dist/AwsClient/listBranches.d.ts.map +1 -0
- package/dist/AwsClient/listBranches.js +23 -0
- package/dist/AwsClient/listBranches.js.map +1 -0
- package/dist/AwsClient/updatePullRequestDescription.d.ts +9 -0
- package/dist/AwsClient/updatePullRequestDescription.d.ts.map +1 -0
- package/dist/AwsClient/updatePullRequestDescription.js +20 -0
- package/dist/AwsClient/updatePullRequestDescription.js.map +1 -0
- package/dist/AwsClient/updatePullRequestTitle.d.ts +9 -0
- package/dist/AwsClient/updatePullRequestTitle.d.ts.map +1 -0
- package/dist/AwsClient/updatePullRequestTitle.js +20 -0
- package/dist/AwsClient/updatePullRequestTitle.js.map +1 -0
- package/dist/AwsClientConfig.d.ts +58 -0
- package/dist/AwsClientConfig.d.ts.map +1 -0
- package/dist/AwsClientConfig.js +28 -0
- package/dist/AwsClientConfig.js.map +1 -0
- package/dist/ConfigService/detectProfiles.d.ts +8 -0
- package/dist/ConfigService/detectProfiles.d.ts.map +1 -0
- package/dist/ConfigService/detectProfiles.js +21 -0
- package/dist/ConfigService/detectProfiles.js.map +1 -0
- package/dist/ConfigService/index.d.ts +21 -0
- package/dist/ConfigService/index.d.ts.map +1 -0
- package/dist/ConfigService/index.js +33 -0
- package/dist/ConfigService/index.js.map +1 -0
- package/dist/ConfigService/internal.d.ts +57 -0
- package/dist/ConfigService/internal.d.ts.map +1 -0
- package/dist/ConfigService/internal.js +55 -0
- package/dist/ConfigService/internal.js.map +1 -0
- package/dist/ConfigService/load.d.ts +18 -0
- package/dist/ConfigService/load.d.ts.map +1 -0
- package/dist/ConfigService/load.js +41 -0
- package/dist/ConfigService/load.js.map +1 -0
- package/dist/ConfigService/save.d.ts +9 -0
- package/dist/ConfigService/save.d.ts.map +1 -0
- package/dist/ConfigService/save.js +18 -0
- package/dist/ConfigService/save.js.map +1 -0
- package/dist/DateUtils.d.ts +4 -0
- package/dist/DateUtils.d.ts.map +1 -0
- package/dist/DateUtils.js +17 -0
- package/dist/DateUtils.js.map +1 -0
- package/dist/Domain.d.ts +277 -0
- package/dist/Domain.d.ts.map +1 -0
- package/dist/Domain.js +138 -0
- package/dist/Domain.js.map +1 -0
- package/dist/Errors.d.ts +135 -0
- package/dist/Errors.d.ts.map +1 -0
- package/dist/Errors.js +102 -0
- package/dist/Errors.js.map +1 -0
- package/dist/NotificationsService.d.ts +45 -0
- package/dist/NotificationsService.d.ts.map +1 -0
- package/dist/NotificationsService.js +57 -0
- package/dist/NotificationsService.js.map +1 -0
- package/dist/PRService/index.d.ts +28 -0
- package/dist/PRService/index.d.ts.map +1 -0
- package/dist/PRService/index.js +41 -0
- package/dist/PRService/index.js.map +1 -0
- package/dist/PRService/internal.d.ts +7 -0
- package/dist/PRService/internal.d.ts.map +1 -0
- package/dist/PRService/internal.js +2 -0
- package/dist/PRService/internal.js.map +1 -0
- package/dist/PRService/refresh.d.ts +10 -0
- package/dist/PRService/refresh.d.ts.map +1 -0
- package/dist/PRService/refresh.js +76 -0
- package/dist/PRService/refresh.js.map +1 -0
- package/dist/PRService/setAllAccounts.d.ts +9 -0
- package/dist/PRService/setAllAccounts.d.ts.map +1 -0
- package/dist/PRService/setAllAccounts.js +23 -0
- package/dist/PRService/setAllAccounts.js.map +1 -0
- package/dist/PRService/toggleAccount.d.ts +9 -0
- package/dist/PRService/toggleAccount.d.ts.map +1 -0
- package/dist/PRService/toggleAccount.js +29 -0
- package/dist/PRService/toggleAccount.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/package.json +42 -0
- package/src/index.ts +27 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
import type { Path } from "@effect/platform";
|
|
5
|
+
import { FileSystem } from "@effect/platform";
|
|
6
|
+
import { Effect } from "effect";
|
|
7
|
+
import { ConfigError, ConfigParseError } from "../Errors.js";
|
|
8
|
+
import type { ProfileDetectionError } from "../Errors.js";
|
|
9
|
+
import { ConfigPaths, type DetectedProfile } from "./internal.js";
|
|
10
|
+
export declare const makeLoad: (detectProfiles: Effect.Effect<ReadonlyArray<DetectedProfile>, ProfileDetectionError, FileSystem.FileSystem | Path.Path | ConfigPaths>) => Effect.Effect<{
|
|
11
|
+
readonly accounts: readonly {
|
|
12
|
+
readonly profile: string & import("effect/Brand").Brand<"AwsProfileName">;
|
|
13
|
+
readonly regions: readonly (string & import("effect/Brand").Brand<"AwsRegion">)[];
|
|
14
|
+
readonly enabled: boolean;
|
|
15
|
+
}[];
|
|
16
|
+
readonly autoDetect: boolean;
|
|
17
|
+
}, ConfigError | ConfigParseError, ConfigPaths | Path.Path | FileSystem.FileSystem>;
|
|
18
|
+
//# sourceMappingURL=load.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../src/ConfigService/load.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AACzD,OAAO,EAAE,WAAW,EAAE,KAAK,eAAe,EAAa,MAAM,eAAe,CAAA;AAE5E,eAAO,MAAM,QAAQ,GACnB,gBAAgB,MAAM,CAAC,MAAM,CAC3B,aAAa,CAAC,eAAe,CAAC,EAC9B,qBAAqB,EACrB,UAAU,CAAC,UAAU,GAAG,IAAI,CAAC,IAAI,GAAG,WAAW,CAChD;;;;;;;mFAqD6C,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { FileSystem } from "@effect/platform";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
import { ConfigError, ConfigParseError } from "../Errors.js";
|
|
4
|
+
import { ConfigPaths, TuiConfig } from "./internal.js";
|
|
5
|
+
export const makeLoad = (detectProfiles) => Effect.gen(function* () {
|
|
6
|
+
const fs = yield* FileSystem.FileSystem;
|
|
7
|
+
const paths = yield* ConfigPaths;
|
|
8
|
+
const configPath = yield* paths.configPath;
|
|
9
|
+
const exists = yield* fs.exists(configPath).pipe(Effect.mapError((e) => new ConfigError({ message: "FS Error", cause: e })));
|
|
10
|
+
if (!exists) {
|
|
11
|
+
const detected = yield* detectProfiles.pipe(Effect.catchAll(() => Effect.succeed([])));
|
|
12
|
+
if (detected.length > 0) {
|
|
13
|
+
return {
|
|
14
|
+
accounts: detected.map((p) => ({
|
|
15
|
+
profile: p.name,
|
|
16
|
+
regions: p.region ? [p.region] : [],
|
|
17
|
+
enabled: true
|
|
18
|
+
})),
|
|
19
|
+
autoDetect: true
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
return { accounts: [], autoDetect: true };
|
|
23
|
+
}
|
|
24
|
+
const content = yield* fs.readFileString(configPath).pipe(Effect.mapError((e) => new ConfigError({ message: "Failed to read config file", cause: e })));
|
|
25
|
+
const config = yield* Schema.decodeUnknown(Schema.parseJson(TuiConfig))(content).pipe(Effect.mapError((cause) => new ConfigParseError({ path: configPath, cause })));
|
|
26
|
+
if (config.autoDetect && config.accounts.length === 0) {
|
|
27
|
+
const detected = yield* detectProfiles.pipe(Effect.catchAll(() => Effect.succeed([])));
|
|
28
|
+
if (detected.length > 0) {
|
|
29
|
+
return {
|
|
30
|
+
...config,
|
|
31
|
+
accounts: detected.map((p) => ({
|
|
32
|
+
profile: p.name,
|
|
33
|
+
regions: p.region ? [p.region] : [],
|
|
34
|
+
enabled: true
|
|
35
|
+
}))
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return config;
|
|
40
|
+
}).pipe(Effect.withSpan("ConfigService.load"));
|
|
41
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../src/ConfigService/load.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAA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AAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE;oBACnC,OAAO,EAAE,IAAI;iBACd,CAAC,CAAC;aACJ,CAAA;QACH,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
import { FileSystem, Path } from "@effect/platform";
|
|
5
|
+
import { Effect } from "effect";
|
|
6
|
+
import { ConfigError } from "../Errors.js";
|
|
7
|
+
import { ConfigPaths, type TuiConfig } from "./internal.js";
|
|
8
|
+
export declare const save: (config: TuiConfig) => Effect.Effect<void, ConfigError, ConfigPaths | Path.Path | FileSystem.FileSystem>;
|
|
9
|
+
//# sourceMappingURL=save.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save.d.ts","sourceRoot":"","sources":["../../src/ConfigService/save.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,eAAe,CAAA;AAE3D,eAAO,MAAM,IAAI,GAAI,QAAQ,SAAS,sFAcU,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
import { FileSystem, Path } from "@effect/platform";
|
|
5
|
+
import { Effect } from "effect";
|
|
6
|
+
import { ConfigError } from "../Errors.js";
|
|
7
|
+
import { ConfigPaths } from "./internal.js";
|
|
8
|
+
export const save = (config) => Effect.gen(function* () {
|
|
9
|
+
const fs = yield* FileSystem.FileSystem;
|
|
10
|
+
const path = yield* Path.Path;
|
|
11
|
+
const paths = yield* ConfigPaths;
|
|
12
|
+
const configPath = yield* paths.configPath;
|
|
13
|
+
const configDir = path.dirname(configPath);
|
|
14
|
+
yield* fs.makeDirectory(configDir, { recursive: true }).pipe(Effect.mapError((e) => new ConfigError({ message: "Failed to create config directory", cause: e })));
|
|
15
|
+
const content = JSON.stringify(config, null, 2);
|
|
16
|
+
yield* fs.writeFileString(configPath, content).pipe(Effect.mapError((e) => new ConfigError({ message: "Failed to save config", cause: e })));
|
|
17
|
+
}).pipe(Effect.withSpan("ConfigService.save"));
|
|
18
|
+
//# sourceMappingURL=save.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"save.js","sourceRoot":"","sources":["../../src/ConfigService/save.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,OAAO,EAAE,WAAW,EAAkB,MAAM,eAAe,CAAA;AAE3D,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,MAAiB,EAAE,EAAE,CACxC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,EAAE,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,UAAU,CAAA;IACvC,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAA;IAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,WAAW,CAAA;IAChC,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,UAAU,CAAA;IAC1C,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;IAC1C,KAAK,CAAC,CAAC,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAC1D,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,EAAE,OAAO,EAAE,mCAAmC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CACpG,CAAA;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;IAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,CACjD,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,WAAW,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CACxF,CAAA;AACH,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateUtils.d.ts","sourceRoot":"","sources":["../src/DateUtils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,GAAI,MAAM,IAAI,KAAG,MAKvC,CAAA;AAED,eAAO,MAAM,cAAc,GAAI,MAAM,IAAI,KAAG,MAI3C,CAAA;AAED,eAAO,MAAM,kBAAkB,GAAI,MAAM,IAAI,EAAE,KAAK,IAAI,KAAG,MAS1D,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Match } from "effect";
|
|
2
|
+
export const formatDate = (date) => {
|
|
3
|
+
const d = date.getDate().toString().padStart(2, "0");
|
|
4
|
+
const m = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
5
|
+
const y = date.getFullYear();
|
|
6
|
+
return `${d}.${m}.${y}`;
|
|
7
|
+
};
|
|
8
|
+
export const formatDateTime = (date) => {
|
|
9
|
+
const dStr = formatDate(date);
|
|
10
|
+
const tStr = date.toLocaleTimeString("en-GB", { hour12: false });
|
|
11
|
+
return `${dStr} ${tStr}`;
|
|
12
|
+
};
|
|
13
|
+
export const formatRelativeTime = (date, now) => {
|
|
14
|
+
const seconds = Math.max(0, Math.floor((now.getTime() - date.getTime()) / 1000));
|
|
15
|
+
return Match.value(seconds).pipe(Match.when((s) => s < 60, (s) => `Updated ${s}s ago`), Match.when((s) => s < 3600, (s) => `Updated ${Math.floor(s / 60)}m ago`), Match.when((s) => s < 86400, (s) => `Updated ${Math.floor(s / 3600)}h ago`), Match.orElse(() => `Updated on ${formatDate(date)}`));
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=DateUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateUtils.js","sourceRoot":"","sources":["../src/DateUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9B,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAU,EAAU,EAAE;IAC/C,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IACpD,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;IAC3D,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;IAC5B,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAA;AACzB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,IAAU,EAAU,EAAE;IACnD,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,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|
+
* branded types for compile-time ID safety, and `Schema.Literal`
|
|
6
|
+
* for type-safe enumerations.
|
|
7
|
+
*
|
|
8
|
+
* @category Domain
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { Schema } from "effect";
|
|
12
|
+
/**
|
|
13
|
+
* Branded pull request identifier.
|
|
14
|
+
*
|
|
15
|
+
* @category Domain
|
|
16
|
+
*/
|
|
17
|
+
export declare const PullRequestId: Schema.brand<typeof Schema.String, "PullRequestId">;
|
|
18
|
+
export type PullRequestId = typeof PullRequestId.Type;
|
|
19
|
+
/**
|
|
20
|
+
* Branded repository name.
|
|
21
|
+
*
|
|
22
|
+
* @category Domain
|
|
23
|
+
*/
|
|
24
|
+
export declare const RepositoryName: Schema.brand<typeof Schema.String, "RepositoryName">;
|
|
25
|
+
export type RepositoryName = typeof RepositoryName.Type;
|
|
26
|
+
/**
|
|
27
|
+
* Branded AWS profile name.
|
|
28
|
+
*
|
|
29
|
+
* @category Domain
|
|
30
|
+
*/
|
|
31
|
+
export declare const AwsProfileName: Schema.brand<typeof Schema.String, "AwsProfileName">;
|
|
32
|
+
export type AwsProfileName = typeof AwsProfileName.Type;
|
|
33
|
+
/**
|
|
34
|
+
* Branded AWS region name.
|
|
35
|
+
*
|
|
36
|
+
* @category Domain
|
|
37
|
+
*/
|
|
38
|
+
export declare const AwsRegion: Schema.brand<typeof Schema.String, "AwsRegion">;
|
|
39
|
+
export type AwsRegion = typeof AwsRegion.Type;
|
|
40
|
+
/**
|
|
41
|
+
* Branded comment identifier.
|
|
42
|
+
*
|
|
43
|
+
* @category Domain
|
|
44
|
+
*/
|
|
45
|
+
export declare const CommentId: Schema.brand<typeof Schema.String, "CommentId">;
|
|
46
|
+
export type CommentId = typeof CommentId.Type;
|
|
47
|
+
/**
|
|
48
|
+
* Pull request status.
|
|
49
|
+
*
|
|
50
|
+
* @category Domain
|
|
51
|
+
*/
|
|
52
|
+
export declare const PullRequestStatus: Schema.Literal<["OPEN", "CLOSED"]>;
|
|
53
|
+
export type PullRequestStatus = typeof PullRequestStatus.Type;
|
|
54
|
+
/**
|
|
55
|
+
* Notification severity type.
|
|
56
|
+
*
|
|
57
|
+
* @category Domain
|
|
58
|
+
*/
|
|
59
|
+
export declare const NotificationType: Schema.Literal<["error", "info", "warning", "success"]>;
|
|
60
|
+
export type NotificationType = typeof NotificationType.Type;
|
|
61
|
+
/**
|
|
62
|
+
* Application loading status.
|
|
63
|
+
*
|
|
64
|
+
* @category Domain
|
|
65
|
+
*/
|
|
66
|
+
export declare const AppStatus: Schema.Literal<["idle", "loading", "error"]>;
|
|
67
|
+
export type AppStatus = typeof AppStatus.Type;
|
|
68
|
+
declare const Account_base: Schema.Class<Account, {
|
|
69
|
+
id: Schema.brand<typeof Schema.String, "AwsProfileName">;
|
|
70
|
+
region: Schema.brand<typeof Schema.String, "AwsRegion">;
|
|
71
|
+
}, Schema.Struct.Encoded<{
|
|
72
|
+
id: Schema.brand<typeof Schema.String, "AwsProfileName">;
|
|
73
|
+
region: Schema.brand<typeof Schema.String, "AwsRegion">;
|
|
74
|
+
}>, never, {
|
|
75
|
+
readonly id: string & import("effect/Brand").Brand<"AwsProfileName">;
|
|
76
|
+
} & {
|
|
77
|
+
readonly region: string & import("effect/Brand").Brand<"AwsRegion">;
|
|
78
|
+
}, {}, {}>;
|
|
79
|
+
/**
|
|
80
|
+
* AWS account reference (profile + region).
|
|
81
|
+
*
|
|
82
|
+
* @category Domain
|
|
83
|
+
*/
|
|
84
|
+
export declare class Account extends Account_base {
|
|
85
|
+
}
|
|
86
|
+
declare const PullRequest_base: Schema.Class<PullRequest, {
|
|
87
|
+
id: Schema.brand<typeof Schema.String, "PullRequestId">;
|
|
88
|
+
title: typeof Schema.String;
|
|
89
|
+
description: Schema.optional<typeof Schema.String>;
|
|
90
|
+
author: typeof Schema.String;
|
|
91
|
+
repositoryName: Schema.brand<typeof Schema.String, "RepositoryName">;
|
|
92
|
+
creationDate: typeof Schema.DateFromSelf;
|
|
93
|
+
lastModifiedDate: typeof Schema.DateFromSelf;
|
|
94
|
+
link: typeof Schema.String;
|
|
95
|
+
account: typeof Account;
|
|
96
|
+
status: Schema.Literal<["OPEN", "CLOSED"]>;
|
|
97
|
+
sourceBranch: typeof Schema.String;
|
|
98
|
+
destinationBranch: typeof Schema.String;
|
|
99
|
+
isMergeable: typeof Schema.Boolean;
|
|
100
|
+
isApproved: typeof Schema.Boolean;
|
|
101
|
+
}, Schema.Struct.Encoded<{
|
|
102
|
+
id: Schema.brand<typeof Schema.String, "PullRequestId">;
|
|
103
|
+
title: typeof Schema.String;
|
|
104
|
+
description: Schema.optional<typeof Schema.String>;
|
|
105
|
+
author: typeof Schema.String;
|
|
106
|
+
repositoryName: Schema.brand<typeof Schema.String, "RepositoryName">;
|
|
107
|
+
creationDate: typeof Schema.DateFromSelf;
|
|
108
|
+
lastModifiedDate: typeof Schema.DateFromSelf;
|
|
109
|
+
link: typeof Schema.String;
|
|
110
|
+
account: typeof Account;
|
|
111
|
+
status: Schema.Literal<["OPEN", "CLOSED"]>;
|
|
112
|
+
sourceBranch: typeof Schema.String;
|
|
113
|
+
destinationBranch: typeof Schema.String;
|
|
114
|
+
isMergeable: typeof Schema.Boolean;
|
|
115
|
+
isApproved: typeof Schema.Boolean;
|
|
116
|
+
}>, never, {
|
|
117
|
+
readonly link: string;
|
|
118
|
+
} & {
|
|
119
|
+
readonly id: string & import("effect/Brand").Brand<"PullRequestId">;
|
|
120
|
+
} & {
|
|
121
|
+
readonly title: string;
|
|
122
|
+
} & {
|
|
123
|
+
readonly author: string;
|
|
124
|
+
} & {
|
|
125
|
+
readonly repositoryName: string & import("effect/Brand").Brand<"RepositoryName">;
|
|
126
|
+
} & {
|
|
127
|
+
readonly creationDate: Date;
|
|
128
|
+
} & {
|
|
129
|
+
readonly lastModifiedDate: Date;
|
|
130
|
+
} & {
|
|
131
|
+
readonly account: Account;
|
|
132
|
+
} & {
|
|
133
|
+
readonly status: "OPEN" | "CLOSED";
|
|
134
|
+
} & {
|
|
135
|
+
readonly sourceBranch: string;
|
|
136
|
+
} & {
|
|
137
|
+
readonly destinationBranch: string;
|
|
138
|
+
} & {
|
|
139
|
+
readonly isMergeable: boolean;
|
|
140
|
+
} & {
|
|
141
|
+
readonly isApproved: boolean;
|
|
142
|
+
} & {
|
|
143
|
+
readonly description?: string | undefined;
|
|
144
|
+
}, {}, {}>;
|
|
145
|
+
/**
|
|
146
|
+
* CodeCommit pull request.
|
|
147
|
+
*
|
|
148
|
+
* @category Domain
|
|
149
|
+
*/
|
|
150
|
+
export declare class PullRequest extends PullRequest_base {
|
|
151
|
+
/**
|
|
152
|
+
* AWS Console URL for this pull request.
|
|
153
|
+
*/
|
|
154
|
+
get consoleUrl(): string;
|
|
155
|
+
}
|
|
156
|
+
declare const PRComment_base: Schema.Class<PRComment, {
|
|
157
|
+
id: Schema.brand<typeof Schema.String, "CommentId">;
|
|
158
|
+
content: typeof Schema.String;
|
|
159
|
+
author: typeof Schema.String;
|
|
160
|
+
creationDate: typeof Schema.DateFromSelf;
|
|
161
|
+
inReplyTo: Schema.optional<Schema.brand<typeof Schema.String, "CommentId">>;
|
|
162
|
+
deleted: typeof Schema.Boolean;
|
|
163
|
+
filePath: Schema.optional<typeof Schema.String>;
|
|
164
|
+
lineNumber: Schema.optional<typeof Schema.Number>;
|
|
165
|
+
}, Schema.Struct.Encoded<{
|
|
166
|
+
id: Schema.brand<typeof Schema.String, "CommentId">;
|
|
167
|
+
content: typeof Schema.String;
|
|
168
|
+
author: typeof Schema.String;
|
|
169
|
+
creationDate: typeof Schema.DateFromSelf;
|
|
170
|
+
inReplyTo: Schema.optional<Schema.brand<typeof Schema.String, "CommentId">>;
|
|
171
|
+
deleted: typeof Schema.Boolean;
|
|
172
|
+
filePath: Schema.optional<typeof Schema.String>;
|
|
173
|
+
lineNumber: Schema.optional<typeof Schema.Number>;
|
|
174
|
+
}>, never, {
|
|
175
|
+
readonly id: string & import("effect/Brand").Brand<"CommentId">;
|
|
176
|
+
} & {
|
|
177
|
+
readonly author: string;
|
|
178
|
+
} & {
|
|
179
|
+
readonly creationDate: Date;
|
|
180
|
+
} & {
|
|
181
|
+
readonly content: string;
|
|
182
|
+
} & {
|
|
183
|
+
readonly deleted: boolean;
|
|
184
|
+
} & {
|
|
185
|
+
readonly inReplyTo?: (string & import("effect/Brand").Brand<"CommentId">) | undefined;
|
|
186
|
+
} & {
|
|
187
|
+
readonly filePath?: string | undefined;
|
|
188
|
+
} & {
|
|
189
|
+
readonly lineNumber?: number | undefined;
|
|
190
|
+
}, {}, {}>;
|
|
191
|
+
/**
|
|
192
|
+
* Comment on a pull request.
|
|
193
|
+
*
|
|
194
|
+
* @category Domain
|
|
195
|
+
*/
|
|
196
|
+
export declare class PRComment extends PRComment_base {
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Recursive comment thread (root comment + nested replies).
|
|
200
|
+
*
|
|
201
|
+
* @category Domain
|
|
202
|
+
*/
|
|
203
|
+
export interface CommentThread {
|
|
204
|
+
readonly root: PRComment;
|
|
205
|
+
readonly replies: ReadonlyArray<CommentThread>;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Comments grouped by file location in a pull request.
|
|
209
|
+
*
|
|
210
|
+
* @category Domain
|
|
211
|
+
*/
|
|
212
|
+
export interface PRCommentLocation {
|
|
213
|
+
readonly filePath?: string;
|
|
214
|
+
readonly beforeCommitId?: string;
|
|
215
|
+
readonly afterCommitId?: string;
|
|
216
|
+
readonly comments: ReadonlyArray<CommentThread>;
|
|
217
|
+
}
|
|
218
|
+
declare const NotificationItem_base: Schema.Class<NotificationItem, {
|
|
219
|
+
type: Schema.Literal<["error", "info", "warning", "success"]>;
|
|
220
|
+
title: typeof Schema.String;
|
|
221
|
+
message: typeof Schema.String;
|
|
222
|
+
timestamp: typeof Schema.DateFromSelf;
|
|
223
|
+
}, Schema.Struct.Encoded<{
|
|
224
|
+
type: Schema.Literal<["error", "info", "warning", "success"]>;
|
|
225
|
+
title: typeof Schema.String;
|
|
226
|
+
message: typeof Schema.String;
|
|
227
|
+
timestamp: typeof Schema.DateFromSelf;
|
|
228
|
+
}>, never, {
|
|
229
|
+
readonly title: string;
|
|
230
|
+
} & {
|
|
231
|
+
readonly type: "error" | "info" | "warning" | "success";
|
|
232
|
+
} & {
|
|
233
|
+
readonly message: string;
|
|
234
|
+
} & {
|
|
235
|
+
readonly timestamp: Date;
|
|
236
|
+
}, {}, {}>;
|
|
237
|
+
/**
|
|
238
|
+
* Notification item with timestamp.
|
|
239
|
+
*
|
|
240
|
+
* @category Domain
|
|
241
|
+
*/
|
|
242
|
+
export declare class NotificationItem extends NotificationItem_base {
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Notification state container.
|
|
246
|
+
*
|
|
247
|
+
* @category Domain
|
|
248
|
+
*/
|
|
249
|
+
export interface NotificationsState {
|
|
250
|
+
readonly items: ReadonlyArray<NotificationItem>;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Account configuration in app state.
|
|
254
|
+
*
|
|
255
|
+
* @category Domain
|
|
256
|
+
*/
|
|
257
|
+
export interface AccountState {
|
|
258
|
+
readonly profile: AwsProfileName;
|
|
259
|
+
readonly region: AwsRegion;
|
|
260
|
+
readonly enabled: boolean;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Application state.
|
|
264
|
+
*
|
|
265
|
+
* @category Domain
|
|
266
|
+
*/
|
|
267
|
+
export interface AppState {
|
|
268
|
+
readonly pullRequests: ReadonlyArray<PullRequest>;
|
|
269
|
+
readonly accounts: ReadonlyArray<AccountState>;
|
|
270
|
+
readonly status: AppStatus;
|
|
271
|
+
readonly statusDetail?: string | undefined;
|
|
272
|
+
readonly error?: string | undefined;
|
|
273
|
+
readonly lastUpdated?: Date;
|
|
274
|
+
readonly currentUser?: string;
|
|
275
|
+
}
|
|
276
|
+
export {};
|
|
277
|
+
//# sourceMappingURL=Domain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
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C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACnC,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAA;IAC3B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAA;CAC9B"}
|
package/dist/Domain.js
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Domain models for CodeCommit operations.
|
|
3
|
+
*
|
|
4
|
+
* Uses `Schema.Class` for rich models with computed properties,
|
|
5
|
+
* branded types for compile-time ID safety, and `Schema.Literal`
|
|
6
|
+
* for type-safe enumerations.
|
|
7
|
+
*
|
|
8
|
+
* @category Domain
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { Schema } from "effect";
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Branded Types
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
/**
|
|
16
|
+
* Branded pull request identifier.
|
|
17
|
+
*
|
|
18
|
+
* @category Domain
|
|
19
|
+
*/
|
|
20
|
+
export const PullRequestId = Schema.String.pipe(Schema.brand("PullRequestId"));
|
|
21
|
+
/**
|
|
22
|
+
* Branded repository name.
|
|
23
|
+
*
|
|
24
|
+
* @category Domain
|
|
25
|
+
*/
|
|
26
|
+
export const RepositoryName = Schema.String.pipe(Schema.brand("RepositoryName"));
|
|
27
|
+
/**
|
|
28
|
+
* Branded AWS profile name.
|
|
29
|
+
*
|
|
30
|
+
* @category Domain
|
|
31
|
+
*/
|
|
32
|
+
export const AwsProfileName = Schema.String.pipe(Schema.brand("AwsProfileName"));
|
|
33
|
+
/**
|
|
34
|
+
* Branded AWS region name.
|
|
35
|
+
*
|
|
36
|
+
* @category Domain
|
|
37
|
+
*/
|
|
38
|
+
export const AwsRegion = Schema.String.pipe(Schema.brand("AwsRegion"));
|
|
39
|
+
/**
|
|
40
|
+
* Branded comment identifier.
|
|
41
|
+
*
|
|
42
|
+
* @category Domain
|
|
43
|
+
*/
|
|
44
|
+
export const CommentId = Schema.String.pipe(Schema.brand("CommentId"));
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// Enumerations
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
/**
|
|
49
|
+
* Pull request status.
|
|
50
|
+
*
|
|
51
|
+
* @category Domain
|
|
52
|
+
*/
|
|
53
|
+
export const PullRequestStatus = Schema.Literal("OPEN", "CLOSED");
|
|
54
|
+
/**
|
|
55
|
+
* Notification severity type.
|
|
56
|
+
*
|
|
57
|
+
* @category Domain
|
|
58
|
+
*/
|
|
59
|
+
export const NotificationType = Schema.Literal("error", "info", "warning", "success");
|
|
60
|
+
/**
|
|
61
|
+
* Application loading status.
|
|
62
|
+
*
|
|
63
|
+
* @category Domain
|
|
64
|
+
*/
|
|
65
|
+
export const AppStatus = Schema.Literal("idle", "loading", "error");
|
|
66
|
+
// ---------------------------------------------------------------------------
|
|
67
|
+
// Domain Models
|
|
68
|
+
// ---------------------------------------------------------------------------
|
|
69
|
+
/**
|
|
70
|
+
* AWS account reference (profile + region).
|
|
71
|
+
*
|
|
72
|
+
* @category Domain
|
|
73
|
+
*/
|
|
74
|
+
export class Account extends Schema.Class("Account")({
|
|
75
|
+
id: AwsProfileName,
|
|
76
|
+
region: AwsRegion
|
|
77
|
+
}) {
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* CodeCommit pull request.
|
|
81
|
+
*
|
|
82
|
+
* @category Domain
|
|
83
|
+
*/
|
|
84
|
+
export class PullRequest extends Schema.Class("PullRequest")({
|
|
85
|
+
id: PullRequestId,
|
|
86
|
+
title: Schema.String,
|
|
87
|
+
description: Schema.optional(Schema.String),
|
|
88
|
+
author: Schema.String,
|
|
89
|
+
repositoryName: RepositoryName,
|
|
90
|
+
creationDate: Schema.DateFromSelf,
|
|
91
|
+
lastModifiedDate: Schema.DateFromSelf,
|
|
92
|
+
link: Schema.String,
|
|
93
|
+
account: Account,
|
|
94
|
+
status: PullRequestStatus,
|
|
95
|
+
sourceBranch: Schema.String,
|
|
96
|
+
destinationBranch: Schema.String,
|
|
97
|
+
isMergeable: Schema.Boolean,
|
|
98
|
+
isApproved: Schema.Boolean
|
|
99
|
+
}) {
|
|
100
|
+
/**
|
|
101
|
+
* AWS Console URL for this pull request.
|
|
102
|
+
*/
|
|
103
|
+
get consoleUrl() {
|
|
104
|
+
return `https://${this.account.region}.console.aws.amazon.com/codesuite/codecommit/repositories/${this.repositoryName}/pull-requests/${this.id}?region=${this.account.region}`;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Comment on a pull request.
|
|
109
|
+
*
|
|
110
|
+
* @category Domain
|
|
111
|
+
*/
|
|
112
|
+
export class PRComment extends Schema.Class("PRComment")({
|
|
113
|
+
id: CommentId,
|
|
114
|
+
content: Schema.String,
|
|
115
|
+
author: Schema.String,
|
|
116
|
+
creationDate: Schema.DateFromSelf,
|
|
117
|
+
inReplyTo: Schema.optional(CommentId),
|
|
118
|
+
deleted: Schema.Boolean,
|
|
119
|
+
filePath: Schema.optional(Schema.String),
|
|
120
|
+
lineNumber: Schema.optional(Schema.Number)
|
|
121
|
+
}) {
|
|
122
|
+
}
|
|
123
|
+
// ---------------------------------------------------------------------------
|
|
124
|
+
// State Models
|
|
125
|
+
// ---------------------------------------------------------------------------
|
|
126
|
+
/**
|
|
127
|
+
* Notification item with timestamp.
|
|
128
|
+
*
|
|
129
|
+
* @category Domain
|
|
130
|
+
*/
|
|
131
|
+
export class NotificationItem extends Schema.Class("NotificationItem")({
|
|
132
|
+
type: NotificationType,
|
|
133
|
+
title: Schema.String,
|
|
134
|
+
message: Schema.String,
|
|
135
|
+
timestamp: Schema.DateFromSelf
|
|
136
|
+
}) {
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=Domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Domain.js","sourceRoot":"","sources":["../src/Domain.ts"],"names":[],"mappings":"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