@foss.global/interfaces 0.8.0 → 0.9.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/changelog.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-07-21 - 0.9.0
4
+
5
+ ### Features
6
+
7
+ - add native pull request contracts (pull-requests)
8
+ - Add public pull request, discussion, review, inline review comment, and merge state shapes.
9
+ - Add typed mutation contracts for pull request creation, state changes, review submission and dismissal, and generation-fenced merge queue operations.
10
+ - Extend repository public reads with pull request details and conversation data.
11
+
3
12
  ## 2026-07-21 - 0.8.0
4
13
 
5
14
  ### Features
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@foss.global/interfaces',
6
- version: '0.8.0',
6
+ version: '0.9.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the foss.global Git platform ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx5QkFBeUI7SUFDL0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHFHQUFxRztDQUNuSCxDQUFBIn0=
@@ -111,6 +111,72 @@ export interface IPublicIssueComment {
111
111
  updatedAt: string;
112
112
  user: IPublicUser;
113
113
  }
114
+ export type TRepositoryPullRequestState = 'open' | 'closed' | 'merged';
115
+ export type TRepositoryPullRequestMergeMethod = 'merge' | 'squash' | 'rebase';
116
+ export type TRepositoryPullRequestMergeState = 'checking' | 'clean' | 'conflicting' | 'blocked' | 'queued' | 'merging' | 'merged' | 'failed';
117
+ export type TRepositoryPullRequestReviewState = 'commented' | 'approved' | 'changes_requested' | 'dismissed';
118
+ export type TRepositoryPullRequestReviewSide = 'base' | 'head';
119
+ export interface IPublicPullRequest {
120
+ number: number;
121
+ title: string;
122
+ body: string;
123
+ htmlUrl: string;
124
+ state: TRepositoryPullRequestState;
125
+ draft: boolean;
126
+ sourceOrg: string;
127
+ sourceRepo: string;
128
+ sourceRef: string;
129
+ targetRef: string;
130
+ sourceObjectId: string;
131
+ targetObjectId: string;
132
+ mergeState: TRepositoryPullRequestMergeState;
133
+ mergeable: boolean | null;
134
+ mergeMethod: TRepositoryPullRequestMergeMethod | null;
135
+ mergeCommitId: string | null;
136
+ queuePosition: number | null;
137
+ comments: number;
138
+ reviews: number;
139
+ approvals: number;
140
+ changesRequested: number;
141
+ createdAt: string;
142
+ updatedAt: string;
143
+ closedAt: string | null;
144
+ mergedAt: string | null;
145
+ user: IPublicUser;
146
+ mergedBy: IPublicUser | null;
147
+ }
148
+ export interface IPublicPullRequestComment {
149
+ id: number;
150
+ body: string;
151
+ htmlUrl: string;
152
+ createdAt: string;
153
+ updatedAt: string;
154
+ user: IPublicUser;
155
+ }
156
+ export interface IPublicPullRequestReview {
157
+ id: number;
158
+ body: string;
159
+ htmlUrl: string;
160
+ state: TRepositoryPullRequestReviewState;
161
+ commitId: string;
162
+ submittedAt: string;
163
+ dismissedAt: string | null;
164
+ user: IPublicUser;
165
+ }
166
+ export interface IPublicPullRequestReviewComment {
167
+ id: number;
168
+ reviewId: number;
169
+ body: string;
170
+ path: string;
171
+ side: TRepositoryPullRequestReviewSide;
172
+ line: number;
173
+ commitId: string;
174
+ stale: boolean;
175
+ htmlUrl: string;
176
+ createdAt: string;
177
+ updatedAt: string;
178
+ user: IPublicUser;
179
+ }
114
180
  export interface IPublicCommit {
115
181
  sha: string;
116
182
  shortSha: string;
@@ -42,6 +42,7 @@ export interface IReq_PublicRepo extends plugins.typedrequestInterfaces.implemen
42
42
  repo: string;
43
43
  path?: string;
44
44
  issueNumber?: number;
45
+ pullRequestNumber?: number;
45
46
  };
46
47
  response: {
47
48
  repo: data.IPublicRepo | null;
@@ -52,6 +53,11 @@ export interface IReq_PublicRepo extends plugins.typedrequestInterfaces.implemen
52
53
  issues: data.IPublicIssue[];
53
54
  selectedIssue: data.IPublicIssue | null;
54
55
  selectedIssueComments: data.IPublicIssueComment[];
56
+ pullRequests: data.IPublicPullRequest[];
57
+ selectedPullRequest: data.IPublicPullRequest | null;
58
+ selectedPullRequestComments: data.IPublicPullRequestComment[];
59
+ selectedPullRequestReviews: data.IPublicPullRequestReview[];
60
+ selectedPullRequestReviewComments: data.IPublicPullRequestReviewComment[];
55
61
  commits: data.IPublicCommit[];
56
62
  languages: Record<string, number>;
57
63
  };
@@ -170,3 +176,114 @@ export interface IReq_RepositoryIssueStateUpdate extends plugins.typedrequestInt
170
176
  issue: data.IPublicIssue;
171
177
  };
172
178
  }
179
+ export interface IReq_RepositoryPullRequestCreate extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryPullRequestCreate> {
180
+ method: 'repositoryPullRequestCreate';
181
+ request: {
182
+ org: string;
183
+ repo: string;
184
+ title: string;
185
+ body: string;
186
+ sourceOrg: string;
187
+ sourceRepo: string;
188
+ sourceRef: string;
189
+ targetRef: string;
190
+ draft: boolean;
191
+ accessToken: string;
192
+ };
193
+ response: {
194
+ pullRequest: data.IPublicPullRequest;
195
+ };
196
+ }
197
+ export interface IReq_RepositoryPullRequestCommentCreate extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryPullRequestCommentCreate> {
198
+ method: 'repositoryPullRequestCommentCreate';
199
+ request: {
200
+ org: string;
201
+ repo: string;
202
+ pullRequestNumber: number;
203
+ body: string;
204
+ accessToken: string;
205
+ };
206
+ response: {
207
+ comment: data.IPublicPullRequestComment;
208
+ };
209
+ }
210
+ export interface IReq_RepositoryPullRequestStateUpdate extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryPullRequestStateUpdate> {
211
+ method: 'repositoryPullRequestStateUpdate';
212
+ request: {
213
+ org: string;
214
+ repo: string;
215
+ pullRequestNumber: number;
216
+ state: 'open' | 'closed';
217
+ draft?: boolean;
218
+ accessToken: string;
219
+ };
220
+ response: {
221
+ pullRequest: data.IPublicPullRequest;
222
+ };
223
+ }
224
+ export interface IRepositoryPullRequestReviewCommentInput {
225
+ body: string;
226
+ path: string;
227
+ side: data.TRepositoryPullRequestReviewSide;
228
+ line: number;
229
+ }
230
+ export interface IReq_RepositoryPullRequestReviewSubmit extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryPullRequestReviewSubmit> {
231
+ method: 'repositoryPullRequestReviewSubmit';
232
+ request: {
233
+ org: string;
234
+ repo: string;
235
+ pullRequestNumber: number;
236
+ state: Exclude<data.TRepositoryPullRequestReviewState, 'dismissed'>;
237
+ body: string;
238
+ commitId: string;
239
+ comments: IRepositoryPullRequestReviewCommentInput[];
240
+ accessToken: string;
241
+ };
242
+ response: {
243
+ review: data.IPublicPullRequestReview;
244
+ comments: data.IPublicPullRequestReviewComment[];
245
+ pullRequest: data.IPublicPullRequest;
246
+ };
247
+ }
248
+ export interface IReq_RepositoryPullRequestReviewDismiss extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryPullRequestReviewDismiss> {
249
+ method: 'repositoryPullRequestReviewDismiss';
250
+ request: {
251
+ org: string;
252
+ repo: string;
253
+ pullRequestNumber: number;
254
+ reviewId: number;
255
+ message: string;
256
+ accessToken: string;
257
+ };
258
+ response: {
259
+ review: data.IPublicPullRequestReview;
260
+ pullRequest: data.IPublicPullRequest;
261
+ };
262
+ }
263
+ export interface IReq_RepositoryPullRequestMergeEnqueue extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryPullRequestMergeEnqueue> {
264
+ method: 'repositoryPullRequestMergeEnqueue';
265
+ request: {
266
+ org: string;
267
+ repo: string;
268
+ pullRequestNumber: number;
269
+ method: data.TRepositoryPullRequestMergeMethod;
270
+ expectedSourceObjectId: string;
271
+ expectedTargetObjectId: string;
272
+ accessToken: string;
273
+ };
274
+ response: {
275
+ pullRequest: data.IPublicPullRequest;
276
+ };
277
+ }
278
+ export interface IReq_RepositoryPullRequestMergeCancel extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryPullRequestMergeCancel> {
279
+ method: 'repositoryPullRequestMergeCancel';
280
+ request: {
281
+ org: string;
282
+ repo: string;
283
+ pullRequestNumber: number;
284
+ accessToken: string;
285
+ };
286
+ response: {
287
+ pullRequest: data.IPublicPullRequest;
288
+ };
289
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foss.global/interfaces",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the foss.global Git platform ecosystem.",
6
6
  "exports": {
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@foss.global/interfaces',
6
- version: '0.8.0',
6
+ version: '0.9.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the foss.global Git platform ecosystem.'
8
8
  }
package/ts/data/public.ts CHANGED
@@ -135,6 +135,93 @@ export interface IPublicIssueComment {
135
135
  user: IPublicUser;
136
136
  }
137
137
 
138
+ export type TRepositoryPullRequestState = 'open' | 'closed' | 'merged';
139
+
140
+ export type TRepositoryPullRequestMergeMethod = 'merge' | 'squash' | 'rebase';
141
+
142
+ export type TRepositoryPullRequestMergeState =
143
+ | 'checking'
144
+ | 'clean'
145
+ | 'conflicting'
146
+ | 'blocked'
147
+ | 'queued'
148
+ | 'merging'
149
+ | 'merged'
150
+ | 'failed';
151
+
152
+ export type TRepositoryPullRequestReviewState =
153
+ | 'commented'
154
+ | 'approved'
155
+ | 'changes_requested'
156
+ | 'dismissed';
157
+
158
+ export type TRepositoryPullRequestReviewSide = 'base' | 'head';
159
+
160
+ export interface IPublicPullRequest {
161
+ number: number;
162
+ title: string;
163
+ body: string;
164
+ htmlUrl: string;
165
+ state: TRepositoryPullRequestState;
166
+ draft: boolean;
167
+ sourceOrg: string;
168
+ sourceRepo: string;
169
+ sourceRef: string;
170
+ targetRef: string;
171
+ sourceObjectId: string;
172
+ targetObjectId: string;
173
+ mergeState: TRepositoryPullRequestMergeState;
174
+ mergeable: boolean | null;
175
+ mergeMethod: TRepositoryPullRequestMergeMethod | null;
176
+ mergeCommitId: string | null;
177
+ queuePosition: number | null;
178
+ comments: number;
179
+ reviews: number;
180
+ approvals: number;
181
+ changesRequested: number;
182
+ createdAt: string;
183
+ updatedAt: string;
184
+ closedAt: string | null;
185
+ mergedAt: string | null;
186
+ user: IPublicUser;
187
+ mergedBy: IPublicUser | null;
188
+ }
189
+
190
+ export interface IPublicPullRequestComment {
191
+ id: number;
192
+ body: string;
193
+ htmlUrl: string;
194
+ createdAt: string;
195
+ updatedAt: string;
196
+ user: IPublicUser;
197
+ }
198
+
199
+ export interface IPublicPullRequestReview {
200
+ id: number;
201
+ body: string;
202
+ htmlUrl: string;
203
+ state: TRepositoryPullRequestReviewState;
204
+ commitId: string;
205
+ submittedAt: string;
206
+ dismissedAt: string | null;
207
+ user: IPublicUser;
208
+ }
209
+
210
+ export interface IPublicPullRequestReviewComment {
211
+ id: number;
212
+ reviewId: number;
213
+ body: string;
214
+ path: string;
215
+ side: TRepositoryPullRequestReviewSide;
216
+ line: number;
217
+ commitId: string;
218
+ stale: boolean;
219
+ htmlUrl: string;
220
+ createdAt: string;
221
+ updatedAt: string;
222
+ user: IPublicUser;
223
+ }
224
+
138
225
  export interface IPublicCommit {
139
226
  sha: string;
140
227
  shortSha: string;
@@ -62,6 +62,7 @@ export interface IReq_PublicRepo
62
62
  repo: string;
63
63
  path?: string;
64
64
  issueNumber?: number;
65
+ pullRequestNumber?: number;
65
66
  };
66
67
  response: {
67
68
  repo: data.IPublicRepo | null;
@@ -72,6 +73,11 @@ export interface IReq_PublicRepo
72
73
  issues: data.IPublicIssue[];
73
74
  selectedIssue: data.IPublicIssue | null;
74
75
  selectedIssueComments: data.IPublicIssueComment[];
76
+ pullRequests: data.IPublicPullRequest[];
77
+ selectedPullRequest: data.IPublicPullRequest | null;
78
+ selectedPullRequestComments: data.IPublicPullRequestComment[];
79
+ selectedPullRequestReviews: data.IPublicPullRequestReview[];
80
+ selectedPullRequestReviewComments: data.IPublicPullRequestReviewComment[];
75
81
  commits: data.IPublicCommit[];
76
82
  languages: Record<string, number>;
77
83
  };
@@ -235,3 +241,150 @@ export interface IReq_RepositoryIssueStateUpdate
235
241
  issue: data.IPublicIssue;
236
242
  };
237
243
  }
244
+
245
+ export interface IReq_RepositoryPullRequestCreate
246
+ extends plugins.typedrequestInterfaces.implementsTR<
247
+ plugins.typedrequestInterfaces.ITypedRequest,
248
+ IReq_RepositoryPullRequestCreate
249
+ > {
250
+ method: 'repositoryPullRequestCreate';
251
+ request: {
252
+ org: string;
253
+ repo: string;
254
+ title: string;
255
+ body: string;
256
+ sourceOrg: string;
257
+ sourceRepo: string;
258
+ sourceRef: string;
259
+ targetRef: string;
260
+ draft: boolean;
261
+ accessToken: string;
262
+ };
263
+ response: {
264
+ pullRequest: data.IPublicPullRequest;
265
+ };
266
+ }
267
+
268
+ export interface IReq_RepositoryPullRequestCommentCreate
269
+ extends plugins.typedrequestInterfaces.implementsTR<
270
+ plugins.typedrequestInterfaces.ITypedRequest,
271
+ IReq_RepositoryPullRequestCommentCreate
272
+ > {
273
+ method: 'repositoryPullRequestCommentCreate';
274
+ request: {
275
+ org: string;
276
+ repo: string;
277
+ pullRequestNumber: number;
278
+ body: string;
279
+ accessToken: string;
280
+ };
281
+ response: {
282
+ comment: data.IPublicPullRequestComment;
283
+ };
284
+ }
285
+
286
+ export interface IReq_RepositoryPullRequestStateUpdate
287
+ extends plugins.typedrequestInterfaces.implementsTR<
288
+ plugins.typedrequestInterfaces.ITypedRequest,
289
+ IReq_RepositoryPullRequestStateUpdate
290
+ > {
291
+ method: 'repositoryPullRequestStateUpdate';
292
+ request: {
293
+ org: string;
294
+ repo: string;
295
+ pullRequestNumber: number;
296
+ state: 'open' | 'closed';
297
+ draft?: boolean;
298
+ accessToken: string;
299
+ };
300
+ response: {
301
+ pullRequest: data.IPublicPullRequest;
302
+ };
303
+ }
304
+
305
+ export interface IRepositoryPullRequestReviewCommentInput {
306
+ body: string;
307
+ path: string;
308
+ side: data.TRepositoryPullRequestReviewSide;
309
+ line: number;
310
+ }
311
+
312
+ export interface IReq_RepositoryPullRequestReviewSubmit
313
+ extends plugins.typedrequestInterfaces.implementsTR<
314
+ plugins.typedrequestInterfaces.ITypedRequest,
315
+ IReq_RepositoryPullRequestReviewSubmit
316
+ > {
317
+ method: 'repositoryPullRequestReviewSubmit';
318
+ request: {
319
+ org: string;
320
+ repo: string;
321
+ pullRequestNumber: number;
322
+ state: Exclude<data.TRepositoryPullRequestReviewState, 'dismissed'>;
323
+ body: string;
324
+ commitId: string;
325
+ comments: IRepositoryPullRequestReviewCommentInput[];
326
+ accessToken: string;
327
+ };
328
+ response: {
329
+ review: data.IPublicPullRequestReview;
330
+ comments: data.IPublicPullRequestReviewComment[];
331
+ pullRequest: data.IPublicPullRequest;
332
+ };
333
+ }
334
+
335
+ export interface IReq_RepositoryPullRequestReviewDismiss
336
+ extends plugins.typedrequestInterfaces.implementsTR<
337
+ plugins.typedrequestInterfaces.ITypedRequest,
338
+ IReq_RepositoryPullRequestReviewDismiss
339
+ > {
340
+ method: 'repositoryPullRequestReviewDismiss';
341
+ request: {
342
+ org: string;
343
+ repo: string;
344
+ pullRequestNumber: number;
345
+ reviewId: number;
346
+ message: string;
347
+ accessToken: string;
348
+ };
349
+ response: {
350
+ review: data.IPublicPullRequestReview;
351
+ pullRequest: data.IPublicPullRequest;
352
+ };
353
+ }
354
+
355
+ export interface IReq_RepositoryPullRequestMergeEnqueue
356
+ extends plugins.typedrequestInterfaces.implementsTR<
357
+ plugins.typedrequestInterfaces.ITypedRequest,
358
+ IReq_RepositoryPullRequestMergeEnqueue
359
+ > {
360
+ method: 'repositoryPullRequestMergeEnqueue';
361
+ request: {
362
+ org: string;
363
+ repo: string;
364
+ pullRequestNumber: number;
365
+ method: data.TRepositoryPullRequestMergeMethod;
366
+ expectedSourceObjectId: string;
367
+ expectedTargetObjectId: string;
368
+ accessToken: string;
369
+ };
370
+ response: {
371
+ pullRequest: data.IPublicPullRequest;
372
+ };
373
+ }
374
+
375
+ export interface IReq_RepositoryPullRequestMergeCancel
376
+ extends plugins.typedrequestInterfaces.implementsTR<
377
+ plugins.typedrequestInterfaces.ITypedRequest,
378
+ IReq_RepositoryPullRequestMergeCancel
379
+ > {
380
+ method: 'repositoryPullRequestMergeCancel';
381
+ request: {
382
+ org: string;
383
+ repo: string;
384
+ pullRequestNumber: number;
385
+ accessToken: string;
386
+ };
387
+ response: {
388
+ pullRequest: data.IPublicPullRequest;
389
+ };
390
+ }