@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
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Notification state management service.
|
|
3
|
-
*
|
|
4
|
-
* Manages application notifications using `SubscriptionRef` for reactive state
|
|
5
|
-
* and `Clock.currentTimeMillis` for timestamps (testable with `TestClock`).
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* ```typescript
|
|
9
|
-
* import { NotificationsService } from "@knpkv/codecommit-core"
|
|
10
|
-
*
|
|
11
|
-
* const program = Effect.gen(function* () {
|
|
12
|
-
* const notifications = yield* NotificationsService
|
|
13
|
-
* yield* notifications.add({ type: "info", title: "Refresh", message: "Complete" })
|
|
14
|
-
* })
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* @category Service
|
|
18
|
-
* @module
|
|
19
|
-
*/
|
|
20
|
-
import { Clock, Context, DateTime, Effect, Layer, SubscriptionRef } from "effect";
|
|
21
|
-
// ---------------------------------------------------------------------------
|
|
22
|
-
// Service Definition
|
|
23
|
-
// ---------------------------------------------------------------------------
|
|
24
|
-
/**
|
|
25
|
-
* Notifications service.
|
|
26
|
-
*
|
|
27
|
-
* @category Service
|
|
28
|
-
*/
|
|
29
|
-
export class NotificationsService extends Context.Tag("@knpkv/codecommit-core/NotificationsService")() {
|
|
30
|
-
}
|
|
31
|
-
// ---------------------------------------------------------------------------
|
|
32
|
-
// Live Implementation
|
|
33
|
-
// ---------------------------------------------------------------------------
|
|
34
|
-
/**
|
|
35
|
-
* Live notifications service using Clock for timestamps.
|
|
36
|
-
*
|
|
37
|
-
* @category Service
|
|
38
|
-
*/
|
|
39
|
-
export const NotificationsServiceLive = Layer.effect(NotificationsService, Effect.gen(function* () {
|
|
40
|
-
const state = yield* SubscriptionRef.make({
|
|
41
|
-
items: []
|
|
42
|
-
});
|
|
43
|
-
const add = (item) => Effect.gen(function* () {
|
|
44
|
-
const now = yield* Clock.currentTimeMillis;
|
|
45
|
-
const timestamp = DateTime.toDate(DateTime.unsafeMake(now));
|
|
46
|
-
const notification = {
|
|
47
|
-
...item,
|
|
48
|
-
timestamp
|
|
49
|
-
};
|
|
50
|
-
yield* SubscriptionRef.update(state, (s) => ({
|
|
51
|
-
items: [...s.items, notification]
|
|
52
|
-
}));
|
|
53
|
-
}).pipe(Effect.withSpan("NotificationsService.add"));
|
|
54
|
-
const clear = SubscriptionRef.update(state, () => ({ items: [] }));
|
|
55
|
-
return { state, add, clear };
|
|
56
|
-
}));
|
|
57
|
-
//# sourceMappingURL=NotificationsService.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsService.js","sourceRoot":"","sources":["../src/NotificationsService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAGjF,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,OAAO,oBAAqB,SAAQ,OAAO,CAAC,GAAG,CAAC,6CAA6C,CAAC,EAWjG;CAAG;AAEN,8EAA8E;AAC9E,sBAAsB;AACtB,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC,MAAM,CAClD,oBAAoB,EACpB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;IAClB,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,eAAe,CAAC,IAAI,CAAqB;QAC5D,KAAK,EAAE,EAAE;KACV,CAAC,CAAA;IAEF,MAAM,GAAG,GAAG,CAAC,IAIZ,EAAuB,EAAE,CACxB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClB,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAA;QAC1C,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QAC3D,MAAM,YAAY,GAAqB;YACrC,GAAG,IAAI;YACP,SAAS;SACV,CAAA;QACD,KAAK,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,YAAY,CAAC;SAClC,CAAC,CAAC,CAAA;IACL,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,CAAC,CAAA;IAEtD,MAAM,KAAK,GAAG,eAAe,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;IAElE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;AAC9B,CAAC,CAAC,CACH,CAAA"}
|