standup-mr 0.6.1 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,15 +1,3 @@
1
- interface BucketInput {
2
- draft: boolean;
3
- pipeline: string | null;
4
- unresolved: number;
5
- updated: string;
6
- }
7
- interface PipelineInput {
8
- project: string;
9
- pipeline: string | null;
10
- pipelineMissing?: boolean;
11
- }
12
-
13
1
  type ProviderKind = 'gitlab' | 'github';
14
2
  type FetchLike = (url: string, init?: RequestInit) => Promise<Response>;
15
3
  type Bucket = 'ready' | 'blocked' | 'draft' | 'stale';
@@ -18,74 +6,86 @@ interface Identity {
18
6
  username: string;
19
7
  }
20
8
  interface ActivityEvent {
21
- at: string;
22
9
  action: string;
23
- project: string;
24
- targetType: string;
25
- title: string;
10
+ at: string;
26
11
  branch: string;
27
12
  commits: number;
28
13
  commitTitle: string;
29
- }
30
- interface MergeRequest {
31
- provider: ProviderKind;
32
14
  project: string;
33
- projectId: number;
34
- iid: number;
15
+ targetType: string;
35
16
  title: string;
36
- draft: boolean;
17
+ }
18
+ interface MergeRequest {
37
19
  branch: string;
38
- target: string;
39
- updated: string;
40
- url: string;
20
+ bucket: Bucket;
21
+ draft: boolean;
22
+ iid: number;
41
23
  mergeStatus: string | null;
42
24
  pipeline: string | null;
43
25
  pipelineId: number | null;
44
- unresolved: number;
45
26
  pipelineMissing: boolean;
46
- bucket: Bucket;
27
+ project: string;
28
+ projectId: number;
29
+ provider: ProviderKind;
30
+ target: string;
31
+ title: string;
32
+ unresolved: number;
33
+ updated: string;
34
+ url: string;
47
35
  }
48
36
  interface Review {
49
- provider: ProviderKind;
50
- project: string;
37
+ approvedByMe: boolean;
38
+ author: string;
39
+ draft: boolean;
40
+ fresh: boolean;
51
41
  iid: number;
42
+ project: string;
43
+ provider: ProviderKind;
52
44
  title: string;
53
- author: string;
54
45
  updated: string;
55
- draft: boolean;
56
46
  url: string;
57
- fresh: boolean;
58
- approvedByMe: boolean;
59
47
  }
60
48
  interface Blocker {
61
- provider: ProviderKind;
62
- project: string;
63
- mr: number;
64
- title: string;
49
+ errors: string[];
65
50
  job: string;
51
+ mr: number;
52
+ project: string;
53
+ provider: ProviderKind;
66
54
  stage: string;
55
+ title: string;
67
56
  url: string;
68
- errors: string[];
69
57
  }
70
58
  interface ActiveDay {
71
59
  date: string;
72
- label: string;
73
- gapDays: number;
74
60
  events: ActivityEvent[];
61
+ gapDays: number;
62
+ label: string;
75
63
  }
76
64
  interface StandupReport {
65
+ blockers: Blocker[];
66
+ myMrs: MergeRequest[];
67
+ previousDays: ActiveDay[];
77
68
  provider: ProviderKind;
78
- user: string;
69
+ reviewPendingCount: number;
70
+ reviews: Review[];
79
71
  today: {
80
72
  date: string;
81
73
  label: string;
82
74
  };
83
- previousDays: ActiveDay[];
84
75
  todayEvents: ActivityEvent[];
85
- myMrs: MergeRequest[];
86
- reviews: Review[];
87
- reviewPendingCount: number;
88
- blockers: Blocker[];
76
+ user: string;
77
+ }
78
+
79
+ interface BucketInput {
80
+ draft: boolean;
81
+ pipeline: string | null;
82
+ unresolved: number;
83
+ updated: string;
84
+ }
85
+ interface PipelineInput {
86
+ pipeline: string | null;
87
+ pipelineMissing?: boolean;
88
+ project: string;
89
89
  }
90
90
 
91
91
  declare function classify(mr: BucketInput, today: Date, staleDays?: number): Bucket;
@@ -97,11 +97,11 @@ declare class ConfigError extends Error {
97
97
  constructor(message: string);
98
98
  }
99
99
  interface ProviderLabels {
100
- name: string;
101
100
  cli: string;
102
101
  envHost: string;
103
102
  envToken: string;
104
103
  login: (host: string) => string;
104
+ name: string;
105
105
  }
106
106
  declare const GITLAB_LABELS: ProviderLabels;
107
107
  declare const GITHUB_LABELS: ProviderLabels;
@@ -134,12 +134,12 @@ declare function postWebhook(url: string, text: string, kind?: WebhookKind, fetc
134
134
  declare function inferWebhookKind(url: string): WebhookKind | null;
135
135
 
136
136
  interface Provider {
137
- readonly kind: ProviderKind;
138
- getIdentity(): Promise<Identity>;
137
+ getBlockers(mrs: MergeRequest[]): Promise<Blocker[]>;
139
138
  getEvents(since: Date): Promise<ActivityEvent[]>;
139
+ getIdentity(): Promise<Identity>;
140
140
  getMyMrs(today: Date): Promise<MergeRequest[]>;
141
141
  getReviews(identity: Identity, today: Date): Promise<Review[]>;
142
- getBlockers(mrs: MergeRequest[]): Promise<Blocker[]>;
142
+ readonly kind: ProviderKind;
143
143
  }
144
144
 
145
145
  declare function buildUrl(api: string, path: string, params?: Record<string, string | number>): string;
@@ -189,11 +189,7 @@ interface RawCommit {
189
189
  message?: string;
190
190
  }
191
191
  interface RawEvent {
192
- type?: string;
193
192
  created_at: string;
194
- repo?: {
195
- name?: string;
196
- };
197
193
  payload?: {
198
194
  action?: string;
199
195
  ref?: string;
@@ -206,6 +202,10 @@ interface RawEvent {
206
202
  title?: string;
207
203
  };
208
204
  };
205
+ repo?: {
206
+ name?: string;
207
+ };
208
+ type?: string;
209
209
  }
210
210
  interface PullReview {
211
211
  state: string;
@@ -216,16 +216,16 @@ interface PullReview {
216
216
  }
217
217
  interface CheckRun {
218
218
  id: number;
219
- name: string;
220
- status: string;
221
- conclusion: string | null;
222
219
  app?: {
223
220
  slug?: string;
224
221
  } | null;
222
+ conclusion: string | null;
223
+ name: string;
225
224
  output?: {
226
225
  summary?: string | null;
227
226
  text?: string | null;
228
227
  } | null;
228
+ status: string;
229
229
  }
230
230
 
231
231
  declare function repoFromUrl(repositoryUrl: string): string;
@@ -265,14 +265,14 @@ declare class GitLabProvider implements Provider {
265
265
  }
266
266
 
267
267
  interface SelectOptions {
268
- provider?: string;
269
- host?: string;
270
- token?: string;
271
268
  env?: Record<string, string | undefined>;
269
+ host?: string;
272
270
  probe?: {
273
271
  gitlab: () => string[];
274
272
  github: () => string[];
275
273
  };
274
+ provider?: string;
275
+ token?: string;
276
276
  }
277
277
  declare function chooseKind(options?: SelectOptions): ProviderKind;
278
278
  declare function connect(options?: SelectOptions): Provider;
package/dist/index.js CHANGED
@@ -45,7 +45,7 @@ import {
45
45
  toMarkdown,
46
46
  undiagnosed,
47
47
  unreachable
48
- } from "./chunk-NJO6LFYN.js";
48
+ } from "./chunk-J5LAGA3U.js";
49
49
  export {
50
50
  ApiError,
51
51
  ConfigError,