@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.
Files changed (181) hide show
  1. package/README.md +66 -0
  2. package/dist/AwsClient/createPullRequest.d.ts +1 -6
  3. package/dist/AwsClient/createPullRequest.d.ts.map +1 -1
  4. package/dist/AwsClient/createPullRequest.js +3 -11
  5. package/dist/AwsClient/createPullRequest.js.map +1 -1
  6. package/dist/AwsClient/getCallerIdentity.d.ts +5 -6
  7. package/dist/AwsClient/getCallerIdentity.d.ts.map +1 -1
  8. package/dist/AwsClient/getCallerIdentity.js +7 -12
  9. package/dist/AwsClient/getCallerIdentity.js.map +1 -1
  10. package/dist/AwsClient/getCommentsForPullRequest.d.ts +1 -6
  11. package/dist/AwsClient/getCommentsForPullRequest.d.ts.map +1 -1
  12. package/dist/AwsClient/getCommentsForPullRequest.js +9 -16
  13. package/dist/AwsClient/getCommentsForPullRequest.js.map +1 -1
  14. package/dist/AwsClient/getPullRequest.d.ts +2 -7
  15. package/dist/AwsClient/getPullRequest.d.ts.map +1 -1
  16. package/dist/AwsClient/getPullRequest.js +13 -26
  17. package/dist/AwsClient/getPullRequest.js.map +1 -1
  18. package/dist/AwsClient/getPullRequests.d.ts.map +1 -1
  19. package/dist/AwsClient/getPullRequests.js +16 -13
  20. package/dist/AwsClient/getPullRequests.js.map +1 -1
  21. package/dist/AwsClient/index.d.ts +3 -2
  22. package/dist/AwsClient/index.d.ts.map +1 -1
  23. package/dist/AwsClient/index.js.map +1 -1
  24. package/dist/AwsClient/internal.d.ts +47 -11
  25. package/dist/AwsClient/internal.d.ts.map +1 -1
  26. package/dist/AwsClient/internal.js +38 -9
  27. package/dist/AwsClient/internal.js.map +1 -1
  28. package/dist/AwsClient/listBranches.d.ts +1 -6
  29. package/dist/AwsClient/listBranches.d.ts.map +1 -1
  30. package/dist/AwsClient/listBranches.js +3 -11
  31. package/dist/AwsClient/listBranches.js.map +1 -1
  32. package/dist/AwsClient/updatePullRequestDescription.d.ts +1 -6
  33. package/dist/AwsClient/updatePullRequestDescription.d.ts.map +1 -1
  34. package/dist/AwsClient/updatePullRequestDescription.js +3 -11
  35. package/dist/AwsClient/updatePullRequestDescription.js.map +1 -1
  36. package/dist/AwsClient/updatePullRequestTitle.d.ts +1 -6
  37. package/dist/AwsClient/updatePullRequestTitle.d.ts.map +1 -1
  38. package/dist/AwsClient/updatePullRequestTitle.js +3 -11
  39. package/dist/AwsClient/updatePullRequestTitle.js.map +1 -1
  40. package/dist/CacheService/CacheError.d.ts +21 -0
  41. package/dist/CacheService/CacheError.d.ts.map +1 -0
  42. package/dist/CacheService/CacheError.js +17 -0
  43. package/dist/CacheService/CacheError.js.map +1 -0
  44. package/dist/CacheService/Database.d.ts +13 -0
  45. package/dist/CacheService/Database.d.ts.map +1 -0
  46. package/dist/CacheService/Database.js +34 -0
  47. package/dist/CacheService/Database.js.map +1 -0
  48. package/dist/CacheService/EventsHub.d.ts +163 -0
  49. package/dist/CacheService/EventsHub.d.ts.map +1 -0
  50. package/dist/CacheService/EventsHub.js +22 -0
  51. package/dist/CacheService/EventsHub.js.map +1 -0
  52. package/dist/CacheService/diff.d.ts +28 -0
  53. package/dist/CacheService/diff.d.ts.map +1 -0
  54. package/dist/CacheService/diff.js +102 -0
  55. package/dist/CacheService/diff.js.map +1 -0
  56. package/dist/CacheService/index.d.ts +17 -0
  57. package/dist/CacheService/index.d.ts.map +1 -0
  58. package/dist/CacheService/index.js +15 -0
  59. package/dist/CacheService/index.js.map +1 -0
  60. package/dist/CacheService/migrations/0001_initial.d.ts +5 -0
  61. package/dist/CacheService/migrations/0001_initial.d.ts.map +1 -0
  62. package/dist/CacheService/migrations/0001_initial.js +72 -0
  63. package/dist/CacheService/migrations/0001_initial.js.map +1 -0
  64. package/dist/CacheService/migrations/0002_indexes.d.ts +5 -0
  65. package/dist/CacheService/migrations/0002_indexes.d.ts.map +1 -0
  66. package/dist/CacheService/migrations/0002_indexes.js +7 -0
  67. package/dist/CacheService/migrations/0002_indexes.js.map +1 -0
  68. package/dist/CacheService/migrations/0003_add_health_score.d.ts +5 -0
  69. package/dist/CacheService/migrations/0003_add_health_score.d.ts.map +1 -0
  70. package/dist/CacheService/migrations/0003_add_health_score.js +4 -0
  71. package/dist/CacheService/migrations/0003_add_health_score.js.map +1 -0
  72. package/dist/CacheService/migrations/0004_unify_notifications.d.ts +5 -0
  73. package/dist/CacheService/migrations/0004_unify_notifications.d.ts.map +1 -0
  74. package/dist/CacheService/migrations/0004_unify_notifications.js +7 -0
  75. package/dist/CacheService/migrations/0004_unify_notifications.js.map +1 -0
  76. package/dist/CacheService/repos/CommentRepo.d.ts +16 -0
  77. package/dist/CacheService/repos/CommentRepo.d.ts.map +1 -0
  78. package/dist/CacheService/repos/CommentRepo.js +42 -0
  79. package/dist/CacheService/repos/CommentRepo.js.map +1 -0
  80. package/dist/CacheService/repos/NotificationRepo.d.ts +48 -0
  81. package/dist/CacheService/repos/NotificationRepo.d.ts.map +1 -0
  82. package/dist/CacheService/repos/NotificationRepo.js +128 -0
  83. package/dist/CacheService/repos/NotificationRepo.js.map +1 -0
  84. package/dist/CacheService/repos/PullRequestRepo.d.ts +112 -0
  85. package/dist/CacheService/repos/PullRequestRepo.d.ts.map +1 -0
  86. package/dist/CacheService/repos/PullRequestRepo.js +146 -0
  87. package/dist/CacheService/repos/PullRequestRepo.js.map +1 -0
  88. package/dist/CacheService/repos/SubscriptionRepo.d.ts +20 -0
  89. package/dist/CacheService/repos/SubscriptionRepo.d.ts.map +1 -0
  90. package/dist/CacheService/repos/SubscriptionRepo.js +49 -0
  91. package/dist/CacheService/repos/SubscriptionRepo.js.map +1 -0
  92. package/dist/CacheService/repos/SyncMetadataRepo.d.ts +14 -0
  93. package/dist/CacheService/repos/SyncMetadataRepo.d.ts.map +1 -0
  94. package/dist/CacheService/repos/SyncMetadataRepo.js +36 -0
  95. package/dist/CacheService/repos/SyncMetadataRepo.js.map +1 -0
  96. package/dist/ConfigService/backup.d.ts +9 -0
  97. package/dist/ConfigService/backup.d.ts.map +1 -0
  98. package/dist/ConfigService/backup.js +22 -0
  99. package/dist/ConfigService/backup.js.map +1 -0
  100. package/dist/ConfigService/detectProfiles.d.ts +1 -1
  101. package/dist/ConfigService/index.d.ts +8 -1
  102. package/dist/ConfigService/index.d.ts.map +1 -1
  103. package/dist/ConfigService/index.js +13 -2
  104. package/dist/ConfigService/index.js.map +1 -1
  105. package/dist/ConfigService/internal.d.ts +6 -0
  106. package/dist/ConfigService/internal.d.ts.map +1 -1
  107. package/dist/ConfigService/internal.js +3 -1
  108. package/dist/ConfigService/internal.js.map +1 -1
  109. package/dist/ConfigService/load.d.ts +3 -1
  110. package/dist/ConfigService/load.d.ts.map +1 -1
  111. package/dist/ConfigService/load.js +6 -4
  112. package/dist/ConfigService/load.js.map +1 -1
  113. package/dist/ConfigService/reset.d.ts +10 -0
  114. package/dist/ConfigService/reset.d.ts.map +1 -0
  115. package/dist/ConfigService/reset.js +28 -0
  116. package/dist/ConfigService/reset.js.map +1 -0
  117. package/dist/ConfigService/save.d.ts +1 -1
  118. package/dist/ConfigService/validate.d.ts +31 -0
  119. package/dist/ConfigService/validate.d.ts.map +1 -0
  120. package/dist/ConfigService/validate.js +33 -0
  121. package/dist/ConfigService/validate.js.map +1 -0
  122. package/dist/DateUtils.d.ts +1 -1
  123. package/dist/DateUtils.d.ts.map +1 -1
  124. package/dist/DateUtils.js +2 -2
  125. package/dist/DateUtils.js.map +1 -1
  126. package/dist/Domain.d.ts +185 -8
  127. package/dist/Domain.d.ts.map +1 -1
  128. package/dist/Domain.js +25 -6
  129. package/dist/Domain.js.map +1 -1
  130. package/dist/HealthScore.d.ts.map +1 -1
  131. package/dist/HealthScore.js +1 -3
  132. package/dist/HealthScore.js.map +1 -1
  133. package/dist/PRService/index.d.ts +46 -18
  134. package/dist/PRService/index.d.ts.map +1 -1
  135. package/dist/PRService/index.js +58 -27
  136. package/dist/PRService/index.js.map +1 -1
  137. package/dist/PRService/internal.d.ts +86 -1
  138. package/dist/PRService/internal.d.ts.map +1 -1
  139. package/dist/PRService/internal.js +106 -1
  140. package/dist/PRService/internal.js.map +1 -1
  141. package/dist/PRService/refresh.d.ts +10 -4
  142. package/dist/PRService/refresh.d.ts.map +1 -1
  143. package/dist/PRService/refresh.js +30 -88
  144. package/dist/PRService/refresh.js.map +1 -1
  145. package/dist/PRService/refreshEnrich.d.ts +15 -0
  146. package/dist/PRService/refreshEnrich.d.ts.map +1 -0
  147. package/dist/PRService/refreshEnrich.js +72 -0
  148. package/dist/PRService/refreshEnrich.js.map +1 -0
  149. package/dist/PRService/refreshFetch.d.ts +20 -0
  150. package/dist/PRService/refreshFetch.d.ts.map +1 -0
  151. package/dist/PRService/refreshFetch.js +78 -0
  152. package/dist/PRService/refreshFetch.js.map +1 -0
  153. package/dist/PRService/refreshResolve.d.ts +29 -0
  154. package/dist/PRService/refreshResolve.d.ts.map +1 -0
  155. package/dist/PRService/refreshResolve.js +84 -0
  156. package/dist/PRService/refreshResolve.js.map +1 -0
  157. package/dist/PRService/refreshScore.d.ts +9 -0
  158. package/dist/PRService/refreshScore.d.ts.map +1 -0
  159. package/dist/PRService/refreshScore.js +24 -0
  160. package/dist/PRService/refreshScore.js.map +1 -0
  161. package/dist/PRService/refreshSinglePR.d.ts +13 -0
  162. package/dist/PRService/refreshSinglePR.d.ts.map +1 -0
  163. package/dist/PRService/refreshSinglePR.js +102 -0
  164. package/dist/PRService/refreshSinglePR.js.map +1 -0
  165. package/dist/PRService/setAllAccounts.d.ts +1 -3
  166. package/dist/PRService/setAllAccounts.d.ts.map +1 -1
  167. package/dist/PRService/setAllAccounts.js +2 -2
  168. package/dist/PRService/setAllAccounts.js.map +1 -1
  169. package/dist/PRService/toggleAccount.d.ts +1 -3
  170. package/dist/PRService/toggleAccount.d.ts.map +1 -1
  171. package/dist/PRService/toggleAccount.js +2 -2
  172. package/dist/PRService/toggleAccount.js.map +1 -1
  173. package/dist/index.d.ts +1 -1
  174. package/dist/index.d.ts.map +1 -1
  175. package/dist/index.js +1 -1
  176. package/dist/index.js.map +1 -1
  177. package/package.json +4 -1
  178. package/dist/NotificationsService.d.ts +0 -45
  179. package/dist/NotificationsService.d.ts.map +0 -1
  180. package/dist/NotificationsService.js +0 -57
  181. package/dist/NotificationsService.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventsHub.d.ts","sourceRoot":"","sources":["../../src/CacheService/EventsHub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAe,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE1D,MAAM,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACvC,YAAY,EAAE,EAAE,CAAA;IAChB,aAAa,EAAE,EAAE,CAAA;IACjB,aAAa,EAAE,EAAE,CAAA;IACjB,QAAQ,EAAE,EAAE,CAAA;IACZ,MAAM,EAAE,EAAE,CAAA;IACV,QAAQ,EAAE,EAAE,CAAA;IACZ,mBAAmB,EAAE,EAAE,CAAA;CACxB,CAAC,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAgC,CAAA;;;0BAS1B,UAAU,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC;gBAS1C,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;;;;;;;;;;;;;;;;;;AAhBnF,qBAAa,SAAU,SAAQ,cAyC7B;CAAG"}
@@ -0,0 +1,22 @@
1
+ import { Data, Effect, PubSub, Ref, Stream } from "effect";
2
+ export const RepoChange = Data.taggedEnum();
3
+ export class EventsHub extends Effect.Service()("EventsHub", {
4
+ effect: Effect.gen(function* () {
5
+ const pubsub = yield* PubSub.unbounded();
6
+ const batchingRef = yield* Ref.make(false);
7
+ const accumulatedRef = yield* Ref.make(new Set());
8
+ const batchSemaphore = yield* Effect.makeSemaphore(1);
9
+ const publish = (change) => Ref.get(batchingRef).pipe(Effect.flatMap((batching) => batching
10
+ ? Ref.update(accumulatedRef, (s) => new Set(s).add(change._tag))
11
+ : PubSub.publish(pubsub, change).pipe(Effect.asVoid)));
12
+ const batch = (effect) => batchSemaphore.withPermits(1)(Ref.set(batchingRef, true).pipe(Effect.zipRight(Ref.set(accumulatedRef, new Set())), Effect.zipRight(Effect.ensuring(effect, Effect.gen(function* () {
13
+ const tags = yield* Ref.get(accumulatedRef);
14
+ yield* Ref.set(batchingRef, false);
15
+ yield* Effect.forEach([...tags], (tag) => PubSub.publish(pubsub, RepoChange[tag]()), { discard: true });
16
+ })))));
17
+ const subscribe = Stream.fromPubSub(pubsub);
18
+ return { publish, batch, subscribe };
19
+ })
20
+ }) {
21
+ }
22
+ //# sourceMappingURL=EventsHub.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventsHub.js","sourceRoot":"","sources":["../../src/CacheService/EventsHub.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAY1D,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,EAAc,CAAA;AAEvD,MAAM,OAAO,SAAU,SAAQ,MAAM,CAAC,OAAO,EAAa,CAAC,WAAW,EAAE;IACtE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAC1B,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,EAAc,CAAA;QACpD,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,GAAG,CAAC,IAA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,OAAO,CACnB,CAAC,GAAG,IAAI,CAAC,EACT,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,EAClD,EAAE,OAAO,EAAE,IAAI,EAAE,CAClB,CAAA;QACH,CAAC,CAAC,CACH,CACF,CACF,CACF,CAAA;QAEH,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAA;QAE3C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAA;IACtC,CAAC,CAAC;CACH,CAAC;CAAG"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Diff logic for generating persistent notifications from state changes.
3
+ *
4
+ * @module
5
+ */
6
+ import type { PRCommentLocation } from "../Domain.js";
7
+ export interface NewNotification {
8
+ readonly pullRequestId: string;
9
+ readonly awsAccountId: string;
10
+ readonly type: string;
11
+ readonly message: string;
12
+ readonly title?: string;
13
+ readonly profile?: string;
14
+ }
15
+ export interface DiffablePR {
16
+ readonly id: string;
17
+ readonly title: string;
18
+ readonly description?: string | null | undefined;
19
+ readonly repositoryName: string;
20
+ readonly accountProfile: string;
21
+ readonly status: string;
22
+ readonly isApproved: boolean | number;
23
+ readonly isMergeable: boolean | number;
24
+ readonly commentCount?: number | null | undefined;
25
+ }
26
+ export declare const diffPR: (cached: DiffablePR, fresh: DiffablePR, awsAccountId: string) => Array<NewNotification>;
27
+ export declare const diffComments: (cached: ReadonlyArray<PRCommentLocation>, fresh: ReadonlyArray<PRCommentLocation>, pullRequestId: string, awsAccountId: string) => Array<NewNotification>;
28
+ //# sourceMappingURL=diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/CacheService/diff.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAiB,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEpE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;IAChD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,EAAE,OAAO,GAAG,MAAM,CAAA;IACrC,QAAQ,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAAA;IACtC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAClD;AAED,eAAO,MAAM,MAAM,GACjB,QAAQ,UAAU,EAClB,OAAO,UAAU,EACjB,cAAc,MAAM,KACnB,KAAK,CAAC,eAAe,CAwDvB,CAAA;AA0BD,eAAO,MAAM,YAAY,GACvB,QAAQ,aAAa,CAAC,iBAAiB,CAAC,EACxC,OAAO,aAAa,CAAC,iBAAiB,CAAC,EACvC,eAAe,MAAM,EACrB,cAAc,MAAM,KACnB,KAAK,CAAC,eAAe,CA6BvB,CAAA"}
@@ -0,0 +1,102 @@
1
+ export const diffPR = (cached, fresh, awsAccountId) => {
2
+ const base = { pullRequestId: fresh.id, awsAccountId, profile: fresh.accountProfile };
3
+ const label = `#${fresh.id} ${fresh.title} (${fresh.repositoryName})`;
4
+ const notifications = [];
5
+ // Skip comment diff when cached count is null/undefined (first fetch — no baseline to compare)
6
+ if (cached.commentCount != null) {
7
+ const freshComments = fresh.commentCount ?? 0;
8
+ if (freshComments > cached.commentCount) {
9
+ notifications.push({ ...base, type: "new_comment", title: fresh.title, message: `New comments on ${label}` });
10
+ }
11
+ }
12
+ if (Boolean(fresh.isApproved) !== Boolean(cached.isApproved)) {
13
+ notifications.push({
14
+ ...base,
15
+ type: "approval_changed",
16
+ title: fresh.title,
17
+ message: `Approval ${fresh.isApproved ? "granted" : "revoked"} on ${label}`
18
+ });
19
+ }
20
+ if (Boolean(fresh.isMergeable) !== Boolean(cached.isMergeable)) {
21
+ notifications.push({
22
+ ...base,
23
+ type: "merge_changed",
24
+ title: fresh.title,
25
+ message: `${label} is ${fresh.isMergeable ? "now mergeable" : "no longer mergeable"}`
26
+ });
27
+ }
28
+ if (fresh.title !== cached.title) {
29
+ notifications.push({ ...base, type: "title_changed", title: fresh.title, message: `Title changed on ${label}` });
30
+ }
31
+ if (fresh.description !== cached.description) {
32
+ notifications.push({
33
+ ...base,
34
+ type: "description_changed",
35
+ title: fresh.title,
36
+ message: `Description updated on ${label}`
37
+ });
38
+ }
39
+ if (fresh.status !== cached.status) {
40
+ // CodeCommit sets isMergeable=false after merge, so CLOSED+!isMergeable = merged
41
+ if (fresh.status === "CLOSED" && !fresh.isMergeable) {
42
+ notifications.push({ ...base, type: "pr_merged", title: fresh.title, message: `${label} was merged` });
43
+ }
44
+ else if (fresh.status === "CLOSED") {
45
+ notifications.push({ ...base, type: "pr_closed", title: fresh.title, message: `${label} was closed` });
46
+ }
47
+ else if (fresh.status === "OPEN" && cached.status === "CLOSED") {
48
+ notifications.push({ ...base, type: "pr_reopened", title: fresh.title, message: `${label} was reopened` });
49
+ }
50
+ }
51
+ return notifications;
52
+ };
53
+ const flattenThreadComments = (thread) => {
54
+ const result = [
55
+ { id: thread.root.id, content: thread.root.content, deleted: thread.root.deleted }
56
+ ];
57
+ for (const reply of thread.replies) {
58
+ for (const item of flattenThreadComments(reply)) {
59
+ result.push(item);
60
+ }
61
+ }
62
+ return result;
63
+ };
64
+ const flattenLocations = (locations) => {
65
+ const all = [];
66
+ for (const loc of locations) {
67
+ for (const thread of loc.comments) {
68
+ for (const item of flattenThreadComments(thread)) {
69
+ all.push(item);
70
+ }
71
+ }
72
+ }
73
+ return all;
74
+ };
75
+ export const diffComments = (cached, fresh, pullRequestId, awsAccountId) => {
76
+ const base = { pullRequestId, awsAccountId };
77
+ const cachedFlat = flattenLocations(cached);
78
+ const freshFlat = flattenLocations(fresh);
79
+ const cachedMap = new Map(cachedFlat.map((c) => [c.id, c]));
80
+ const cachedIds = new Set(cachedFlat.map((c) => c.id));
81
+ const notifications = [];
82
+ let hasNew = false;
83
+ let hasEdited = false;
84
+ let hasDeleted = false;
85
+ for (const f of freshFlat) {
86
+ if (!cachedIds.has(f.id) && !hasNew) {
87
+ notifications.push({ ...base, type: "new_comment", message: `New comment on #${pullRequestId}` });
88
+ hasNew = true;
89
+ }
90
+ const old = cachedMap.get(f.id);
91
+ if (old && old.content !== f.content && !f.deleted && !hasEdited) {
92
+ notifications.push({ ...base, type: "comment_edited", message: `Comment edited on #${pullRequestId}` });
93
+ hasEdited = true;
94
+ }
95
+ if (old && !old.deleted && f.deleted && !hasDeleted) {
96
+ notifications.push({ ...base, type: "comment_deleted", message: `Comment deleted on #${pullRequestId}` });
97
+ hasDeleted = true;
98
+ }
99
+ }
100
+ return notifications;
101
+ };
102
+ //# sourceMappingURL=diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/CacheService/diff.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAC,MAAM,MAAM,GAAG,CACpB,MAAkB,EAClB,KAAiB,EACjB,YAAoB,EACI,EAAE;IAC1B,MAAM,IAAI,GAAG,EAAE,aAAa,EAAE,KAAK,CAAC,EAAE,EAAE,YAAY,EAAE,OAAO,EAAE,KAAK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,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;YACpD,aAAa,CAAC,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,uBAAuB,aAAa,EAAE,EAAE,CAAC,CAAA;YACzG,UAAU,GAAG,IAAI,CAAA;QACnB,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAA;AACtB,CAAC,CAAA"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Local SQLite cache layer for CodeCommit data.
3
+ *
4
+ * @module
5
+ */
6
+ export { CacheError } from "./CacheError.js";
7
+ export { DatabaseLive, LibsqlLive, MigrationsLive } from "./Database.js";
8
+ export { diffComments, diffPR } from "./diff.js";
9
+ export { EventsHub, RepoChange } from "./EventsHub.js";
10
+ export { CommentRepo } from "./repos/CommentRepo.js";
11
+ export { NotificationRepo } from "./repos/NotificationRepo.js";
12
+ export type { NotificationRow, PaginatedNotifications } from "./repos/NotificationRepo.js";
13
+ export { CachedPullRequest, PullRequestRepo } from "./repos/PullRequestRepo.js";
14
+ export type { SearchResult } from "./repos/PullRequestRepo.js";
15
+ export { SubscriptionRepo } from "./repos/SubscriptionRepo.js";
16
+ export { SyncMetadataRepo } from "./repos/SyncMetadataRepo.js";
17
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/CacheService/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,YAAY,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAC1F,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAC/E,YAAY,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Local SQLite cache layer for CodeCommit data.
3
+ *
4
+ * @module
5
+ */
6
+ export { CacheError } from "./CacheError.js";
7
+ export { DatabaseLive, LibsqlLive, MigrationsLive } from "./Database.js";
8
+ export { diffComments, diffPR } from "./diff.js";
9
+ export { EventsHub, RepoChange } from "./EventsHub.js";
10
+ export { CommentRepo } from "./repos/CommentRepo.js";
11
+ export { NotificationRepo } from "./repos/NotificationRepo.js";
12
+ export { CachedPullRequest, PullRequestRepo } from "./repos/PullRequestRepo.js";
13
+ export { SubscriptionRepo } from "./repos/SubscriptionRepo.js";
14
+ export { SyncMetadataRepo } from "./repos/SyncMetadataRepo.js";
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/CacheService/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAE9D,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA"}
@@ -0,0 +1,5 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as Effect from "effect/Effect";
3
+ declare const _default: Effect.Effect<void, import("@effect/sql/SqlError").SqlError, SqlClient.SqlClient>;
4
+ export default _default;
5
+ //# sourceMappingURL=0001_initial.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0001_initial.d.ts","sourceRoot":"","sources":["../../../src/CacheService/migrations/0001_initial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;;AAEvC,wBA6EwB"}
@@ -0,0 +1,72 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as Effect from "effect/Effect";
3
+ export default Effect.flatMap(SqlClient.SqlClient, (sql) => Effect.all([
4
+ sql `CREATE TABLE IF NOT EXISTS pull_requests (
5
+ id TEXT NOT NULL,
6
+ aws_account_id TEXT NOT NULL,
7
+ account_profile TEXT NOT NULL,
8
+ account_region TEXT NOT NULL,
9
+ title TEXT NOT NULL,
10
+ description TEXT,
11
+ author TEXT NOT NULL,
12
+ repository_name TEXT NOT NULL,
13
+ creation_date TEXT NOT NULL,
14
+ last_modified_date TEXT NOT NULL,
15
+ status TEXT NOT NULL,
16
+ source_branch TEXT NOT NULL,
17
+ destination_branch TEXT NOT NULL,
18
+ is_mergeable INTEGER NOT NULL DEFAULT 0,
19
+ is_approved INTEGER NOT NULL DEFAULT 0,
20
+ comment_count INTEGER,
21
+ link TEXT NOT NULL,
22
+ fetched_at TEXT NOT NULL DEFAULT (datetime('now')),
23
+ PRIMARY KEY (aws_account_id, id)
24
+ )`,
25
+ sql `CREATE TABLE IF NOT EXISTS pr_comments (
26
+ pull_request_id TEXT NOT NULL,
27
+ aws_account_id TEXT NOT NULL,
28
+ locations_json TEXT NOT NULL,
29
+ fetched_at TEXT NOT NULL DEFAULT (datetime('now')),
30
+ PRIMARY KEY (aws_account_id, pull_request_id)
31
+ )`,
32
+ sql `CREATE TABLE IF NOT EXISTS pr_subscriptions (
33
+ pull_request_id TEXT NOT NULL,
34
+ aws_account_id TEXT NOT NULL,
35
+ subscribed_at TEXT NOT NULL DEFAULT (datetime('now')),
36
+ PRIMARY KEY (aws_account_id, pull_request_id)
37
+ )`,
38
+ sql `CREATE TABLE IF NOT EXISTS notifications (
39
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
40
+ pull_request_id TEXT NOT NULL,
41
+ aws_account_id TEXT NOT NULL,
42
+ type TEXT NOT NULL,
43
+ message TEXT NOT NULL,
44
+ created_at TEXT NOT NULL DEFAULT (datetime('now')),
45
+ read INTEGER NOT NULL DEFAULT 0
46
+ )`,
47
+ sql `CREATE TABLE IF NOT EXISTS sync_metadata (
48
+ account_id TEXT NOT NULL,
49
+ account_region TEXT NOT NULL,
50
+ last_synced_at TEXT NOT NULL,
51
+ PRIMARY KEY (account_id, account_region)
52
+ )`,
53
+ sql `CREATE VIRTUAL TABLE IF NOT EXISTS pull_requests_fts USING fts5(
54
+ title, description, author, repository_name,
55
+ content='pull_requests', content_rowid='rowid'
56
+ )`,
57
+ sql `CREATE TRIGGER IF NOT EXISTS pull_requests_ai AFTER INSERT ON pull_requests BEGIN
58
+ INSERT INTO pull_requests_fts(rowid, title, description, author, repository_name)
59
+ VALUES (new.rowid, new.title, new.description, new.author, new.repository_name);
60
+ END`,
61
+ sql `CREATE TRIGGER IF NOT EXISTS pull_requests_ad AFTER DELETE ON pull_requests BEGIN
62
+ INSERT INTO pull_requests_fts(pull_requests_fts, rowid, title, description, author, repository_name)
63
+ VALUES ('delete', old.rowid, old.title, old.description, old.author, old.repository_name);
64
+ END`,
65
+ sql `CREATE TRIGGER IF NOT EXISTS pull_requests_au AFTER UPDATE ON pull_requests BEGIN
66
+ INSERT INTO pull_requests_fts(pull_requests_fts, rowid, title, description, author, repository_name)
67
+ VALUES ('delete', old.rowid, old.title, old.description, old.author, old.repository_name);
68
+ INSERT INTO pull_requests_fts(rowid, title, description, author, repository_name)
69
+ VALUES (new.rowid, new.title, new.description, new.author, new.repository_name);
70
+ END`
71
+ ], { discard: true }));
72
+ //# sourceMappingURL=0001_initial.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0001_initial.js","sourceRoot":"","sources":["../../../src/CacheService/migrations/0001_initial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,eAAe,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACzD,MAAM,CAAC,GAAG,CAAC;IACT,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;MAoBD;IAEF,GAAG,CAAA;;;;;;MAMD;IAEF,GAAG,CAAA;;;;;MAKD;IAEF,GAAG,CAAA;;;;;;;;MAQD;IAEF,GAAG,CAAA;;;;;MAKD;IAEF,GAAG,CAAA;;;MAGD;IAEF,GAAG,CAAA;;;QAGC;IAEJ,GAAG,CAAA;;;QAGC;IAEJ,GAAG,CAAA;;;;;QAKC;CACL,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as Effect from "effect/Effect";
3
+ declare const _default: Effect.Effect<void, import("@effect/sql/SqlError").SqlError, SqlClient.SqlClient>;
4
+ export default _default;
5
+ //# sourceMappingURL=0002_indexes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0002_indexes.d.ts","sourceRoot":"","sources":["../../../src/CacheService/migrations/0002_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;;AAEvC,wBAIwB"}
@@ -0,0 +1,7 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as Effect from "effect/Effect";
3
+ export default Effect.flatMap(SqlClient.SqlClient, (sql) => Effect.all([
4
+ sql `CREATE INDEX IF NOT EXISTS idx_pr_creation_date ON pull_requests(creation_date DESC)`,
5
+ sql `CREATE INDEX IF NOT EXISTS idx_notif_read_created ON notifications(read, created_at DESC)`
6
+ ], { discard: true }));
7
+ //# sourceMappingURL=0002_indexes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0002_indexes.js","sourceRoot":"","sources":["../../../src/CacheService/migrations/0002_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,eAAe,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE,CACzD,MAAM,CAAC,GAAG,CAAC;IACT,GAAG,CAAA,sFAAsF;IACzF,GAAG,CAAA,2FAA2F;CAC/F,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as Effect from "effect/Effect";
3
+ declare const _default: Effect.Effect<void | readonly import("@effect/sql/SqlConnection").Row[], never, SqlClient.SqlClient>;
4
+ export default _default;
5
+ //# sourceMappingURL=0003_add_health_score.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0003_add_health_score.d.ts","sourceRoot":"","sources":["../../../src/CacheService/migrations/0003_add_health_score.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;;AAEvC,wBAMC"}
@@ -0,0 +1,4 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as Effect from "effect/Effect";
3
+ export default Effect.flatMap(SqlClient.SqlClient, (sql) => sql `ALTER TABLE pull_requests ADD COLUMN health_score REAL`.pipe(Effect.catchAll(() => Effect.void)));
4
+ //# sourceMappingURL=0003_add_health_score.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0003_add_health_score.js","sourceRoot":"","sources":["../../../src/CacheService/migrations/0003_add_health_score.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,eAAe,MAAM,CAAC,OAAO,CAC3B,SAAS,CAAC,SAAS,EACnB,CAAC,GAAG,EAAE,EAAE,CACN,GAAG,CAAA,wDAAwD,CAAC,IAAI,CAC9D,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CACnC,CACJ,CAAA"}
@@ -0,0 +1,5 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as Effect from "effect/Effect";
3
+ declare const _default: Effect.Effect<void, never, SqlClient.SqlClient>;
4
+ export default _default;
5
+ //# sourceMappingURL=0004_unify_notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0004_unify_notifications.d.ts","sourceRoot":"","sources":["../../../src/CacheService/migrations/0004_unify_notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;;AAEvC,wBAWC"}
@@ -0,0 +1,7 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as Effect from "effect/Effect";
3
+ export default Effect.flatMap(SqlClient.SqlClient, (sql) => Effect.all([
4
+ sql `ALTER TABLE notifications ADD COLUMN title TEXT NOT NULL DEFAULT ''`.pipe(Effect.catchAll(() => Effect.void)),
5
+ sql `ALTER TABLE notifications ADD COLUMN profile TEXT NOT NULL DEFAULT ''`.pipe(Effect.catchAll(() => Effect.void))
6
+ ]).pipe(Effect.asVoid));
7
+ //# sourceMappingURL=0004_unify_notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0004_unify_notifications.js","sourceRoot":"","sources":["../../../src/CacheService/migrations/0004_unify_notifications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAA;AAEvC,eAAe,MAAM,CAAC,OAAO,CAC3B,SAAS,CAAC,SAAS,EACnB,CAAC,GAAG,EAAE,EAAE,CACN,MAAM,CAAC,GAAG,CAAC;IACT,GAAG,CAAA,qEAAqE,CAAC,IAAI,CAC3E,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CACnC;IACD,GAAG,CAAA,uEAAuE,CAAC,IAAI,CAC7E,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CACnC;CACF,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CACzB,CAAA"}
@@ -0,0 +1,16 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import { Effect, Option } from "effect";
3
+ import type { PRCommentLocation } from "../../Domain.js";
4
+ import { CacheError } from "../CacheError.js";
5
+ import { EventsHub } from "../EventsHub.js";
6
+ declare const CommentRepo_base: Effect.Service.Class<CommentRepo, "CommentRepo", {
7
+ readonly dependencies: readonly [import("effect/Layer").Layer<SqlClient.SqlClient | import("@effect/sql-libsql/LibsqlClient").LibsqlClient, import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError, import("@effect/platform/FileSystem").FileSystem>, import("effect/Layer").Layer<EventsHub, never, never>];
8
+ readonly effect: Effect.Effect<{
9
+ readonly find: (awsAccountId: string, prId: string) => Effect.Effect<Option.Option<readonly PRCommentLocation[]>, CacheError, never>;
10
+ readonly upsert: (awsAccountId: string, prId: string, locationsJson: string) => Effect.Effect<void, CacheError, never>;
11
+ }, never, SqlClient.SqlClient | EventsHub>;
12
+ }>;
13
+ export declare class CommentRepo extends CommentRepo_base {
14
+ }
15
+ export {};
16
+ //# sourceMappingURL=CommentRepo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentRepo.d.ts","sourceRoot":"","sources":["../../../src/CacheService/repos/CommentRepo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAA;AAC/C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAExD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAA;;;;sCAsC5B,MAAM,QAAQ,MAAM;wCAelB,MAAM,QAAQ,MAAM,iBAAiB,MAAM;;;AAvCxE,qBAAa,WAAY,SAAQ,gBA2C/B;CAAG"}
@@ -0,0 +1,42 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import * as SqlSchema from "@effect/sql/SqlSchema";
3
+ import { Effect, Option, Schema } from "effect";
4
+ import { PRCommentLocationJson } from "../../Domain.js";
5
+ import { CacheError } from "../CacheError.js";
6
+ import { DatabaseLive } from "../Database.js";
7
+ import { EventsHub, RepoChange } from "../EventsHub.js";
8
+ const CommentRow = Schema.Struct({
9
+ locationsJson: Schema.String
10
+ });
11
+ const LocationsFromJson = Schema.parseJson(Schema.Array(PRCommentLocationJson));
12
+ const cacheError = (op) => (effect) => effect.pipe(Effect.mapError((cause) => new CacheError({ operation: `CommentRepo.${op}`, cause })), Effect.withSpan(`CommentRepo.${op}`, { captureStackTrace: false }));
13
+ export class CommentRepo extends Effect.Service()("CommentRepo", {
14
+ dependencies: [DatabaseLive, EventsHub.Default],
15
+ effect: Effect.gen(function* () {
16
+ const sql = yield* SqlClient.SqlClient;
17
+ const hub = yield* EventsHub;
18
+ const find_ = SqlSchema.findOne({
19
+ Result: CommentRow,
20
+ Request: Schema.Struct({ awsAccountId: Schema.String, pullRequestId: Schema.String }),
21
+ execute: (req) => sql `SELECT locations_json FROM pr_comments
22
+ WHERE aws_account_id = ${req.awsAccountId}
23
+ AND pull_request_id = ${req.pullRequestId}`
24
+ });
25
+ const upsert_ = (awsAccountId, prId, locationsJson) => sql `INSERT OR REPLACE INTO pr_comments
26
+ (aws_account_id, pull_request_id, locations_json, fetched_at)
27
+ VALUES (${awsAccountId}, ${prId}, ${locationsJson}, datetime('now'))
28
+ `.pipe(Effect.asVoid);
29
+ const publish = hub.publish(RepoChange.Comments());
30
+ return {
31
+ find: (awsAccountId, prId) => find_({ awsAccountId, pullRequestId: prId }).pipe(Effect.flatMap(Option.match({
32
+ onNone: () => Effect.succeed(Option.none()),
33
+ onSome: (r) => Schema.decodeUnknown(LocationsFromJson)(r.locationsJson).pipe(
34
+ // PRCommentLocationJson is structurally compatible with PRCommentLocation for diff/count
35
+ Effect.map((decoded) => Option.some(decoded)), Effect.catchAll(() => Effect.succeed(Option.some([]))))
36
+ })), cacheError("find")),
37
+ upsert: (awsAccountId, prId, locationsJson) => upsert_(awsAccountId, prId, locationsJson).pipe(Effect.tap(() => publish), cacheError("upsert"))
38
+ };
39
+ })
40
+ }) {
41
+ }
42
+ //# sourceMappingURL=CommentRepo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommentRepo.js","sourceRoot":"","sources":["../../../src/CacheService/repos/CommentRepo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE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AAC,CACnB;YACH,MAAM,EAAE,CAAC,YAAoB,EAAE,IAAY,EAAE,aAAqB,EAAE,EAAE,CACpE,OAAO,CAAC,YAAY,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;SAC1F,CAAA;IACZ,CAAC,CAAC;CACH,CAAC;CAAG"}
@@ -0,0 +1,48 @@
1
+ import * as SqlClient from "@effect/sql/SqlClient";
2
+ import { Effect, Schema } from "effect";
3
+ import { CacheError } from "../CacheError.js";
4
+ import type { NewNotification } from "../diff.js";
5
+ import { EventsHub } from "../EventsHub.js";
6
+ declare const NotificationRow: Schema.Struct<{
7
+ id: typeof Schema.Number;
8
+ pullRequestId: typeof Schema.String;
9
+ awsAccountId: typeof Schema.String;
10
+ type: typeof Schema.String;
11
+ message: typeof Schema.String;
12
+ title: typeof Schema.String;
13
+ profile: typeof Schema.String;
14
+ createdAt: typeof Schema.String;
15
+ read: typeof Schema.Number;
16
+ }>;
17
+ export type NotificationRow = typeof NotificationRow.Type;
18
+ export type { NewNotification };
19
+ export interface PaginatedNotifications {
20
+ readonly items: ReadonlyArray<NotificationRow>;
21
+ readonly nextCursor?: number;
22
+ }
23
+ declare const NotificationRepo_base: Effect.Service.Class<NotificationRepo, "NotificationRepo", {
24
+ readonly dependencies: readonly [import("effect/Layer").Layer<SqlClient.SqlClient | import("@effect/sql-libsql/LibsqlClient").LibsqlClient, import("@effect/sql/SqlError").SqlError | import("effect/ConfigError").ConfigError | import("@effect/sql/Migrator").MigrationError, import("@effect/platform/FileSystem").FileSystem>, import("effect/Layer").Layer<EventsHub, never, never>];
25
+ readonly effect: Effect.Effect<{
26
+ readonly findAll: (opts?: {
27
+ readonly unreadOnly?: boolean;
28
+ readonly limit?: number;
29
+ readonly cursor?: number;
30
+ readonly filter?: "system" | "prs";
31
+ }) => Effect.Effect<PaginatedNotifications, CacheError>;
32
+ readonly add: (n: NewNotification) => Effect.Effect<void, CacheError, never>;
33
+ readonly addSystem: (n: {
34
+ readonly type: string;
35
+ readonly title: string;
36
+ readonly message: string;
37
+ readonly profile?: string;
38
+ readonly deduplicate?: boolean;
39
+ }) => Effect.Effect<void, CacheError, never>;
40
+ readonly markRead: (id: number) => Effect.Effect<void, CacheError, never>;
41
+ readonly markUnread: (id: number) => Effect.Effect<void, CacheError, never>;
42
+ readonly markAllRead: () => Effect.Effect<void, CacheError, never>;
43
+ readonly unreadCount: () => Effect.Effect<number, CacheError, never>;
44
+ }, never, SqlClient.SqlClient | EventsHub>;
45
+ }>;
46
+ export declare class NotificationRepo extends NotificationRepo_base {
47
+ }
48
+ //# sourceMappingURL=NotificationRepo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationRepo.d.ts","sourceRoot":"","sources":["../../../src/CacheService/repos/NotificationRepo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,uBAAuB,CAAA;AAElD,OAAO,EAAgB,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AACjD,OAAO,EAAE,SAAS,EAAc,MAAM,iBAAiB,CAAA;AAEvD,QAAA,MAAM,eAAe;;;;;;;;;;EAUnB,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAA;AACzD,YAAY,EAAE,eAAe,EAAE,CAAA;AAM/B,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,eAAe,CAAC,CAAA;IAC9C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAC7B;;;;kCAsFsB;YACf,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;YAC7B,QAAQ,CAAC,KA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