@knpkv/codecommit-core 0.2.0 → 0.4.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/README.md +66 -0
- package/dist/AwsClient/createPullRequest.d.ts +1 -6
- package/dist/AwsClient/createPullRequest.d.ts.map +1 -1
- package/dist/AwsClient/createPullRequest.js +3 -11
- package/dist/AwsClient/createPullRequest.js.map +1 -1
- package/dist/AwsClient/getCallerIdentity.d.ts +5 -6
- package/dist/AwsClient/getCallerIdentity.d.ts.map +1 -1
- package/dist/AwsClient/getCallerIdentity.js +7 -12
- package/dist/AwsClient/getCallerIdentity.js.map +1 -1
- package/dist/AwsClient/getCommentsForPullRequest.d.ts +1 -6
- package/dist/AwsClient/getCommentsForPullRequest.d.ts.map +1 -1
- package/dist/AwsClient/getCommentsForPullRequest.js +9 -16
- package/dist/AwsClient/getCommentsForPullRequest.js.map +1 -1
- package/dist/AwsClient/getPullRequest.d.ts +2 -7
- package/dist/AwsClient/getPullRequest.d.ts.map +1 -1
- package/dist/AwsClient/getPullRequest.js +13 -26
- package/dist/AwsClient/getPullRequest.js.map +1 -1
- package/dist/AwsClient/getPullRequests.d.ts.map +1 -1
- package/dist/AwsClient/getPullRequests.js +16 -13
- package/dist/AwsClient/getPullRequests.js.map +1 -1
- package/dist/AwsClient/index.d.ts +3 -2
- package/dist/AwsClient/index.d.ts.map +1 -1
- package/dist/AwsClient/index.js.map +1 -1
- package/dist/AwsClient/internal.d.ts +47 -11
- package/dist/AwsClient/internal.d.ts.map +1 -1
- package/dist/AwsClient/internal.js +38 -9
- package/dist/AwsClient/internal.js.map +1 -1
- package/dist/AwsClient/listBranches.d.ts +1 -6
- package/dist/AwsClient/listBranches.d.ts.map +1 -1
- package/dist/AwsClient/listBranches.js +3 -11
- package/dist/AwsClient/listBranches.js.map +1 -1
- package/dist/AwsClient/updatePullRequestDescription.d.ts +1 -6
- package/dist/AwsClient/updatePullRequestDescription.d.ts.map +1 -1
- package/dist/AwsClient/updatePullRequestDescription.js +3 -11
- package/dist/AwsClient/updatePullRequestDescription.js.map +1 -1
- package/dist/AwsClient/updatePullRequestTitle.d.ts +1 -6
- package/dist/AwsClient/updatePullRequestTitle.d.ts.map +1 -1
- package/dist/AwsClient/updatePullRequestTitle.js +3 -11
- package/dist/AwsClient/updatePullRequestTitle.js.map +1 -1
- package/dist/CacheService/CacheError.d.ts +21 -0
- package/dist/CacheService/CacheError.d.ts.map +1 -0
- package/dist/CacheService/CacheError.js +17 -0
- package/dist/CacheService/CacheError.js.map +1 -0
- package/dist/CacheService/Database.d.ts +13 -0
- package/dist/CacheService/Database.d.ts.map +1 -0
- package/dist/CacheService/Database.js +34 -0
- package/dist/CacheService/Database.js.map +1 -0
- package/dist/CacheService/EventsHub.d.ts +163 -0
- package/dist/CacheService/EventsHub.d.ts.map +1 -0
- package/dist/CacheService/EventsHub.js +22 -0
- package/dist/CacheService/EventsHub.js.map +1 -0
- package/dist/CacheService/diff.d.ts +28 -0
- package/dist/CacheService/diff.d.ts.map +1 -0
- package/dist/CacheService/diff.js +102 -0
- package/dist/CacheService/diff.js.map +1 -0
- package/dist/CacheService/index.d.ts +17 -0
- package/dist/CacheService/index.d.ts.map +1 -0
- package/dist/CacheService/index.js +15 -0
- package/dist/CacheService/index.js.map +1 -0
- package/dist/CacheService/migrations/0001_initial.d.ts +5 -0
- package/dist/CacheService/migrations/0001_initial.d.ts.map +1 -0
- package/dist/CacheService/migrations/0001_initial.js +72 -0
- package/dist/CacheService/migrations/0001_initial.js.map +1 -0
- package/dist/CacheService/migrations/0002_indexes.d.ts +5 -0
- package/dist/CacheService/migrations/0002_indexes.d.ts.map +1 -0
- package/dist/CacheService/migrations/0002_indexes.js +7 -0
- package/dist/CacheService/migrations/0002_indexes.js.map +1 -0
- package/dist/CacheService/migrations/0003_add_health_score.d.ts +5 -0
- package/dist/CacheService/migrations/0003_add_health_score.d.ts.map +1 -0
- package/dist/CacheService/migrations/0003_add_health_score.js +4 -0
- package/dist/CacheService/migrations/0003_add_health_score.js.map +1 -0
- package/dist/CacheService/migrations/0004_unify_notifications.d.ts +5 -0
- package/dist/CacheService/migrations/0004_unify_notifications.d.ts.map +1 -0
- package/dist/CacheService/migrations/0004_unify_notifications.js +7 -0
- package/dist/CacheService/migrations/0004_unify_notifications.js.map +1 -0
- package/dist/CacheService/repos/CommentRepo.d.ts +16 -0
- package/dist/CacheService/repos/CommentRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/CommentRepo.js +42 -0
- package/dist/CacheService/repos/CommentRepo.js.map +1 -0
- package/dist/CacheService/repos/NotificationRepo.d.ts +48 -0
- package/dist/CacheService/repos/NotificationRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/NotificationRepo.js +128 -0
- package/dist/CacheService/repos/NotificationRepo.js.map +1 -0
- package/dist/CacheService/repos/PullRequestRepo.d.ts +112 -0
- package/dist/CacheService/repos/PullRequestRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/PullRequestRepo.js +146 -0
- package/dist/CacheService/repos/PullRequestRepo.js.map +1 -0
- package/dist/CacheService/repos/SubscriptionRepo.d.ts +20 -0
- package/dist/CacheService/repos/SubscriptionRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/SubscriptionRepo.js +49 -0
- package/dist/CacheService/repos/SubscriptionRepo.js.map +1 -0
- package/dist/CacheService/repos/SyncMetadataRepo.d.ts +14 -0
- package/dist/CacheService/repos/SyncMetadataRepo.d.ts.map +1 -0
- package/dist/CacheService/repos/SyncMetadataRepo.js +36 -0
- package/dist/CacheService/repos/SyncMetadataRepo.js.map +1 -0
- package/dist/ConfigService/backup.d.ts +9 -0
- package/dist/ConfigService/backup.d.ts.map +1 -0
- package/dist/ConfigService/backup.js +22 -0
- package/dist/ConfigService/backup.js.map +1 -0
- package/dist/ConfigService/detectProfiles.d.ts +1 -1
- package/dist/ConfigService/index.d.ts +8 -1
- package/dist/ConfigService/index.d.ts.map +1 -1
- package/dist/ConfigService/index.js +13 -2
- package/dist/ConfigService/index.js.map +1 -1
- package/dist/ConfigService/internal.d.ts +6 -0
- package/dist/ConfigService/internal.d.ts.map +1 -1
- package/dist/ConfigService/internal.js +3 -1
- package/dist/ConfigService/internal.js.map +1 -1
- package/dist/ConfigService/load.d.ts +3 -1
- package/dist/ConfigService/load.d.ts.map +1 -1
- package/dist/ConfigService/load.js +6 -4
- package/dist/ConfigService/load.js.map +1 -1
- package/dist/ConfigService/reset.d.ts +10 -0
- package/dist/ConfigService/reset.d.ts.map +1 -0
- package/dist/ConfigService/reset.js +28 -0
- package/dist/ConfigService/reset.js.map +1 -0
- package/dist/ConfigService/save.d.ts +1 -1
- package/dist/ConfigService/validate.d.ts +31 -0
- package/dist/ConfigService/validate.d.ts.map +1 -0
- package/dist/ConfigService/validate.js +33 -0
- package/dist/ConfigService/validate.js.map +1 -0
- package/dist/DateUtils.d.ts +1 -1
- package/dist/DateUtils.d.ts.map +1 -1
- package/dist/DateUtils.js +2 -2
- package/dist/DateUtils.js.map +1 -1
- package/dist/Domain.d.ts +185 -8
- package/dist/Domain.d.ts.map +1 -1
- package/dist/Domain.js +25 -6
- package/dist/Domain.js.map +1 -1
- package/dist/HealthScore.d.ts.map +1 -1
- package/dist/HealthScore.js +1 -3
- package/dist/HealthScore.js.map +1 -1
- package/dist/PRService/index.d.ts +46 -18
- package/dist/PRService/index.d.ts.map +1 -1
- package/dist/PRService/index.js +58 -27
- package/dist/PRService/index.js.map +1 -1
- package/dist/PRService/internal.d.ts +86 -1
- package/dist/PRService/internal.d.ts.map +1 -1
- package/dist/PRService/internal.js +106 -1
- package/dist/PRService/internal.js.map +1 -1
- package/dist/PRService/refresh.d.ts +10 -4
- package/dist/PRService/refresh.d.ts.map +1 -1
- package/dist/PRService/refresh.js +30 -88
- package/dist/PRService/refresh.js.map +1 -1
- package/dist/PRService/refreshEnrich.d.ts +15 -0
- package/dist/PRService/refreshEnrich.d.ts.map +1 -0
- package/dist/PRService/refreshEnrich.js +72 -0
- package/dist/PRService/refreshEnrich.js.map +1 -0
- package/dist/PRService/refreshFetch.d.ts +20 -0
- package/dist/PRService/refreshFetch.d.ts.map +1 -0
- package/dist/PRService/refreshFetch.js +78 -0
- package/dist/PRService/refreshFetch.js.map +1 -0
- package/dist/PRService/refreshResolve.d.ts +29 -0
- package/dist/PRService/refreshResolve.d.ts.map +1 -0
- package/dist/PRService/refreshResolve.js +84 -0
- package/dist/PRService/refreshResolve.js.map +1 -0
- package/dist/PRService/refreshScore.d.ts +9 -0
- package/dist/PRService/refreshScore.d.ts.map +1 -0
- package/dist/PRService/refreshScore.js +24 -0
- package/dist/PRService/refreshScore.js.map +1 -0
- package/dist/PRService/refreshSinglePR.d.ts +13 -0
- package/dist/PRService/refreshSinglePR.d.ts.map +1 -0
- package/dist/PRService/refreshSinglePR.js +102 -0
- package/dist/PRService/refreshSinglePR.js.map +1 -0
- package/dist/PRService/setAllAccounts.d.ts +1 -3
- package/dist/PRService/setAllAccounts.d.ts.map +1 -1
- package/dist/PRService/setAllAccounts.js +2 -2
- package/dist/PRService/setAllAccounts.js.map +1 -1
- package/dist/PRService/toggleAccount.d.ts +1 -3
- package/dist/PRService/toggleAccount.d.ts.map +1 -1
- package/dist/PRService/toggleAccount.js +2 -2
- package/dist/PRService/toggleAccount.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -1
- package/dist/NotificationsService.d.ts +0 -45
- package/dist/NotificationsService.d.ts.map +0 -1
- package/dist/NotificationsService.js +0 -57
- package/dist/NotificationsService.js.map +0 -1
package/dist/Domain.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @category Domain
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
-
import { Schema } from "effect";
|
|
11
|
+
import { Data, Schema } from "effect";
|
|
12
12
|
/**
|
|
13
13
|
* Branded pull request identifier.
|
|
14
14
|
*
|
|
@@ -49,7 +49,7 @@ export type CommentId = typeof CommentId.Type;
|
|
|
49
49
|
*
|
|
50
50
|
* @category Domain
|
|
51
51
|
*/
|
|
52
|
-
export declare const PullRequestStatus: Schema.Literal<["OPEN", "CLOSED"]>;
|
|
52
|
+
export declare const PullRequestStatus: Schema.Literal<["OPEN", "CLOSED", "MERGED"]>;
|
|
53
53
|
export type PullRequestStatus = typeof PullRequestStatus.Type;
|
|
54
54
|
/**
|
|
55
55
|
* Notification severity type.
|
|
@@ -66,15 +66,19 @@ export type NotificationType = typeof NotificationType.Type;
|
|
|
66
66
|
export declare const AppStatus: Schema.Literal<["idle", "loading", "error"]>;
|
|
67
67
|
export type AppStatus = typeof AppStatus.Type;
|
|
68
68
|
declare const Account_base: Schema.Class<Account, {
|
|
69
|
-
|
|
69
|
+
profile: Schema.brand<typeof Schema.String, "AwsProfileName">;
|
|
70
70
|
region: Schema.brand<typeof Schema.String, "AwsRegion">;
|
|
71
|
+
awsAccountId: Schema.optional<typeof Schema.String>;
|
|
71
72
|
}, Schema.Struct.Encoded<{
|
|
72
|
-
|
|
73
|
+
profile: Schema.brand<typeof Schema.String, "AwsProfileName">;
|
|
73
74
|
region: Schema.brand<typeof Schema.String, "AwsRegion">;
|
|
75
|
+
awsAccountId: Schema.optional<typeof Schema.String>;
|
|
74
76
|
}>, never, {
|
|
75
|
-
readonly
|
|
77
|
+
readonly profile: string & import("effect/Brand").Brand<"AwsProfileName">;
|
|
76
78
|
} & {
|
|
77
79
|
readonly region: string & import("effect/Brand").Brand<"AwsRegion">;
|
|
80
|
+
} & {
|
|
81
|
+
readonly awsAccountId?: string | undefined;
|
|
78
82
|
}, {}, {}>;
|
|
79
83
|
/**
|
|
80
84
|
* AWS account reference (profile + region).
|
|
@@ -93,12 +97,14 @@ declare const PullRequest_base: Schema.Class<PullRequest, {
|
|
|
93
97
|
lastModifiedDate: typeof Schema.DateFromSelf;
|
|
94
98
|
link: typeof Schema.String;
|
|
95
99
|
account: typeof Account;
|
|
96
|
-
status: Schema.Literal<["OPEN", "CLOSED"]>;
|
|
100
|
+
status: Schema.Literal<["OPEN", "CLOSED", "MERGED"]>;
|
|
97
101
|
sourceBranch: typeof Schema.String;
|
|
98
102
|
destinationBranch: typeof Schema.String;
|
|
99
103
|
isMergeable: typeof Schema.Boolean;
|
|
100
104
|
isApproved: typeof Schema.Boolean;
|
|
101
105
|
commentCount: Schema.optional<typeof Schema.Number>;
|
|
106
|
+
healthScore: Schema.optional<typeof Schema.Number>;
|
|
107
|
+
fetchedAt: Schema.optional<typeof Schema.DateFromSelf>;
|
|
102
108
|
}, Schema.Struct.Encoded<{
|
|
103
109
|
id: Schema.brand<typeof Schema.String, "PullRequestId">;
|
|
104
110
|
title: typeof Schema.String;
|
|
@@ -109,12 +115,14 @@ declare const PullRequest_base: Schema.Class<PullRequest, {
|
|
|
109
115
|
lastModifiedDate: typeof Schema.DateFromSelf;
|
|
110
116
|
link: typeof Schema.String;
|
|
111
117
|
account: typeof Account;
|
|
112
|
-
status: Schema.Literal<["OPEN", "CLOSED"]>;
|
|
118
|
+
status: Schema.Literal<["OPEN", "CLOSED", "MERGED"]>;
|
|
113
119
|
sourceBranch: typeof Schema.String;
|
|
114
120
|
destinationBranch: typeof Schema.String;
|
|
115
121
|
isMergeable: typeof Schema.Boolean;
|
|
116
122
|
isApproved: typeof Schema.Boolean;
|
|
117
123
|
commentCount: Schema.optional<typeof Schema.Number>;
|
|
124
|
+
healthScore: Schema.optional<typeof Schema.Number>;
|
|
125
|
+
fetchedAt: Schema.optional<typeof Schema.DateFromSelf>;
|
|
118
126
|
}>, never, {
|
|
119
127
|
readonly link: string;
|
|
120
128
|
} & {
|
|
@@ -132,7 +140,7 @@ declare const PullRequest_base: Schema.Class<PullRequest, {
|
|
|
132
140
|
} & {
|
|
133
141
|
readonly account: Account;
|
|
134
142
|
} & {
|
|
135
|
-
readonly status: "OPEN" | "CLOSED";
|
|
143
|
+
readonly status: "OPEN" | "CLOSED" | "MERGED";
|
|
136
144
|
} & {
|
|
137
145
|
readonly sourceBranch: string;
|
|
138
146
|
} & {
|
|
@@ -145,6 +153,10 @@ declare const PullRequest_base: Schema.Class<PullRequest, {
|
|
|
145
153
|
readonly description?: string | undefined;
|
|
146
154
|
} & {
|
|
147
155
|
readonly commentCount?: number | undefined;
|
|
156
|
+
} & {
|
|
157
|
+
readonly healthScore?: number | undefined;
|
|
158
|
+
} & {
|
|
159
|
+
readonly fetchedAt?: Date | undefined;
|
|
148
160
|
}, {}, {}>;
|
|
149
161
|
/**
|
|
150
162
|
* CodeCommit pull request.
|
|
@@ -251,17 +263,182 @@ export declare const PRCommentLocationJson: Schema.Struct<{
|
|
|
251
263
|
* @category Domain
|
|
252
264
|
*/
|
|
253
265
|
export declare const encodeCommentLocations: (locations: ReadonlyArray<PRCommentLocation>) => ReadonlyArray<typeof PRCommentLocationJson.Type>;
|
|
266
|
+
export declare const PersistentNotificationType: Schema.Literal<["new_comment", "comment_edited", "comment_deleted", "approval_changed", "merge_changed", "title_changed", "description_changed", "pr_merged", "pr_closed", "pr_reopened"]>;
|
|
267
|
+
export type PersistentNotificationType = typeof PersistentNotificationType.Type;
|
|
268
|
+
declare const PersistentNotification_base: Schema.Class<PersistentNotification, {
|
|
269
|
+
id: typeof Schema.Number;
|
|
270
|
+
pullRequestId: Schema.brand<typeof Schema.String, "PullRequestId">;
|
|
271
|
+
awsAccountId: typeof Schema.String;
|
|
272
|
+
type: Schema.Literal<["new_comment", "comment_edited", "comment_deleted", "approval_changed", "merge_changed", "title_changed", "description_changed", "pr_merged", "pr_closed", "pr_reopened"]>;
|
|
273
|
+
message: typeof Schema.String;
|
|
274
|
+
createdAt: typeof Schema.DateFromSelf;
|
|
275
|
+
read: typeof Schema.Boolean;
|
|
276
|
+
}, Schema.Struct.Encoded<{
|
|
277
|
+
id: typeof Schema.Number;
|
|
278
|
+
pullRequestId: Schema.brand<typeof Schema.String, "PullRequestId">;
|
|
279
|
+
awsAccountId: typeof Schema.String;
|
|
280
|
+
type: Schema.Literal<["new_comment", "comment_edited", "comment_deleted", "approval_changed", "merge_changed", "title_changed", "description_changed", "pr_merged", "pr_closed", "pr_reopened"]>;
|
|
281
|
+
message: typeof Schema.String;
|
|
282
|
+
createdAt: typeof Schema.DateFromSelf;
|
|
283
|
+
read: typeof Schema.Boolean;
|
|
284
|
+
}>, never, {
|
|
285
|
+
readonly awsAccountId: string;
|
|
286
|
+
} & {
|
|
287
|
+
readonly id: number;
|
|
288
|
+
} & {
|
|
289
|
+
readonly pullRequestId: string & import("effect/Brand").Brand<"PullRequestId">;
|
|
290
|
+
} & {
|
|
291
|
+
readonly type: "new_comment" | "comment_edited" | "comment_deleted" | "approval_changed" | "merge_changed" | "title_changed" | "description_changed" | "pr_merged" | "pr_closed" | "pr_reopened";
|
|
292
|
+
} & {
|
|
293
|
+
readonly message: string;
|
|
294
|
+
} & {
|
|
295
|
+
readonly createdAt: Date;
|
|
296
|
+
} & {
|
|
297
|
+
readonly read: boolean;
|
|
298
|
+
}, {}, {}>;
|
|
299
|
+
export declare class PersistentNotification extends PersistentNotification_base {
|
|
300
|
+
}
|
|
301
|
+
export type PRSyncStatus = Data.TaggedEnum<{
|
|
302
|
+
readonly Cached: {
|
|
303
|
+
readonly fetchedAt: Date;
|
|
304
|
+
};
|
|
305
|
+
readonly Syncing: {
|
|
306
|
+
readonly fetchedAt: Date;
|
|
307
|
+
};
|
|
308
|
+
readonly UpToDate: {
|
|
309
|
+
readonly fetchedAt: Date;
|
|
310
|
+
};
|
|
311
|
+
readonly Failed: {
|
|
312
|
+
readonly fetchedAt: Date;
|
|
313
|
+
readonly error: string;
|
|
314
|
+
};
|
|
315
|
+
}>;
|
|
316
|
+
export declare const PRSyncStatus: {
|
|
317
|
+
readonly Cached: Data.Case.Constructor<{
|
|
318
|
+
readonly _tag: "Cached";
|
|
319
|
+
readonly fetchedAt: Date;
|
|
320
|
+
}, "_tag">;
|
|
321
|
+
readonly Syncing: Data.Case.Constructor<{
|
|
322
|
+
readonly _tag: "Syncing";
|
|
323
|
+
readonly fetchedAt: Date;
|
|
324
|
+
}, "_tag">;
|
|
325
|
+
readonly UpToDate: Data.Case.Constructor<{
|
|
326
|
+
readonly _tag: "UpToDate";
|
|
327
|
+
readonly fetchedAt: Date;
|
|
328
|
+
}, "_tag">;
|
|
329
|
+
readonly Failed: Data.Case.Constructor<{
|
|
330
|
+
readonly _tag: "Failed";
|
|
331
|
+
readonly fetchedAt: Date;
|
|
332
|
+
readonly error: string;
|
|
333
|
+
}, "_tag">;
|
|
334
|
+
readonly $is: <Tag extends "Cached" | "Syncing" | "UpToDate" | "Failed">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
335
|
+
readonly _tag: "Cached";
|
|
336
|
+
readonly fetchedAt: Date;
|
|
337
|
+
}, {
|
|
338
|
+
readonly _tag: Tag;
|
|
339
|
+
}> | Extract<{
|
|
340
|
+
readonly _tag: "Syncing";
|
|
341
|
+
readonly fetchedAt: Date;
|
|
342
|
+
}, {
|
|
343
|
+
readonly _tag: Tag;
|
|
344
|
+
}> | Extract<{
|
|
345
|
+
readonly _tag: "UpToDate";
|
|
346
|
+
readonly fetchedAt: Date;
|
|
347
|
+
}, {
|
|
348
|
+
readonly _tag: Tag;
|
|
349
|
+
}> | Extract<{
|
|
350
|
+
readonly _tag: "Failed";
|
|
351
|
+
readonly fetchedAt: Date;
|
|
352
|
+
readonly error: string;
|
|
353
|
+
}, {
|
|
354
|
+
readonly _tag: Tag;
|
|
355
|
+
}>;
|
|
356
|
+
readonly $match: {
|
|
357
|
+
<const Cases extends {
|
|
358
|
+
readonly Cached: (args: {
|
|
359
|
+
readonly _tag: "Cached";
|
|
360
|
+
readonly fetchedAt: Date;
|
|
361
|
+
}) => any;
|
|
362
|
+
readonly Syncing: (args: {
|
|
363
|
+
readonly _tag: "Syncing";
|
|
364
|
+
readonly fetchedAt: Date;
|
|
365
|
+
}) => any;
|
|
366
|
+
readonly UpToDate: (args: {
|
|
367
|
+
readonly _tag: "UpToDate";
|
|
368
|
+
readonly fetchedAt: Date;
|
|
369
|
+
}) => any;
|
|
370
|
+
readonly Failed: (args: {
|
|
371
|
+
readonly _tag: "Failed";
|
|
372
|
+
readonly fetchedAt: Date;
|
|
373
|
+
readonly error: string;
|
|
374
|
+
}) => any;
|
|
375
|
+
}>(cases: Cases & { [K in Exclude<keyof Cases, "Cached" | "Syncing" | "UpToDate" | "Failed">]: never; }): (value: {
|
|
376
|
+
readonly _tag: "Cached";
|
|
377
|
+
readonly fetchedAt: Date;
|
|
378
|
+
} | {
|
|
379
|
+
readonly _tag: "Syncing";
|
|
380
|
+
readonly fetchedAt: Date;
|
|
381
|
+
} | {
|
|
382
|
+
readonly _tag: "UpToDate";
|
|
383
|
+
readonly fetchedAt: Date;
|
|
384
|
+
} | {
|
|
385
|
+
readonly _tag: "Failed";
|
|
386
|
+
readonly fetchedAt: Date;
|
|
387
|
+
readonly error: string;
|
|
388
|
+
}) => import("effect/Unify").Unify<ReturnType<Cases["Cached" | "Syncing" | "UpToDate" | "Failed"]>>;
|
|
389
|
+
<const Cases extends {
|
|
390
|
+
readonly Cached: (args: {
|
|
391
|
+
readonly _tag: "Cached";
|
|
392
|
+
readonly fetchedAt: Date;
|
|
393
|
+
}) => any;
|
|
394
|
+
readonly Syncing: (args: {
|
|
395
|
+
readonly _tag: "Syncing";
|
|
396
|
+
readonly fetchedAt: Date;
|
|
397
|
+
}) => any;
|
|
398
|
+
readonly UpToDate: (args: {
|
|
399
|
+
readonly _tag: "UpToDate";
|
|
400
|
+
readonly fetchedAt: Date;
|
|
401
|
+
}) => any;
|
|
402
|
+
readonly Failed: (args: {
|
|
403
|
+
readonly _tag: "Failed";
|
|
404
|
+
readonly fetchedAt: Date;
|
|
405
|
+
readonly error: string;
|
|
406
|
+
}) => any;
|
|
407
|
+
}>(value: {
|
|
408
|
+
readonly _tag: "Cached";
|
|
409
|
+
readonly fetchedAt: Date;
|
|
410
|
+
} | {
|
|
411
|
+
readonly _tag: "Syncing";
|
|
412
|
+
readonly fetchedAt: Date;
|
|
413
|
+
} | {
|
|
414
|
+
readonly _tag: "UpToDate";
|
|
415
|
+
readonly fetchedAt: Date;
|
|
416
|
+
} | {
|
|
417
|
+
readonly _tag: "Failed";
|
|
418
|
+
readonly fetchedAt: Date;
|
|
419
|
+
readonly error: string;
|
|
420
|
+
}, cases: Cases & { [K in Exclude<keyof Cases, "Cached" | "Syncing" | "UpToDate" | "Failed">]: never; }): import("effect/Unify").Unify<ReturnType<Cases["Cached" | "Syncing" | "UpToDate" | "Failed"]>>;
|
|
421
|
+
};
|
|
422
|
+
};
|
|
254
423
|
declare const NotificationItem_base: Schema.Class<NotificationItem, {
|
|
255
424
|
type: Schema.Literal<["error", "info", "warning", "success"]>;
|
|
256
425
|
title: typeof Schema.String;
|
|
257
426
|
message: typeof Schema.String;
|
|
258
427
|
timestamp: typeof Schema.DateFromSelf;
|
|
428
|
+
profile: Schema.optionalWith<typeof Schema.String, {
|
|
429
|
+
exact: true;
|
|
430
|
+
}>;
|
|
259
431
|
}, Schema.Struct.Encoded<{
|
|
260
432
|
type: Schema.Literal<["error", "info", "warning", "success"]>;
|
|
261
433
|
title: typeof Schema.String;
|
|
262
434
|
message: typeof Schema.String;
|
|
263
435
|
timestamp: typeof Schema.DateFromSelf;
|
|
436
|
+
profile: Schema.optionalWith<typeof Schema.String, {
|
|
437
|
+
exact: true;
|
|
438
|
+
}>;
|
|
264
439
|
}>, never, {
|
|
440
|
+
readonly profile?: string;
|
|
441
|
+
} & {
|
|
265
442
|
readonly title: string;
|
|
266
443
|
} & {
|
|
267
444
|
readonly type: "error" | "info" | "warning" | "success";
|
package/dist/Domain.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Domain.d.ts","sourceRoot":"","sources":["../src/Domain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"Domain.d.ts","sourceRoot":"","s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,SAAS,CAAA;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,WAAW,CAAC,CAAA;IACjD,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,CAAA;IAC9C,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAA;IAC1B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1C,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
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @category Domain
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
|
-
import { Schema } from "effect";
|
|
11
|
+
import { Data, Schema } from "effect";
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
13
13
|
// Branded Types
|
|
14
14
|
// ---------------------------------------------------------------------------
|
|
@@ -50,7 +50,7 @@ export const CommentId = Schema.String.pipe(Schema.brand("CommentId"));
|
|
|
50
50
|
*
|
|
51
51
|
* @category Domain
|
|
52
52
|
*/
|
|
53
|
-
export const PullRequestStatus = Schema.Literal("OPEN", "CLOSED");
|
|
53
|
+
export const PullRequestStatus = Schema.Literal("OPEN", "CLOSED", "MERGED");
|
|
54
54
|
/**
|
|
55
55
|
* Notification severity type.
|
|
56
56
|
*
|
|
@@ -72,8 +72,9 @@ export const AppStatus = Schema.Literal("idle", "loading", "error");
|
|
|
72
72
|
* @category Domain
|
|
73
73
|
*/
|
|
74
74
|
export class Account extends Schema.Class("Account")({
|
|
75
|
-
|
|
76
|
-
region: AwsRegion
|
|
75
|
+
profile: AwsProfileName,
|
|
76
|
+
region: AwsRegion,
|
|
77
|
+
awsAccountId: Schema.optional(Schema.String)
|
|
77
78
|
}) {
|
|
78
79
|
}
|
|
79
80
|
/**
|
|
@@ -96,7 +97,9 @@ export class PullRequest extends Schema.Class("PullRequest")({
|
|
|
96
97
|
destinationBranch: Schema.String,
|
|
97
98
|
isMergeable: Schema.Boolean,
|
|
98
99
|
isApproved: Schema.Boolean,
|
|
99
|
-
commentCount: Schema.optional(Schema.Number)
|
|
100
|
+
commentCount: Schema.optional(Schema.Number),
|
|
101
|
+
healthScore: Schema.optional(Schema.Number),
|
|
102
|
+
fetchedAt: Schema.optional(Schema.DateFromSelf)
|
|
100
103
|
}) {
|
|
101
104
|
/**
|
|
102
105
|
* AWS Console URL for this pull request.
|
|
@@ -177,6 +180,21 @@ export const encodeCommentLocations = (locations) => locations.map((loc) => ({
|
|
|
177
180
|
comments: loc.comments.map(serializeThread)
|
|
178
181
|
}));
|
|
179
182
|
// ---------------------------------------------------------------------------
|
|
183
|
+
// Persistent Notification Types
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
export const PersistentNotificationType = Schema.Literal("new_comment", "comment_edited", "comment_deleted", "approval_changed", "merge_changed", "title_changed", "description_changed", "pr_merged", "pr_closed", "pr_reopened");
|
|
186
|
+
export class PersistentNotification extends Schema.Class("PersistentNotification")({
|
|
187
|
+
id: Schema.Number,
|
|
188
|
+
pullRequestId: PullRequestId,
|
|
189
|
+
awsAccountId: Schema.String,
|
|
190
|
+
type: PersistentNotificationType,
|
|
191
|
+
message: Schema.String,
|
|
192
|
+
createdAt: Schema.DateFromSelf,
|
|
193
|
+
read: Schema.Boolean
|
|
194
|
+
}) {
|
|
195
|
+
}
|
|
196
|
+
export const PRSyncStatus = Data.taggedEnum();
|
|
197
|
+
// ---------------------------------------------------------------------------
|
|
180
198
|
// State Models
|
|
181
199
|
// ---------------------------------------------------------------------------
|
|
182
200
|
/**
|
|
@@ -188,7 +206,8 @@ export class NotificationItem extends Schema.Class("NotificationItem")({
|
|
|
188
206
|
type: NotificationType,
|
|
189
207
|
title: Schema.String,
|
|
190
208
|
message: Schema.String,
|
|
191
|
-
timestamp: Schema.DateFromSelf
|
|
209
|
+
timestamp: Schema.DateFromSelf,
|
|
210
|
+
profile: Schema.optionalWith(Schema.String, { exact: true })
|
|
192
211
|
}) {
|
|
193
212
|
}
|
|
194
213
|
//# sourceMappingURL=Domain.js.map
|
package/dist/Domain.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Domain.js","sourceRoot":"","sources":["../src/Domain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"Domain.js","sourceRoot":"","sources":["../src/Domain.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAErC,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,CAAA;AAG9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAGhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAGhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;AAGtE;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM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;AAEhE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,oBAAoB,CAAC,CAAA;IACvD,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAA;CACxD;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;AAYxD,eAAO,MAAM,oBAAoB,GAAI,IAAI,WAAW,EAAE,KAAK,IAAI,KAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAkG1F,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,IAAI,WAAW,EAAE,KAAK,IAAI,EAAE,UAAU,MAAM,KAAG,MACqB,CAAA;AAEjG,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,eAK1C,CAAA"}
|
package/dist/HealthScore.js
CHANGED
|
@@ -5,11 +5,9 @@ const clamp = (min, max, value) => Math.min(max, Math.max(min, value));
|
|
|
5
5
|
const daysBetween = (from, to) => Math.max(0, (to.getTime() - from.getTime()) / MS_PER_DAY);
|
|
6
6
|
const hasScope = (title) => /^\w+(\([^)]+\))?:/.test(title) || /^[A-Z]+-\d+:/.test(title);
|
|
7
7
|
export const calculateHealthScore = (pr, now) => {
|
|
8
|
-
if (pr.commentCount === undefined)
|
|
9
|
-
return Option.none();
|
|
10
8
|
const daysSinceLastActivity = daysBetween(pr.lastModifiedDate, now);
|
|
11
9
|
const daysSinceCreation = daysBetween(pr.creationDate, now);
|
|
12
|
-
const commentCount = pr.commentCount;
|
|
10
|
+
const commentCount = pr.commentCount ?? 0;
|
|
13
11
|
const scopeDetected = hasScope(pr.title);
|
|
14
12
|
const hasDescription = !!pr.description && pr.description.trim().length > 0;
|
|
15
13
|
const timeDecay = -(daysSinceLastActivity * 1.0);
|
package/dist/HealthScore.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HealthScore.js","sourceRoot":"","sources":["../src/HealthScore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AA0BtC,MAAM,UAAU,GAAG,UAAU,CAAA;AAE7B,MAAM,MAAM,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,CAAA;AAE7D,MAAM,KAAK,GAAG,CAAC,GAAW,EAAE,GAAW,EAAE,KAAa,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;AAEtG,MAAM,WAAW,GAAG,CAAC,IAAU,EAAE,EAAQ,EAAU,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC,CAAA;AAE/G,MAAM,QAAQ,GAAG,CAAC,KAAa,EAAW,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAE1G,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAe,EAAE,GAAS,EAA8B,EAAE;IAC7F,
|
|
1
|
+
{"version":3,"file":"HealthScore.js","sourceRoot":"","sources":["../src/HealthScore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAA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
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
import { Effect, Layer, Option, SubscriptionRef } from "effect";
|
|
8
|
+
import { AwsClient } from "../AwsClient/index.js";
|
|
9
|
+
import { EventsHub } from "../CacheService/EventsHub.js";
|
|
10
|
+
import { CommentRepo } from "../CacheService/repos/CommentRepo.js";
|
|
11
|
+
import { NotificationRepo } from "../CacheService/repos/NotificationRepo.js";
|
|
12
|
+
import type { PaginatedNotifications } from "../CacheService/repos/NotificationRepo.js";
|
|
13
|
+
import type { SearchResult } from "../CacheService/repos/PullRequestRepo.js";
|
|
14
|
+
import { PullRequestRepo } from "../CacheService/repos/PullRequestRepo.js";
|
|
15
|
+
import { SubscriptionRepo } from "../CacheService/repos/SubscriptionRepo.js";
|
|
16
|
+
import { SyncMetadataRepo } from "../CacheService/repos/SyncMetadataRepo.js";
|
|
17
|
+
import { ConfigService } from "../ConfigService/index.js";
|
|
18
|
+
import type { AppState, AwsProfileName, PRCommentLocation, PullRequestId } from "../Domain.js";
|
|
19
|
+
export type { SearchResult } from "../CacheService/repos/PullRequestRepo.js";
|
|
20
|
+
export { CachedPRToPullRequest, decodeCachedPR, PullRequestToUpsertInput } from "./internal.js";
|
|
21
|
+
declare const PRService_base: Effect.Service.Class<PRService, "@knpkv/codecommit-core/PRService", {
|
|
22
|
+
readonly effect: Effect.Effect<{
|
|
23
|
+
state: SubscriptionRef.SubscriptionRef<AppState>;
|
|
24
|
+
refresh: Effect.Effect<void, never, never>;
|
|
25
|
+
toggleAccount: (profile: AwsProfileName) => Effect.Effect<void, never, never>;
|
|
26
|
+
setAllAccounts: (enabled: boolean, profiles?: Array<AwsProfileName>) => Effect.Effect<void, never, never>;
|
|
27
|
+
searchPullRequests: (query: string, opts?: {
|
|
28
|
+
readonly limit?: number;
|
|
29
|
+
readonly offset?: number;
|
|
30
|
+
}) => Effect.Effect<SearchResult, never, never>;
|
|
31
|
+
subscribe: (awsAccountId: string, prId: PullRequestId) => Effect.Effect<void, never, never>;
|
|
32
|
+
unsubscribe: (awsAccountId: string, prId: PullRequestId) => Effect.Effect<void, never, never>;
|
|
33
|
+
getSubscriptions: () => Effect.Effect<readonly {
|
|
34
|
+
readonly awsAccountId: string;
|
|
35
|
+
readonly pullRequestId: string;
|
|
36
|
+
}[] | readonly {
|
|
37
|
+
awsAccountId: string;
|
|
38
|
+
pullRequestId: string;
|
|
39
|
+
}[], never, never>;
|
|
40
|
+
isSubscribed: (awsAccountId: string, prId: PullRequestId) => Effect.Effect<boolean, never, never>;
|
|
41
|
+
getPersistentNotifications: (opts?: {
|
|
42
|
+
readonly unreadOnly?: boolean;
|
|
43
|
+
readonly limit?: number;
|
|
44
|
+
readonly cursor?: number;
|
|
45
|
+
}) => Effect.Effect<PaginatedNotifications, never, never>;
|
|
46
|
+
markNotificationRead: (id: number) => Effect.Effect<void, never, never>;
|
|
47
|
+
markAllNotificationsRead: () => Effect.Effect<void, never, never>;
|
|
48
|
+
getUnreadNotificationCount: () => Effect.Effect<number, never, never>;
|
|
49
|
+
getCachedComments: (awsAccountId: string, prId: PullRequestId) => Effect.Effect<Option.Option<readonly PRCommentLocation[]>, never, never>;
|
|
50
|
+
refreshSinglePR: (awsAccountId: string, prId: PullRequestId) => Effect.Effect<void, never, never>;
|
|
51
|
+
}, never, AwsClient | EventsHub | CommentRepo | NotificationRepo | PullRequestRepo | SubscriptionRepo | SyncMetadataRepo | ConfigService>;
|
|
23
52
|
}>;
|
|
24
53
|
export declare class PRService extends PRService_base {
|
|
25
54
|
}
|
|
26
|
-
export declare const PRServiceLive: Layer.Layer<PRService, never,
|
|
27
|
-
export {};
|
|
55
|
+
export declare const PRServiceLive: Layer.Layer<PRService, never, AwsClient | EventsHub | CommentRepo | NotificationRepo | PullRequestRepo | SubscriptionRepo | SyncMetadataRepo | ConfigService>;
|
|
28
56
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PRService/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/PRService/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAA;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAA;AACvF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAA;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAO9F,YAAY,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;;;;;iCAgDhE,cAAc;kCACb,OAAO,aAAa,KAAK,CAAC,cAAc,CAAC;oCAI1D,MAAM,SACN;YAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE;kCAMpC,MAAM,QAAQ,aAAa;oCAEzB,MAAM,QAAQ,aAAa;;;;;0BAIgB,MAAM;2BAAiB,MAAM;;qCAEvE,MAAM,QAAQ,aAAa;4CAG/C;YAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;YAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE;mCAKlE,MAAM;;;0CAGC,MAAM,QAAQ,aAAa;wCAI7B,MAAM,QAAQ,aAAa;;;AA7EjE,qBAAa,SAAU,SAAQ,cAgF7B;CAAG;AAGL,eAAO,MAAM,aAAa,+JAAoB,CAAA"}
|
package/dist/PRService/index.js
CHANGED
|
@@ -4,38 +4,69 @@
|
|
|
4
4
|
* @category Service
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { Effect, Layer, Option, SubscriptionRef } from "effect";
|
|
8
|
+
import { AwsClient } from "../AwsClient/index.js";
|
|
9
|
+
import { EventsHub } from "../CacheService/EventsHub.js";
|
|
10
|
+
import { CommentRepo } from "../CacheService/repos/CommentRepo.js";
|
|
11
|
+
import { NotificationRepo } from "../CacheService/repos/NotificationRepo.js";
|
|
12
|
+
import { PullRequestRepo } from "../CacheService/repos/PullRequestRepo.js";
|
|
13
|
+
import { SubscriptionRepo } from "../CacheService/repos/SubscriptionRepo.js";
|
|
14
|
+
import { SyncMetadataRepo } from "../CacheService/repos/SyncMetadataRepo.js";
|
|
15
|
+
import { ConfigService } from "../ConfigService/index.js";
|
|
16
|
+
import { decodeCachedPR } from "./internal.js";
|
|
9
17
|
import { makeRefresh } from "./refresh.js";
|
|
18
|
+
import { makeRefreshSinglePR } from "./refreshSinglePR.js";
|
|
10
19
|
import { makeSetAllAccounts } from "./setAllAccounts.js";
|
|
11
20
|
import { makeToggleAccount } from "./toggleAccount.js";
|
|
21
|
+
export { CachedPRToPullRequest, decodeCachedPR, PullRequestToUpsertInput } from "./internal.js";
|
|
12
22
|
// ---------------------------------------------------------------------------
|
|
13
23
|
// Service Definition
|
|
14
24
|
// ---------------------------------------------------------------------------
|
|
15
|
-
export class PRService extends
|
|
25
|
+
export class PRService extends Effect.Service()("@knpkv/codecommit-core/PRService", {
|
|
26
|
+
effect: Effect.gen(function* () {
|
|
27
|
+
const configService = yield* ConfigService;
|
|
28
|
+
const awsClient = yield* AwsClient;
|
|
29
|
+
const prRepo = yield* PullRequestRepo;
|
|
30
|
+
const commentRepo = yield* CommentRepo;
|
|
31
|
+
const notificationRepo = yield* NotificationRepo;
|
|
32
|
+
const subscriptionRepo = yield* SubscriptionRepo;
|
|
33
|
+
const syncMetadataRepo = yield* SyncMetadataRepo;
|
|
34
|
+
const eventsHub = yield* EventsHub;
|
|
35
|
+
const depsLayer = Layer.mergeAll(Layer.succeed(ConfigService, configService), Layer.succeed(AwsClient, awsClient), Layer.succeed(PullRequestRepo, prRepo), Layer.succeed(CommentRepo, commentRepo), Layer.succeed(NotificationRepo, notificationRepo), Layer.succeed(SubscriptionRepo, subscriptionRepo), Layer.succeed(SyncMetadataRepo, syncMetadataRepo), Layer.succeed(EventsHub, eventsHub));
|
|
36
|
+
const provide = (effect) => Effect.provide(effect, depsLayer);
|
|
37
|
+
// Load cached PRs to show immediately
|
|
38
|
+
const cachedPRs = yield* prRepo.findAll().pipe(Effect.catchAll(() => Effect.succeed([])));
|
|
39
|
+
const state = yield* SubscriptionRef.make({
|
|
40
|
+
pullRequests: cachedPRs.map(decodeCachedPR),
|
|
41
|
+
accounts: [],
|
|
42
|
+
status: "idle"
|
|
43
|
+
});
|
|
44
|
+
const refreshSem = yield* Effect.makeSemaphore(1);
|
|
45
|
+
const refresh = refreshSem.withPermits(1)(provide(makeRefresh(state)));
|
|
46
|
+
const toggleAccount = makeToggleAccount(refresh);
|
|
47
|
+
const setAllAccounts = makeSetAllAccounts(refresh);
|
|
48
|
+
const refreshSinglePR = makeRefreshSinglePR(state);
|
|
49
|
+
return {
|
|
50
|
+
state,
|
|
51
|
+
refresh,
|
|
52
|
+
toggleAccount: (profile) => provide(toggleAccount(profile)),
|
|
53
|
+
setAllAccounts: (enabled, profiles) => provide(setAllAccounts(enabled, profiles)),
|
|
54
|
+
// Cache delegates – absorb CacheError at the PRService boundary
|
|
55
|
+
searchPullRequests: (query, opts) => prRepo.search(query, opts).pipe(Effect.tapError((e) => Effect.logWarning("PRService.searchPullRequests", e)), Effect.catchAll(() => Effect.succeed({ items: [], total: 0, hasMore: false }))),
|
|
56
|
+
subscribe: (awsAccountId, prId) => subscriptionRepo.subscribe(awsAccountId, prId).pipe(Effect.catchAll(() => Effect.void)),
|
|
57
|
+
unsubscribe: (awsAccountId, prId) => subscriptionRepo.unsubscribe(awsAccountId, prId).pipe(Effect.catchAll(() => Effect.void)),
|
|
58
|
+
getSubscriptions: () => subscriptionRepo.findAll().pipe(Effect.catchAll(() => Effect.succeed([]))),
|
|
59
|
+
isSubscribed: (awsAccountId, prId) => subscriptionRepo.isSubscribed(awsAccountId, prId).pipe(Effect.catchAll(() => Effect.succeed(false))),
|
|
60
|
+
getPersistentNotifications: (opts) => notificationRepo.findAll(opts).pipe(Effect.catchAll(() => Effect.succeed({ items: [] }))),
|
|
61
|
+
markNotificationRead: (id) => notificationRepo.markRead(id).pipe(Effect.catchAll(() => Effect.void)),
|
|
62
|
+
markAllNotificationsRead: () => notificationRepo.markAllRead().pipe(Effect.catchAll(() => Effect.void)),
|
|
63
|
+
getUnreadNotificationCount: () => notificationRepo.unreadCount().pipe(Effect.catchAll(() => Effect.succeed(0))),
|
|
64
|
+
getCachedComments: (awsAccountId, prId) => commentRepo.find(awsAccountId, prId).pipe(Effect.catchAll(() => Effect.succeed(Option.none()))),
|
|
65
|
+
refreshSinglePR: (awsAccountId, prId) => provide(refreshSinglePR(awsAccountId, prId))
|
|
66
|
+
};
|
|
67
|
+
})
|
|
68
|
+
}) {
|
|
16
69
|
}
|
|
17
|
-
//
|
|
18
|
-
|
|
19
|
-
// ---------------------------------------------------------------------------
|
|
20
|
-
export const PRServiceLive = Layer.effect(PRService, Effect.gen(function* () {
|
|
21
|
-
const notificationsService = yield* NotificationsService;
|
|
22
|
-
const ctx = yield* Effect.context();
|
|
23
|
-
const state = yield* SubscriptionRef.make({
|
|
24
|
-
pullRequests: [],
|
|
25
|
-
accounts: [],
|
|
26
|
-
status: "idle"
|
|
27
|
-
});
|
|
28
|
-
const provide = (effect) => Effect.provide(effect, ctx);
|
|
29
|
-
const refresh = provide(makeRefresh(state));
|
|
30
|
-
const toggleAccount = makeToggleAccount(state, refresh);
|
|
31
|
-
const setAllAccounts = makeSetAllAccounts(state, refresh);
|
|
32
|
-
return {
|
|
33
|
-
state,
|
|
34
|
-
refresh,
|
|
35
|
-
toggleAccount: (p) => provide(toggleAccount(p)),
|
|
36
|
-
setAllAccounts: (e, ps) => provide(setAllAccounts(e, ps)),
|
|
37
|
-
clearNotifications: notificationsService.clear,
|
|
38
|
-
addNotification: notificationsService.add
|
|
39
|
-
};
|
|
40
|
-
}));
|
|
70
|
+
// Module-level alias for namespace consumers (barrel uses `export * as PRService`)
|
|
71
|
+
export const PRServiceLive = PRService.Default;
|
|
41
72
|
//# sourceMappingURL=index.js.map
|