@citec-spbu/contracts 1.0.20 → 1.0.21

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.
@@ -1 +1 @@
1
- export * from "./raw-event-published.interface";
1
+ export * from "./normalized-event-published.interface";
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./raw-event-published.interface"), exports);
17
+ __exportStar(require("./normalized-event-published.interface"), exports);
@@ -1,4 +1,4 @@
1
- interface _RawEventPublished<T = unknown, P = unknown> {
1
+ interface _NormalizedEventPublished<T = unknown, P = unknown> {
2
2
  id: string;
3
3
  source: "github";
4
4
  type: T;
@@ -85,7 +85,6 @@ interface PullRequestCreatedPayload {
85
85
  createdAt: Date;
86
86
  updatedAt: Date;
87
87
  closedAt: Date | null;
88
- closedBy: UserPayload | null;
89
88
  }
90
89
  interface PullRequestStateChangedEventPayload {
91
90
  eventId: string;
@@ -136,5 +135,8 @@ interface PullRequestCommentEventPayload {
136
135
  createdAt: Date;
137
136
  updatedAt: Date;
138
137
  }
139
- export type RawEventPublished = _RawEventPublished<"commit.created", CommitEventPayload> | _RawEventPublished<"issue.created", IssueCreatedEventPayload> | _RawEventPublished<"issue.state_changed", IssueStateChangedEventPayload> | _RawEventPublished<"issue.assigned", IssueAssigneeEventPayload> | _RawEventPublished<"issue.labeled", IssueLabelEventPayload> | _RawEventPublished<"issue.commented", IssueCommentEventPayload> | _RawEventPublished<"pull_request.created", PullRequestCreatedPayload> | _RawEventPublished<"pull_request.state_changed", PullRequestStateChangedEventPayload> | _RawEventPublished<"pull_request.assigned", PullRequestAssigneeEventPayload> | _RawEventPublished<"pull_request.labeled", PullRequestLabelEventPayload> | _RawEventPublished<"pull_request.review_requested", PullRequestReviewRequestEventPayload> | _RawEventPublished<"pull_request.reviewed", PullRequestReviewEventPayload> | _RawEventPublished<"pull_request.commented", PullRequestCommentEventPayload>;
138
+ export type NormalizedEventPublished = _NormalizedEventPublished<"commit.created", CommitEventPayload> | _NormalizedEventPublished<"issue.created", IssueCreatedEventPayload> | _NormalizedEventPublished<"issue.state_changed", IssueStateChangedEventPayload> | _NormalizedEventPublished<"issue.assigned", IssueAssigneeEventPayload> | _NormalizedEventPublished<"issue.labeled", IssueLabelEventPayload> | _NormalizedEventPublished<"issue.commented", IssueCommentEventPayload> | _NormalizedEventPublished<"pull_request.created", PullRequestCreatedPayload> | _NormalizedEventPublished<"pull_request.state_changed", PullRequestStateChangedEventPayload> | _NormalizedEventPublished<"pull_request.assigned", PullRequestAssigneeEventPayload> | _NormalizedEventPublished<"pull_request.labeled", PullRequestLabelEventPayload> | _NormalizedEventPublished<"pull_request.review_requested", PullRequestReviewRequestEventPayload> | _NormalizedEventPublished<"pull_request.reviewed", PullRequestReviewEventPayload> | _NormalizedEventPublished<"pull_request.commented", PullRequestCommentEventPayload>;
139
+ export type ExtractEvent<T extends NormalizedEventPublished["type"]> = Extract<NormalizedEventPublished, {
140
+ type: T;
141
+ }>;
140
142
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@citec-spbu/contracts",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "description": "Protobuf definitions and generated TypeScript types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",