@emulators/github 0.3.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.
@@ -0,0 +1,597 @@
1
+ import { Entity, Collection, Store, ServicePlugin } from '@emulators/core';
2
+
3
+ interface GitHubUser extends Entity {
4
+ login: string;
5
+ node_id: string;
6
+ avatar_url: string;
7
+ gravatar_id: string;
8
+ type: "User" | "Organization" | "Bot";
9
+ site_admin: boolean;
10
+ name: string | null;
11
+ company: string | null;
12
+ blog: string;
13
+ location: string | null;
14
+ email: string | null;
15
+ hireable: boolean | null;
16
+ bio: string | null;
17
+ twitter_username: string | null;
18
+ public_repos: number;
19
+ public_gists: number;
20
+ followers: number;
21
+ following: number;
22
+ }
23
+ interface GitHubOrg extends Entity {
24
+ login: string;
25
+ node_id: string;
26
+ description: string | null;
27
+ name: string | null;
28
+ company: string | null;
29
+ blog: string;
30
+ location: string | null;
31
+ email: string | null;
32
+ twitter_username: string | null;
33
+ is_verified: boolean;
34
+ has_organization_projects: boolean;
35
+ has_repository_projects: boolean;
36
+ public_repos: number;
37
+ public_gists: number;
38
+ followers: number;
39
+ following: number;
40
+ members_can_create_repositories: boolean;
41
+ default_repository_permission: string;
42
+ billing_email: string | null;
43
+ }
44
+ interface GitHubTeam extends Entity {
45
+ node_id: string;
46
+ name: string;
47
+ slug: string;
48
+ description: string | null;
49
+ privacy: "closed" | "secret";
50
+ permission: string;
51
+ org_id: number;
52
+ parent_id: number | null;
53
+ members_count: number;
54
+ repos_count: number;
55
+ }
56
+ interface GitHubTeamMember extends Entity {
57
+ team_id: number;
58
+ user_id: number;
59
+ role: "member" | "maintainer";
60
+ }
61
+ interface GitHubTeamRepo extends Entity {
62
+ team_id: number;
63
+ repo_id: number;
64
+ }
65
+ interface GitHubRepo extends Entity {
66
+ node_id: string;
67
+ name: string;
68
+ full_name: string;
69
+ owner_id: number;
70
+ owner_type: "User" | "Organization";
71
+ private: boolean;
72
+ description: string | null;
73
+ fork: boolean;
74
+ forked_from_id: number | null;
75
+ homepage: string | null;
76
+ language: string | null;
77
+ languages: Record<string, number>;
78
+ forks_count: number;
79
+ stargazers_count: number;
80
+ watchers_count: number;
81
+ size: number;
82
+ default_branch: string;
83
+ open_issues_count: number;
84
+ topics: string[];
85
+ has_issues: boolean;
86
+ has_projects: boolean;
87
+ has_wiki: boolean;
88
+ has_pages: boolean;
89
+ has_downloads: boolean;
90
+ has_discussions: boolean;
91
+ archived: boolean;
92
+ disabled: boolean;
93
+ visibility: "public" | "private" | "internal";
94
+ pushed_at: string | null;
95
+ allow_rebase_merge: boolean;
96
+ allow_squash_merge: boolean;
97
+ allow_merge_commit: boolean;
98
+ allow_auto_merge: boolean;
99
+ delete_branch_on_merge: boolean;
100
+ allow_forking: boolean;
101
+ is_template: boolean;
102
+ license: {
103
+ key: string;
104
+ name: string;
105
+ spdx_id: string;
106
+ } | null;
107
+ }
108
+ interface GitHubCollaborator extends Entity {
109
+ repo_id: number;
110
+ user_id: number;
111
+ permission: "pull" | "triage" | "push" | "maintain" | "admin";
112
+ }
113
+ interface GitHubIssue extends Entity {
114
+ node_id: string;
115
+ number: number;
116
+ repo_id: number;
117
+ title: string;
118
+ body: string | null;
119
+ state: "open" | "closed";
120
+ state_reason: "completed" | "not_planned" | "reopened" | null;
121
+ locked: boolean;
122
+ active_lock_reason: string | null;
123
+ user_id: number;
124
+ assignee_ids: number[];
125
+ label_ids: number[];
126
+ milestone_id: number | null;
127
+ comments: number;
128
+ closed_at: string | null;
129
+ closed_by_id: number | null;
130
+ is_pull_request: boolean;
131
+ }
132
+ interface GitHubPullRequest extends Entity {
133
+ node_id: string;
134
+ number: number;
135
+ repo_id: number;
136
+ title: string;
137
+ body: string | null;
138
+ state: "open" | "closed";
139
+ locked: boolean;
140
+ user_id: number;
141
+ assignee_ids: number[];
142
+ label_ids: number[];
143
+ milestone_id: number | null;
144
+ head_ref: string;
145
+ head_sha: string;
146
+ head_repo_id: number;
147
+ base_ref: string;
148
+ base_sha: string;
149
+ base_repo_id: number;
150
+ merged: boolean;
151
+ merged_at: string | null;
152
+ merged_by_id: number | null;
153
+ merge_commit_sha: string | null;
154
+ mergeable: boolean | null;
155
+ mergeable_state: string;
156
+ comments: number;
157
+ review_comments: number;
158
+ commits: number;
159
+ additions: number;
160
+ deletions: number;
161
+ changed_files: number;
162
+ draft: boolean;
163
+ requested_reviewer_ids: number[];
164
+ requested_team_ids: number[];
165
+ closed_at: string | null;
166
+ auto_merge: null;
167
+ }
168
+ interface GitHubLabel extends Entity {
169
+ node_id: string;
170
+ repo_id: number;
171
+ name: string;
172
+ description: string | null;
173
+ color: string;
174
+ default: boolean;
175
+ }
176
+ interface GitHubMilestone extends Entity {
177
+ node_id: string;
178
+ repo_id: number;
179
+ number: number;
180
+ title: string;
181
+ description: string | null;
182
+ state: "open" | "closed";
183
+ open_issues: number;
184
+ closed_issues: number;
185
+ due_on: string | null;
186
+ closed_at: string | null;
187
+ creator_id: number;
188
+ }
189
+ interface GitHubComment extends Entity {
190
+ node_id: string;
191
+ repo_id: number;
192
+ issue_number: number | null;
193
+ pull_number: number | null;
194
+ commit_sha: string | null;
195
+ body: string;
196
+ user_id: number;
197
+ in_reply_to_id: number | null;
198
+ path: string | null;
199
+ position: number | null;
200
+ line: number | null;
201
+ side: "LEFT" | "RIGHT" | null;
202
+ subject_type: "line" | "file" | null;
203
+ comment_type: "issue" | "review" | "commit";
204
+ /** Set for line comments created as part of a pull request review. */
205
+ review_id: number | null;
206
+ }
207
+ interface GitHubReview extends Entity {
208
+ node_id: string;
209
+ repo_id: number;
210
+ pull_number: number;
211
+ user_id: number;
212
+ body: string | null;
213
+ state: "PENDING" | "APPROVED" | "CHANGES_REQUESTED" | "COMMENTED" | "DISMISSED";
214
+ commit_id: string;
215
+ submitted_at: string | null;
216
+ }
217
+ interface GitHubIssueEvent extends Entity {
218
+ node_id: string;
219
+ repo_id: number;
220
+ issue_number: number;
221
+ event: string;
222
+ actor_id: number;
223
+ commit_id: string | null;
224
+ commit_url: string | null;
225
+ label_name: string | null;
226
+ assignee_id: number | null;
227
+ milestone_title: string | null;
228
+ rename: {
229
+ from: string;
230
+ to: string;
231
+ } | null;
232
+ }
233
+ interface GitHubBranch extends Entity {
234
+ repo_id: number;
235
+ name: string;
236
+ sha: string;
237
+ protected: boolean;
238
+ }
239
+ interface GitHubBranchProtection extends Entity {
240
+ repo_id: number;
241
+ branch_name: string;
242
+ required_status_checks: {
243
+ strict: boolean;
244
+ contexts: string[];
245
+ } | null;
246
+ enforce_admins: boolean;
247
+ required_pull_request_reviews: {
248
+ required_approving_review_count: number;
249
+ dismiss_stale_reviews: boolean;
250
+ require_code_owner_reviews: boolean;
251
+ } | null;
252
+ restrictions: {
253
+ users: string[];
254
+ teams: string[];
255
+ } | null;
256
+ required_linear_history: boolean;
257
+ allow_force_pushes: boolean;
258
+ allow_deletions: boolean;
259
+ required_signatures: boolean;
260
+ }
261
+ interface GitHubRef extends Entity {
262
+ repo_id: number;
263
+ ref: string;
264
+ sha: string;
265
+ node_id: string;
266
+ }
267
+ interface GitHubCommit extends Entity {
268
+ repo_id: number;
269
+ sha: string;
270
+ node_id: string;
271
+ message: string;
272
+ author_name: string;
273
+ author_email: string;
274
+ author_date: string;
275
+ committer_name: string;
276
+ committer_email: string;
277
+ committer_date: string;
278
+ tree_sha: string;
279
+ parent_shas: string[];
280
+ user_id: number | null;
281
+ }
282
+ interface GitHubTree extends Entity {
283
+ repo_id: number;
284
+ sha: string;
285
+ node_id: string;
286
+ tree: Array<{
287
+ path: string;
288
+ mode: string;
289
+ type: "blob" | "tree";
290
+ sha: string;
291
+ size?: number;
292
+ }>;
293
+ truncated: boolean;
294
+ }
295
+ interface GitHubBlob extends Entity {
296
+ repo_id: number;
297
+ sha: string;
298
+ node_id: string;
299
+ content: string;
300
+ encoding: "base64" | "utf-8";
301
+ size: number;
302
+ }
303
+ interface GitHubTag extends Entity {
304
+ repo_id: number;
305
+ tag: string;
306
+ sha: string;
307
+ node_id: string;
308
+ message: string;
309
+ tagger_name: string;
310
+ tagger_email: string;
311
+ tagger_date: string;
312
+ object_type: string;
313
+ object_sha: string;
314
+ }
315
+ interface GitHubRelease extends Entity {
316
+ node_id: string;
317
+ repo_id: number;
318
+ tag_name: string;
319
+ target_commitish: string;
320
+ name: string | null;
321
+ body: string | null;
322
+ draft: boolean;
323
+ prerelease: boolean;
324
+ author_id: number;
325
+ published_at: string | null;
326
+ }
327
+ interface GitHubReleaseAsset extends Entity {
328
+ node_id: string;
329
+ release_id: number;
330
+ repo_id: number;
331
+ name: string;
332
+ label: string | null;
333
+ state: "uploaded" | "open";
334
+ content_type: string;
335
+ size: number;
336
+ download_count: number;
337
+ uploader_id: number;
338
+ }
339
+ interface GitHubWebhook extends Entity {
340
+ repo_id: number | null;
341
+ org_id: number | null;
342
+ name: string;
343
+ active: boolean;
344
+ events: string[];
345
+ config: {
346
+ url: string;
347
+ content_type: string;
348
+ secret?: string;
349
+ insecure_ssl: string;
350
+ };
351
+ last_response: {
352
+ code: number | null;
353
+ status: string;
354
+ message: string | null;
355
+ };
356
+ }
357
+ interface GitHubWorkflow extends Entity {
358
+ node_id: string;
359
+ repo_id: number;
360
+ name: string;
361
+ path: string;
362
+ state: "active" | "disabled_manually" | "disabled_inactivity";
363
+ badge_url: string;
364
+ }
365
+ interface GitHubWorkflowRun extends Entity {
366
+ node_id: string;
367
+ repo_id: number;
368
+ workflow_id: number;
369
+ name: string;
370
+ head_branch: string;
371
+ head_sha: string;
372
+ run_number: number;
373
+ event: string;
374
+ status: "queued" | "in_progress" | "completed";
375
+ conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null;
376
+ actor_id: number;
377
+ run_attempt: number;
378
+ run_started_at: string;
379
+ }
380
+ interface GitHubJob extends Entity {
381
+ node_id: string;
382
+ repo_id: number;
383
+ run_id: number;
384
+ name: string;
385
+ status: "queued" | "in_progress" | "completed";
386
+ conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null;
387
+ started_at: string | null;
388
+ completed_at: string | null;
389
+ runner_id: number | null;
390
+ runner_name: string | null;
391
+ steps: Array<{
392
+ name: string;
393
+ status: string;
394
+ conclusion: string | null;
395
+ number: number;
396
+ started_at: string | null;
397
+ completed_at: string | null;
398
+ }>;
399
+ }
400
+ interface GitHubArtifact extends Entity {
401
+ node_id: string;
402
+ repo_id: number;
403
+ run_id: number;
404
+ name: string;
405
+ size_in_bytes: number;
406
+ expired: boolean;
407
+ expires_at: string;
408
+ }
409
+ interface GitHubSecret extends Entity {
410
+ repo_id: number | null;
411
+ org_id: number | null;
412
+ name: string;
413
+ visibility: "all" | "private" | "selected";
414
+ }
415
+ interface GitHubCheckAnnotation {
416
+ path: string;
417
+ start_line: number;
418
+ end_line: number;
419
+ annotation_level: string;
420
+ message: string;
421
+ }
422
+ interface GitHubCheckRun extends Entity {
423
+ node_id: string;
424
+ repo_id: number;
425
+ head_sha: string;
426
+ name: string;
427
+ status: "queued" | "in_progress" | "completed";
428
+ conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null;
429
+ started_at: string | null;
430
+ completed_at: string | null;
431
+ external_id: string;
432
+ details_url: string | null;
433
+ actions: {
434
+ id: string;
435
+ label: string;
436
+ description: string;
437
+ }[] | null;
438
+ output: {
439
+ title: string | null;
440
+ summary: string | null;
441
+ text: string | null;
442
+ annotations_count: number;
443
+ annotations: GitHubCheckAnnotation[];
444
+ };
445
+ check_suite_id: number | null;
446
+ app_id: number | null;
447
+ }
448
+ interface GitHubCheckSuite extends Entity {
449
+ node_id: string;
450
+ repo_id: number;
451
+ head_branch: string;
452
+ head_sha: string;
453
+ status: "queued" | "in_progress" | "completed";
454
+ conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | null;
455
+ before: string;
456
+ after: string;
457
+ app_id: number | null;
458
+ }
459
+ interface GitHubOAuthApp extends Entity {
460
+ client_id: string;
461
+ client_secret: string;
462
+ name: string;
463
+ redirect_uris: string[];
464
+ }
465
+ interface GitHubApp extends Entity {
466
+ app_id: number;
467
+ slug: string;
468
+ name: string;
469
+ private_key: string;
470
+ permissions: Record<string, string>;
471
+ events: string[];
472
+ webhook_url: string | null;
473
+ webhook_secret: string | null;
474
+ description: string | null;
475
+ }
476
+ interface GitHubAppInstallation extends Entity {
477
+ installation_id: number;
478
+ app_id: number;
479
+ account_type: "User" | "Organization";
480
+ account_id: number;
481
+ account_login: string;
482
+ repository_selection: "all" | "selected";
483
+ repository_ids: number[];
484
+ permissions: Record<string, string>;
485
+ events: string[];
486
+ suspended_at: string | null;
487
+ }
488
+ interface GitHubOAuthGrant extends Entity {
489
+ user_id: number;
490
+ oauth_app_id: number;
491
+ client_id: string;
492
+ scopes: string[];
493
+ org_access: Record<string, "granted" | "denied" | "requested">;
494
+ }
495
+
496
+ interface GitHubStore {
497
+ users: Collection<GitHubUser>;
498
+ orgs: Collection<GitHubOrg>;
499
+ teams: Collection<GitHubTeam>;
500
+ teamMembers: Collection<GitHubTeamMember>;
501
+ teamRepos: Collection<GitHubTeamRepo>;
502
+ repos: Collection<GitHubRepo>;
503
+ collaborators: Collection<GitHubCollaborator>;
504
+ issues: Collection<GitHubIssue>;
505
+ pullRequests: Collection<GitHubPullRequest>;
506
+ labels: Collection<GitHubLabel>;
507
+ milestones: Collection<GitHubMilestone>;
508
+ comments: Collection<GitHubComment>;
509
+ reviews: Collection<GitHubReview>;
510
+ issueEvents: Collection<GitHubIssueEvent>;
511
+ branches: Collection<GitHubBranch>;
512
+ branchProtections: Collection<GitHubBranchProtection>;
513
+ refs: Collection<GitHubRef>;
514
+ commits: Collection<GitHubCommit>;
515
+ trees: Collection<GitHubTree>;
516
+ blobs: Collection<GitHubBlob>;
517
+ tags: Collection<GitHubTag>;
518
+ releases: Collection<GitHubRelease>;
519
+ releaseAssets: Collection<GitHubReleaseAsset>;
520
+ webhooks: Collection<GitHubWebhook>;
521
+ workflows: Collection<GitHubWorkflow>;
522
+ workflowRuns: Collection<GitHubWorkflowRun>;
523
+ jobs: Collection<GitHubJob>;
524
+ artifacts: Collection<GitHubArtifact>;
525
+ secrets: Collection<GitHubSecret>;
526
+ checkRuns: Collection<GitHubCheckRun>;
527
+ checkSuites: Collection<GitHubCheckSuite>;
528
+ oauthApps: Collection<GitHubOAuthApp>;
529
+ apps: Collection<GitHubApp>;
530
+ appInstallations: Collection<GitHubAppInstallation>;
531
+ oauthGrants: Collection<GitHubOAuthGrant>;
532
+ }
533
+ declare function getGitHubStore(store: Store): GitHubStore;
534
+
535
+ interface GitHubSeedConfig {
536
+ port?: number;
537
+ users?: Array<{
538
+ login: string;
539
+ name?: string;
540
+ email?: string;
541
+ bio?: string;
542
+ company?: string;
543
+ location?: string;
544
+ blog?: string;
545
+ twitter_username?: string;
546
+ site_admin?: boolean;
547
+ }>;
548
+ orgs?: Array<{
549
+ login: string;
550
+ name?: string;
551
+ description?: string;
552
+ email?: string;
553
+ }>;
554
+ tokens?: Record<string, {
555
+ login: string;
556
+ scopes?: string[];
557
+ }>;
558
+ repos?: Array<{
559
+ owner: string;
560
+ name: string;
561
+ description?: string;
562
+ private?: boolean;
563
+ language?: string;
564
+ topics?: string[];
565
+ default_branch?: string;
566
+ auto_init?: boolean;
567
+ }>;
568
+ oauth_apps?: Array<{
569
+ client_id: string;
570
+ client_secret: string;
571
+ name: string;
572
+ redirect_uris: string[];
573
+ }>;
574
+ apps?: Array<{
575
+ app_id: number;
576
+ slug: string;
577
+ name: string;
578
+ private_key: string;
579
+ permissions?: Record<string, string>;
580
+ events?: string[];
581
+ webhook_url?: string;
582
+ webhook_secret?: string;
583
+ description?: string;
584
+ installations?: Array<{
585
+ installation_id: number;
586
+ account: string;
587
+ repository_selection?: "all" | "selected";
588
+ repositories?: string[];
589
+ permissions?: Record<string, string>;
590
+ events?: string[];
591
+ }>;
592
+ }>;
593
+ }
594
+ declare function seedFromConfig(store: Store, baseUrl: string, config: GitHubSeedConfig): void;
595
+ declare const githubPlugin: ServicePlugin;
596
+
597
+ export { type GitHubApp, type GitHubAppInstallation, type GitHubArtifact, type GitHubBlob, type GitHubBranch, type GitHubBranchProtection, type GitHubCheckAnnotation, type GitHubCheckRun, type GitHubCheckSuite, type GitHubCollaborator, type GitHubComment, type GitHubCommit, type GitHubIssue, type GitHubIssueEvent, type GitHubJob, type GitHubLabel, type GitHubMilestone, type GitHubOAuthApp, type GitHubOAuthGrant, type GitHubOrg, type GitHubPullRequest, type GitHubRef, type GitHubRelease, type GitHubReleaseAsset, type GitHubRepo, type GitHubReview, type GitHubSecret, type GitHubSeedConfig, type GitHubStore, type GitHubTag, type GitHubTeam, type GitHubTeamMember, type GitHubTeamRepo, type GitHubTree, type GitHubUser, type GitHubWebhook, type GitHubWorkflow, type GitHubWorkflowRun, githubPlugin as default, getGitHubStore, githubPlugin, seedFromConfig };