@usine/github 0.0.1 → 0.1.1

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 (70) hide show
  1. package/README.md +117 -2
  2. package/dist/access.d.ts +48 -0
  3. package/dist/access.d.ts.map +1 -0
  4. package/dist/access.js +53 -0
  5. package/dist/access.js.map +1 -0
  6. package/dist/credentials.d.ts +28 -0
  7. package/dist/credentials.d.ts.map +1 -0
  8. package/dist/credentials.js +22 -0
  9. package/dist/credentials.js.map +1 -0
  10. package/dist/error.d.ts +36 -0
  11. package/dist/error.d.ts.map +1 -0
  12. package/dist/error.js +48 -0
  13. package/dist/error.js.map +1 -0
  14. package/dist/github-app.d.ts +30 -0
  15. package/dist/github-app.d.ts.map +1 -0
  16. package/dist/github-app.js +184 -0
  17. package/dist/github-app.js.map +1 -0
  18. package/dist/http.d.ts +18 -0
  19. package/dist/http.d.ts.map +1 -0
  20. package/dist/http.js +68 -0
  21. package/dist/http.js.map +1 -0
  22. package/dist/installation.d.ts +48 -0
  23. package/dist/installation.d.ts.map +1 -0
  24. package/dist/installation.js +40 -0
  25. package/dist/installation.js.map +1 -0
  26. package/dist/item-writer.d.ts +23 -0
  27. package/dist/item-writer.d.ts.map +1 -0
  28. package/dist/item-writer.js +67 -0
  29. package/dist/item-writer.js.map +1 -0
  30. package/dist/jwt.d.ts +11 -0
  31. package/dist/jwt.d.ts.map +1 -0
  32. package/dist/jwt.js +72 -0
  33. package/dist/jwt.js.map +1 -0
  34. package/dist/label-writer.d.ts +23 -0
  35. package/dist/label-writer.d.ts.map +1 -0
  36. package/dist/label-writer.js +54 -0
  37. package/dist/label-writer.js.map +1 -0
  38. package/dist/local-secrets.d.ts +28 -0
  39. package/dist/local-secrets.d.ts.map +1 -0
  40. package/dist/local-secrets.js +56 -0
  41. package/dist/local-secrets.js.map +1 -0
  42. package/dist/polling/content.d.ts +3 -0
  43. package/dist/polling/content.d.ts.map +1 -0
  44. package/dist/polling/content.js +24 -0
  45. package/dist/polling/content.js.map +1 -0
  46. package/dist/polling/detection.d.ts +55 -0
  47. package/dist/polling/detection.d.ts.map +1 -0
  48. package/dist/polling/detection.js +49 -0
  49. package/dist/polling/detection.js.map +1 -0
  50. package/dist/polling/labels.d.ts +31 -0
  51. package/dist/polling/labels.d.ts.map +1 -0
  52. package/dist/polling/labels.js +29 -0
  53. package/dist/polling/labels.js.map +1 -0
  54. package/dist/polling/payload.d.ts +565 -0
  55. package/dist/polling/payload.d.ts.map +1 -0
  56. package/dist/polling/payload.js +128 -0
  57. package/dist/polling/payload.js.map +1 -0
  58. package/dist/polling/polling.d.ts +24 -0
  59. package/dist/polling/polling.d.ts.map +1 -0
  60. package/dist/polling/polling.js +325 -0
  61. package/dist/polling/polling.js.map +1 -0
  62. package/dist/polling/queries.d.ts +3 -0
  63. package/dist/polling/queries.d.ts.map +1 -0
  64. package/dist/polling/queries.js +125 -0
  65. package/dist/polling/queries.js.map +1 -0
  66. package/package.json +32 -6
  67. package/dist/index.d.ts +0 -8
  68. package/dist/index.d.ts.map +0 -1
  69. package/dist/index.js +0 -8
  70. package/dist/index.js.map +0 -1
@@ -0,0 +1,565 @@
1
+ import { Schema } from "effect";
2
+ /** The issue payload slice that `if:` expressions and prompt interpolation range over. */
3
+ export declare const IssuePayload: Schema.Struct<{
4
+ readonly number: Schema.Int;
5
+ readonly title: Schema.String;
6
+ readonly body: Schema.String;
7
+ readonly url: Schema.NonEmptyString;
8
+ readonly state: Schema.String;
9
+ readonly stateReason: Schema.NullOr<Schema.String>;
10
+ readonly createdAt: Schema.String;
11
+ readonly updatedAt: Schema.String;
12
+ readonly closedAt: Schema.NullOr<Schema.String>;
13
+ readonly author: Schema.NullOr<Schema.Struct<{
14
+ readonly login: Schema.NonEmptyString;
15
+ }>>;
16
+ readonly issueType: Schema.NullOr<Schema.Struct<{
17
+ readonly name: Schema.String;
18
+ }>>;
19
+ readonly milestone: Schema.NullOr<Schema.Struct<{
20
+ readonly title: Schema.String;
21
+ }>>;
22
+ readonly labels: Schema.decodeTo<Schema.Codec<{
23
+ readonly totalCount: number;
24
+ readonly nodes: readonly {
25
+ readonly name: string;
26
+ }[];
27
+ }, {
28
+ readonly totalCount: number;
29
+ readonly nodes: readonly {
30
+ readonly name: string;
31
+ }[];
32
+ }, never, never>, Schema.NullOr<Schema.Codec<{
33
+ readonly totalCount: number;
34
+ readonly nodes: readonly {
35
+ readonly name: string;
36
+ }[];
37
+ }, {
38
+ readonly totalCount: number;
39
+ readonly nodes: readonly {
40
+ readonly name: string;
41
+ }[];
42
+ }, never, never>>, never, never>;
43
+ readonly assignees: Schema.Struct<{
44
+ readonly totalCount: Schema.Int;
45
+ readonly nodes: Schema.$Array<Schema.Struct<{
46
+ readonly login: Schema.NonEmptyString;
47
+ }>>;
48
+ }>;
49
+ readonly comments: Schema.Struct<{
50
+ readonly totalCount: Schema.Int;
51
+ readonly nodes: Schema.$Array<Schema.Struct<{
52
+ readonly author: Schema.NullOr<Schema.Struct<{
53
+ readonly login: Schema.NonEmptyString;
54
+ }>>;
55
+ readonly body: Schema.String;
56
+ readonly createdAt: Schema.String;
57
+ }>>;
58
+ }>;
59
+ readonly closedByPullRequestsReferences: Schema.decodeTo<Schema.Codec<{
60
+ readonly totalCount: number;
61
+ readonly nodes: readonly {
62
+ readonly number: number;
63
+ readonly state: string;
64
+ readonly isDraft: boolean;
65
+ readonly url: string;
66
+ }[];
67
+ }, {
68
+ readonly totalCount: number;
69
+ readonly nodes: readonly {
70
+ readonly number: number;
71
+ readonly state: string;
72
+ readonly isDraft: boolean;
73
+ readonly url: string;
74
+ }[];
75
+ }, never, never>, Schema.NullOr<Schema.Codec<{
76
+ readonly totalCount: number;
77
+ readonly nodes: readonly {
78
+ readonly number: number;
79
+ readonly state: string;
80
+ readonly isDraft: boolean;
81
+ readonly url: string;
82
+ }[];
83
+ }, {
84
+ readonly totalCount: number;
85
+ readonly nodes: readonly {
86
+ readonly number: number;
87
+ readonly state: string;
88
+ readonly isDraft: boolean;
89
+ readonly url: string;
90
+ }[];
91
+ }, never, never>>, never, never>;
92
+ }>;
93
+ export type IssuePayload = typeof IssuePayload.Type;
94
+ /** The pull-request payload slice that `if:` expressions and prompt interpolation range over. */
95
+ export declare const PullRequestPayload: Schema.Struct<{
96
+ readonly number: Schema.Int;
97
+ readonly title: Schema.String;
98
+ readonly body: Schema.String;
99
+ readonly url: Schema.NonEmptyString;
100
+ readonly state: Schema.String;
101
+ readonly isDraft: Schema.Boolean;
102
+ readonly merged: Schema.Boolean;
103
+ readonly createdAt: Schema.String;
104
+ readonly updatedAt: Schema.String;
105
+ readonly mergedAt: Schema.NullOr<Schema.String>;
106
+ readonly author: Schema.NullOr<Schema.Struct<{
107
+ readonly login: Schema.NonEmptyString;
108
+ }>>;
109
+ readonly baseRefName: Schema.String;
110
+ readonly headRefName: Schema.String;
111
+ readonly headRefOid: Schema.NonEmptyString;
112
+ readonly additions: Schema.Int;
113
+ readonly deletions: Schema.Int;
114
+ readonly changedFiles: Schema.Int;
115
+ readonly reviewDecision: Schema.NullOr<Schema.String>;
116
+ readonly statusCheckRollup: Schema.NullOr<Schema.Struct<{
117
+ readonly state: Schema.String;
118
+ }>>;
119
+ readonly labels: Schema.decodeTo<Schema.Codec<{
120
+ readonly totalCount: number;
121
+ readonly nodes: readonly {
122
+ readonly name: string;
123
+ }[];
124
+ }, {
125
+ readonly totalCount: number;
126
+ readonly nodes: readonly {
127
+ readonly name: string;
128
+ }[];
129
+ }, never, never>, Schema.NullOr<Schema.Codec<{
130
+ readonly totalCount: number;
131
+ readonly nodes: readonly {
132
+ readonly name: string;
133
+ }[];
134
+ }, {
135
+ readonly totalCount: number;
136
+ readonly nodes: readonly {
137
+ readonly name: string;
138
+ }[];
139
+ }, never, never>>, never, never>;
140
+ readonly reviewRequests: Schema.decodeTo<Schema.Codec<{
141
+ readonly totalCount: number;
142
+ readonly nodes: readonly {
143
+ readonly requestedReviewer: {
144
+ readonly login?: string;
145
+ } | null;
146
+ }[];
147
+ }, {
148
+ readonly totalCount: number;
149
+ readonly nodes: readonly {
150
+ readonly requestedReviewer: {
151
+ readonly login?: string;
152
+ } | null;
153
+ }[];
154
+ }, never, never>, Schema.NullOr<Schema.Codec<{
155
+ readonly totalCount: number;
156
+ readonly nodes: readonly {
157
+ readonly requestedReviewer: {
158
+ readonly login?: string;
159
+ } | null;
160
+ }[];
161
+ }, {
162
+ readonly totalCount: number;
163
+ readonly nodes: readonly {
164
+ readonly requestedReviewer: {
165
+ readonly login?: string;
166
+ } | null;
167
+ }[];
168
+ }, never, never>>, never, never>;
169
+ readonly reviews: Schema.decodeTo<Schema.Codec<{
170
+ readonly totalCount: number;
171
+ readonly nodes: readonly {
172
+ readonly author: {
173
+ readonly login: string;
174
+ } | null;
175
+ readonly state: string;
176
+ readonly body: string;
177
+ readonly submittedAt: string | null;
178
+ readonly commit: {
179
+ readonly oid: string;
180
+ } | null;
181
+ }[];
182
+ }, {
183
+ readonly totalCount: number;
184
+ readonly nodes: readonly {
185
+ readonly author: {
186
+ readonly login: string;
187
+ } | null;
188
+ readonly state: string;
189
+ readonly body: string;
190
+ readonly submittedAt: string | null;
191
+ readonly commit: {
192
+ readonly oid: string;
193
+ } | null;
194
+ }[];
195
+ }, never, never>, Schema.NullOr<Schema.Codec<{
196
+ readonly totalCount: number;
197
+ readonly nodes: readonly {
198
+ readonly author: {
199
+ readonly login: string;
200
+ } | null;
201
+ readonly state: string;
202
+ readonly body: string;
203
+ readonly submittedAt: string | null;
204
+ readonly commit: {
205
+ readonly oid: string;
206
+ } | null;
207
+ }[];
208
+ }, {
209
+ readonly totalCount: number;
210
+ readonly nodes: readonly {
211
+ readonly author: {
212
+ readonly login: string;
213
+ } | null;
214
+ readonly state: string;
215
+ readonly body: string;
216
+ readonly submittedAt: string | null;
217
+ readonly commit: {
218
+ readonly oid: string;
219
+ } | null;
220
+ }[];
221
+ }, never, never>>, never, never>;
222
+ readonly reviewThreads: Schema.Struct<{
223
+ readonly totalCount: Schema.Int;
224
+ readonly nodes: Schema.$Array<Schema.Struct<{
225
+ readonly isResolved: Schema.Boolean;
226
+ readonly isOutdated: Schema.Boolean;
227
+ readonly path: Schema.String;
228
+ readonly comments: Schema.Struct<{
229
+ readonly totalCount: Schema.Int;
230
+ readonly nodes: Schema.$Array<Schema.Struct<{
231
+ readonly author: Schema.NullOr<Schema.Struct<{
232
+ readonly login: Schema.NonEmptyString;
233
+ }>>;
234
+ readonly body: Schema.String;
235
+ }>>;
236
+ }>;
237
+ }>>;
238
+ }>;
239
+ readonly comments: Schema.Struct<{
240
+ readonly totalCount: Schema.Int;
241
+ readonly nodes: Schema.$Array<Schema.Struct<{
242
+ readonly author: Schema.NullOr<Schema.Struct<{
243
+ readonly login: Schema.NonEmptyString;
244
+ }>>;
245
+ readonly body: Schema.String;
246
+ readonly createdAt: Schema.String;
247
+ }>>;
248
+ }>;
249
+ readonly closingIssuesReferences: Schema.decodeTo<Schema.Codec<{
250
+ readonly totalCount: number;
251
+ readonly nodes: readonly {
252
+ readonly number: number;
253
+ readonly state: string;
254
+ }[];
255
+ }, {
256
+ readonly totalCount: number;
257
+ readonly nodes: readonly {
258
+ readonly number: number;
259
+ readonly state: string;
260
+ }[];
261
+ }, never, never>, Schema.NullOr<Schema.Codec<{
262
+ readonly totalCount: number;
263
+ readonly nodes: readonly {
264
+ readonly number: number;
265
+ readonly state: string;
266
+ }[];
267
+ }, {
268
+ readonly totalCount: number;
269
+ readonly nodes: readonly {
270
+ readonly number: number;
271
+ readonly state: string;
272
+ }[];
273
+ }, never, never>>, never, never>;
274
+ }>;
275
+ export type PullRequestPayload = typeof PullRequestPayload.Type;
276
+ /** Identifies an Item's payload content for Event deduplication; timestamp-only changes keep the same hash. */
277
+ export declare const ContentHash: Schema.brand<Schema.String, "GitHubContentHash">;
278
+ export type ContentHash = typeof ContentHash.Type;
279
+ declare const IssueSnapshot_base: Schema.Class<IssueSnapshot, Schema.TaggedStruct<"IssueSnapshot", {
280
+ readonly payload: Schema.Struct<{
281
+ readonly number: Schema.Int;
282
+ readonly title: Schema.String;
283
+ readonly body: Schema.String;
284
+ readonly url: Schema.NonEmptyString;
285
+ readonly state: Schema.String;
286
+ readonly stateReason: Schema.NullOr<Schema.String>;
287
+ readonly createdAt: Schema.String;
288
+ readonly updatedAt: Schema.String;
289
+ readonly closedAt: Schema.NullOr<Schema.String>;
290
+ readonly author: Schema.NullOr<Schema.Struct<{
291
+ readonly login: Schema.NonEmptyString;
292
+ }>>;
293
+ readonly issueType: Schema.NullOr<Schema.Struct<{
294
+ readonly name: Schema.String;
295
+ }>>;
296
+ readonly milestone: Schema.NullOr<Schema.Struct<{
297
+ readonly title: Schema.String;
298
+ }>>;
299
+ readonly labels: Schema.decodeTo<Schema.Codec<{
300
+ readonly totalCount: number;
301
+ readonly nodes: readonly {
302
+ readonly name: string;
303
+ }[];
304
+ }, {
305
+ readonly totalCount: number;
306
+ readonly nodes: readonly {
307
+ readonly name: string;
308
+ }[];
309
+ }, never, never>, Schema.NullOr<Schema.Codec<{
310
+ readonly totalCount: number;
311
+ readonly nodes: readonly {
312
+ readonly name: string;
313
+ }[];
314
+ }, {
315
+ readonly totalCount: number;
316
+ readonly nodes: readonly {
317
+ readonly name: string;
318
+ }[];
319
+ }, never, never>>, never, never>;
320
+ readonly assignees: Schema.Struct<{
321
+ readonly totalCount: Schema.Int;
322
+ readonly nodes: Schema.$Array<Schema.Struct<{
323
+ readonly login: Schema.NonEmptyString;
324
+ }>>;
325
+ }>;
326
+ readonly comments: Schema.Struct<{
327
+ readonly totalCount: Schema.Int;
328
+ readonly nodes: Schema.$Array<Schema.Struct<{
329
+ readonly author: Schema.NullOr<Schema.Struct<{
330
+ readonly login: Schema.NonEmptyString;
331
+ }>>;
332
+ readonly body: Schema.String;
333
+ readonly createdAt: Schema.String;
334
+ }>>;
335
+ }>;
336
+ readonly closedByPullRequestsReferences: Schema.decodeTo<Schema.Codec<{
337
+ readonly totalCount: number;
338
+ readonly nodes: readonly {
339
+ readonly number: number;
340
+ readonly state: string;
341
+ readonly isDraft: boolean;
342
+ readonly url: string;
343
+ }[];
344
+ }, {
345
+ readonly totalCount: number;
346
+ readonly nodes: readonly {
347
+ readonly number: number;
348
+ readonly state: string;
349
+ readonly isDraft: boolean;
350
+ readonly url: string;
351
+ }[];
352
+ }, never, never>, Schema.NullOr<Schema.Codec<{
353
+ readonly totalCount: number;
354
+ readonly nodes: readonly {
355
+ readonly number: number;
356
+ readonly state: string;
357
+ readonly isDraft: boolean;
358
+ readonly url: string;
359
+ }[];
360
+ }, {
361
+ readonly totalCount: number;
362
+ readonly nodes: readonly {
363
+ readonly number: number;
364
+ readonly state: string;
365
+ readonly isDraft: boolean;
366
+ readonly url: string;
367
+ }[];
368
+ }, never, never>>, never, never>;
369
+ }>;
370
+ readonly contentHash: Schema.brand<Schema.String, "GitHubContentHash">;
371
+ }>, {}>;
372
+ /** An issue's observed payload and the content identity used to decide whether it represents new work. */
373
+ export declare class IssueSnapshot extends IssueSnapshot_base {
374
+ }
375
+ declare const PullRequestSnapshot_base: Schema.Class<PullRequestSnapshot, Schema.TaggedStruct<"PullRequestSnapshot", {
376
+ readonly payload: Schema.Struct<{
377
+ readonly number: Schema.Int;
378
+ readonly title: Schema.String;
379
+ readonly body: Schema.String;
380
+ readonly url: Schema.NonEmptyString;
381
+ readonly state: Schema.String;
382
+ readonly isDraft: Schema.Boolean;
383
+ readonly merged: Schema.Boolean;
384
+ readonly createdAt: Schema.String;
385
+ readonly updatedAt: Schema.String;
386
+ readonly mergedAt: Schema.NullOr<Schema.String>;
387
+ readonly author: Schema.NullOr<Schema.Struct<{
388
+ readonly login: Schema.NonEmptyString;
389
+ }>>;
390
+ readonly baseRefName: Schema.String;
391
+ readonly headRefName: Schema.String;
392
+ readonly headRefOid: Schema.NonEmptyString;
393
+ readonly additions: Schema.Int;
394
+ readonly deletions: Schema.Int;
395
+ readonly changedFiles: Schema.Int;
396
+ readonly reviewDecision: Schema.NullOr<Schema.String>;
397
+ readonly statusCheckRollup: Schema.NullOr<Schema.Struct<{
398
+ readonly state: Schema.String;
399
+ }>>;
400
+ readonly labels: Schema.decodeTo<Schema.Codec<{
401
+ readonly totalCount: number;
402
+ readonly nodes: readonly {
403
+ readonly name: string;
404
+ }[];
405
+ }, {
406
+ readonly totalCount: number;
407
+ readonly nodes: readonly {
408
+ readonly name: string;
409
+ }[];
410
+ }, never, never>, Schema.NullOr<Schema.Codec<{
411
+ readonly totalCount: number;
412
+ readonly nodes: readonly {
413
+ readonly name: string;
414
+ }[];
415
+ }, {
416
+ readonly totalCount: number;
417
+ readonly nodes: readonly {
418
+ readonly name: string;
419
+ }[];
420
+ }, never, never>>, never, never>;
421
+ readonly reviewRequests: Schema.decodeTo<Schema.Codec<{
422
+ readonly totalCount: number;
423
+ readonly nodes: readonly {
424
+ readonly requestedReviewer: {
425
+ readonly login?: string;
426
+ } | null;
427
+ }[];
428
+ }, {
429
+ readonly totalCount: number;
430
+ readonly nodes: readonly {
431
+ readonly requestedReviewer: {
432
+ readonly login?: string;
433
+ } | null;
434
+ }[];
435
+ }, never, never>, Schema.NullOr<Schema.Codec<{
436
+ readonly totalCount: number;
437
+ readonly nodes: readonly {
438
+ readonly requestedReviewer: {
439
+ readonly login?: string;
440
+ } | null;
441
+ }[];
442
+ }, {
443
+ readonly totalCount: number;
444
+ readonly nodes: readonly {
445
+ readonly requestedReviewer: {
446
+ readonly login?: string;
447
+ } | null;
448
+ }[];
449
+ }, never, never>>, never, never>;
450
+ readonly reviews: Schema.decodeTo<Schema.Codec<{
451
+ readonly totalCount: number;
452
+ readonly nodes: readonly {
453
+ readonly author: {
454
+ readonly login: string;
455
+ } | null;
456
+ readonly state: string;
457
+ readonly body: string;
458
+ readonly submittedAt: string | null;
459
+ readonly commit: {
460
+ readonly oid: string;
461
+ } | null;
462
+ }[];
463
+ }, {
464
+ readonly totalCount: number;
465
+ readonly nodes: readonly {
466
+ readonly author: {
467
+ readonly login: string;
468
+ } | null;
469
+ readonly state: string;
470
+ readonly body: string;
471
+ readonly submittedAt: string | null;
472
+ readonly commit: {
473
+ readonly oid: string;
474
+ } | null;
475
+ }[];
476
+ }, never, never>, Schema.NullOr<Schema.Codec<{
477
+ readonly totalCount: number;
478
+ readonly nodes: readonly {
479
+ readonly author: {
480
+ readonly login: string;
481
+ } | null;
482
+ readonly state: string;
483
+ readonly body: string;
484
+ readonly submittedAt: string | null;
485
+ readonly commit: {
486
+ readonly oid: string;
487
+ } | null;
488
+ }[];
489
+ }, {
490
+ readonly totalCount: number;
491
+ readonly nodes: readonly {
492
+ readonly author: {
493
+ readonly login: string;
494
+ } | null;
495
+ readonly state: string;
496
+ readonly body: string;
497
+ readonly submittedAt: string | null;
498
+ readonly commit: {
499
+ readonly oid: string;
500
+ } | null;
501
+ }[];
502
+ }, never, never>>, never, never>;
503
+ readonly reviewThreads: Schema.Struct<{
504
+ readonly totalCount: Schema.Int;
505
+ readonly nodes: Schema.$Array<Schema.Struct<{
506
+ readonly isResolved: Schema.Boolean;
507
+ readonly isOutdated: Schema.Boolean;
508
+ readonly path: Schema.String;
509
+ readonly comments: Schema.Struct<{
510
+ readonly totalCount: Schema.Int;
511
+ readonly nodes: Schema.$Array<Schema.Struct<{
512
+ readonly author: Schema.NullOr<Schema.Struct<{
513
+ readonly login: Schema.NonEmptyString;
514
+ }>>;
515
+ readonly body: Schema.String;
516
+ }>>;
517
+ }>;
518
+ }>>;
519
+ }>;
520
+ readonly comments: Schema.Struct<{
521
+ readonly totalCount: Schema.Int;
522
+ readonly nodes: Schema.$Array<Schema.Struct<{
523
+ readonly author: Schema.NullOr<Schema.Struct<{
524
+ readonly login: Schema.NonEmptyString;
525
+ }>>;
526
+ readonly body: Schema.String;
527
+ readonly createdAt: Schema.String;
528
+ }>>;
529
+ }>;
530
+ readonly closingIssuesReferences: Schema.decodeTo<Schema.Codec<{
531
+ readonly totalCount: number;
532
+ readonly nodes: readonly {
533
+ readonly number: number;
534
+ readonly state: string;
535
+ }[];
536
+ }, {
537
+ readonly totalCount: number;
538
+ readonly nodes: readonly {
539
+ readonly number: number;
540
+ readonly state: string;
541
+ }[];
542
+ }, never, never>, Schema.NullOr<Schema.Codec<{
543
+ readonly totalCount: number;
544
+ readonly nodes: readonly {
545
+ readonly number: number;
546
+ readonly state: string;
547
+ }[];
548
+ }, {
549
+ readonly totalCount: number;
550
+ readonly nodes: readonly {
551
+ readonly number: number;
552
+ readonly state: string;
553
+ }[];
554
+ }, never, never>>, never, never>;
555
+ }>;
556
+ readonly contentHash: Schema.brand<Schema.String, "GitHubContentHash">;
557
+ }>, {}>;
558
+ /** A pull request's observed payload and the content identity used to decide whether it represents new work. */
559
+ export declare class PullRequestSnapshot extends PullRequestSnapshot_base {
560
+ }
561
+ /** The fetched Item state shared by selection, prompt rendering, and Event deduplication. */
562
+ export declare const PayloadSnapshot: Schema.Union<readonly [typeof IssueSnapshot, typeof PullRequestSnapshot]>;
563
+ export type PayloadSnapshot = typeof PayloadSnapshot.Type;
564
+ export {};
565
+ //# sourceMappingURL=payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payload.d.ts","sourceRoot":"","sources":["../../src/polling/payload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,QAAQ,CAAC;AA8C9C,0FAA0F;AAC1F,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8BvB,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,IAAI,CAAC;AAiBpD,iGAAiG;AACjG,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsD7B,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,kBAAkB,CAAC,IAAI,CAAC;AAEhE,+GAA+G;AAC/G,eAAO,MAAM,WAAW,kDAEiB,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG,OAAO,WAAW,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElD,0GAA0G;AAC1G,qBAAa,aAAc,SAAQ,kBAMlC;CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEJ,gHAAgH;AAChH,qBAAa,mBAAoB,SAAQ,wBAKvC;CAAG;AAEL,6FAA6F;AAC7F,eAAO,MAAM,eAAe,2EAAqD,CAAC;AAClF,MAAM,MAAM,eAAe,GAAG,OAAO,eAAe,CAAC,IAAI,CAAC"}
@@ -0,0 +1,128 @@
1
+ import { Schema, SchemaGetter } from "effect";
2
+ const PositiveInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
3
+ const NonNegativeInt = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
4
+ const Timestamp = Schema.String.check(Schema.isPattern(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?Z$/u, {
5
+ message: "Expected a GitHub UTC timestamp",
6
+ }));
7
+ /**
8
+ * GitHub declares most GraphQL connections nullable, and a null connection means
9
+ * the same as an empty one. Decoding null to empty keeps the payload type
10
+ * non-null and hashes both shapes identically.
11
+ */
12
+ const orEmpty = (schema, empty) => Schema.NullOr(schema).pipe(Schema.decodeTo(schema, {
13
+ decode: SchemaGetter.transform((value) => value ?? empty),
14
+ encode: SchemaGetter.transform((value) => value),
15
+ }));
16
+ const emptyConnection = { totalCount: 0, nodes: [] };
17
+ const Actor = Schema.Struct({ login: Schema.NonEmptyString });
18
+ const NullableActor = Schema.NullOr(Actor);
19
+ const Label = Schema.Struct({ name: Schema.NonEmptyString });
20
+ const Labels = Schema.Struct({ totalCount: NonNegativeInt, nodes: Schema.Array(Label) });
21
+ const IssueComment = Schema.Struct({
22
+ author: NullableActor,
23
+ body: Schema.String,
24
+ createdAt: Timestamp,
25
+ });
26
+ const IssueComments = Schema.Struct({
27
+ totalCount: NonNegativeInt,
28
+ nodes: Schema.Array(IssueComment),
29
+ });
30
+ /** The issue payload slice that `if:` expressions and prompt interpolation range over. */
31
+ export const IssuePayload = Schema.Struct({
32
+ number: PositiveInt,
33
+ title: Schema.String,
34
+ body: Schema.String,
35
+ url: Schema.NonEmptyString,
36
+ state: Schema.String,
37
+ stateReason: Schema.NullOr(Schema.String),
38
+ createdAt: Timestamp,
39
+ updatedAt: Timestamp,
40
+ closedAt: Schema.NullOr(Timestamp),
41
+ author: NullableActor,
42
+ issueType: Schema.NullOr(Schema.Struct({ name: Schema.String })),
43
+ milestone: Schema.NullOr(Schema.Struct({ title: Schema.String })),
44
+ labels: orEmpty(Labels, emptyConnection),
45
+ assignees: Schema.Struct({ totalCount: NonNegativeInt, nodes: Schema.Array(Actor) }),
46
+ comments: IssueComments,
47
+ closedByPullRequestsReferences: orEmpty(Schema.Struct({
48
+ totalCount: NonNegativeInt,
49
+ nodes: Schema.Array(Schema.Struct({
50
+ number: PositiveInt,
51
+ state: Schema.String,
52
+ isDraft: Schema.Boolean,
53
+ url: Schema.NonEmptyString,
54
+ })),
55
+ }), emptyConnection),
56
+ });
57
+ /** Null when the reviewer is a deleted user or a mannequin. That null is real content and stays in the payload. */
58
+ const RequestedReviewer = Schema.NullOr(Schema.Struct({ login: Schema.optionalKey(Schema.NonEmptyString) }));
59
+ const Review = Schema.Struct({
60
+ author: NullableActor,
61
+ state: Schema.String,
62
+ body: Schema.String,
63
+ submittedAt: Schema.NullOr(Timestamp),
64
+ commit: Schema.NullOr(Schema.Struct({ oid: Schema.NonEmptyString })),
65
+ });
66
+ const ReviewThreadComment = Schema.Struct({ author: NullableActor, body: Schema.String });
67
+ /** The pull-request payload slice that `if:` expressions and prompt interpolation range over. */
68
+ export const PullRequestPayload = Schema.Struct({
69
+ number: PositiveInt,
70
+ title: Schema.String,
71
+ body: Schema.String,
72
+ url: Schema.NonEmptyString,
73
+ state: Schema.String,
74
+ isDraft: Schema.Boolean,
75
+ merged: Schema.Boolean,
76
+ createdAt: Timestamp,
77
+ updatedAt: Timestamp,
78
+ mergedAt: Schema.NullOr(Timestamp),
79
+ author: NullableActor,
80
+ baseRefName: Schema.String,
81
+ headRefName: Schema.String,
82
+ headRefOid: Schema.NonEmptyString,
83
+ additions: NonNegativeInt,
84
+ deletions: NonNegativeInt,
85
+ changedFiles: NonNegativeInt,
86
+ reviewDecision: Schema.NullOr(Schema.String),
87
+ statusCheckRollup: Schema.NullOr(Schema.Struct({ state: Schema.String })),
88
+ labels: orEmpty(Labels, emptyConnection),
89
+ reviewRequests: orEmpty(Schema.Struct({
90
+ totalCount: NonNegativeInt,
91
+ nodes: Schema.Array(Schema.Struct({ requestedReviewer: RequestedReviewer })),
92
+ }), emptyConnection),
93
+ reviews: orEmpty(Schema.Struct({ totalCount: NonNegativeInt, nodes: Schema.Array(Review) }), emptyConnection),
94
+ reviewThreads: Schema.Struct({
95
+ totalCount: NonNegativeInt,
96
+ nodes: Schema.Array(Schema.Struct({
97
+ isResolved: Schema.Boolean,
98
+ isOutdated: Schema.Boolean,
99
+ path: Schema.String,
100
+ comments: Schema.Struct({
101
+ totalCount: NonNegativeInt,
102
+ nodes: Schema.Array(ReviewThreadComment),
103
+ }),
104
+ })),
105
+ }),
106
+ comments: IssueComments,
107
+ closingIssuesReferences: orEmpty(Schema.Struct({
108
+ totalCount: NonNegativeInt,
109
+ nodes: Schema.Array(Schema.Struct({ number: PositiveInt, state: Schema.String })),
110
+ }), emptyConnection),
111
+ });
112
+ /** Identifies an Item's payload content for Event deduplication; timestamp-only changes keep the same hash. */
113
+ export const ContentHash = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/u, { message: "Expected a SHA-256 content hash" })).pipe(Schema.brand("GitHubContentHash"));
114
+ /** An issue's observed payload and the content identity used to decide whether it represents new work. */
115
+ export class IssueSnapshot extends Schema.TaggedClass("@usine/github/IssueSnapshot")("IssueSnapshot", {
116
+ payload: IssuePayload,
117
+ contentHash: ContentHash,
118
+ }) {
119
+ }
120
+ /** A pull request's observed payload and the content identity used to decide whether it represents new work. */
121
+ export class PullRequestSnapshot extends Schema.TaggedClass("@usine/github/PullRequestSnapshot")("PullRequestSnapshot", {
122
+ payload: PullRequestPayload,
123
+ contentHash: ContentHash,
124
+ }) {
125
+ }
126
+ /** The fetched Item state shared by selection, prompt rendering, and Event deduplication. */
127
+ export const PayloadSnapshot = Schema.Union([IssueSnapshot, PullRequestSnapshot]);
128
+ //# sourceMappingURL=payload.js.map