@bernierllc/github-parser 1.0.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/src/types.ts ADDED
@@ -0,0 +1,89 @@
1
+ /*
2
+ Copyright (c) 2025 Bernier LLC
3
+
4
+ This file is licensed to the client under a limited-use license.
5
+ The client may use and modify this code *only within the scope of the project it was delivered for*.
6
+ Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
7
+ */
8
+
9
+ /**
10
+ * Raw GitHub webhook payload
11
+ */
12
+ export interface GitHubWebhookPayload {
13
+ [key: string]: unknown;
14
+ }
15
+
16
+ /**
17
+ * Parsed commit information
18
+ */
19
+ export interface ParsedCommit {
20
+ /** Commit SHA */
21
+ sha: string;
22
+ /** Commit message */
23
+ message: string;
24
+ /** Commit author */
25
+ author: {
26
+ name: string;
27
+ email: string;
28
+ username?: string;
29
+ };
30
+ /** Commit timestamp */
31
+ timestamp: Date;
32
+ /** Commit URL */
33
+ url: string;
34
+ /** Lines added */
35
+ additions: number;
36
+ /** Lines deleted */
37
+ deletions: number;
38
+ /** Files changed */
39
+ files: string[];
40
+ }
41
+
42
+ /**
43
+ * Parsed repository information
44
+ */
45
+ export interface ParsedRepository {
46
+ /** Repository ID */
47
+ id: number;
48
+ /** Repository name */
49
+ name: string;
50
+ /** Full repository name (owner/repo) */
51
+ fullName: string;
52
+ /** Repository owner */
53
+ owner: {
54
+ login: string;
55
+ type: string;
56
+ };
57
+ /** Default branch */
58
+ defaultBranch: string;
59
+ /** Repository URL */
60
+ url: string;
61
+ /** Whether repository is private */
62
+ private: boolean;
63
+ }
64
+
65
+ /**
66
+ * Parsed webhook event
67
+ */
68
+ export interface ParsedWebhookEvent {
69
+ /** Event type */
70
+ type: 'push' | 'pull_request' | 'issues' | 'release' | string;
71
+ /** Event action (for pull_request, issues, etc.) */
72
+ action?: string;
73
+ /** Repository information */
74
+ repository: ParsedRepository;
75
+ /** Commits (for push events) */
76
+ commits?: ParsedCommit[];
77
+ /** Single commit (for some events) */
78
+ commit?: ParsedCommit;
79
+ /** Branch name */
80
+ branch?: string;
81
+ /** Git ref */
82
+ ref?: string;
83
+ /** Event sender */
84
+ sender?: {
85
+ login: string;
86
+ type: string;
87
+ };
88
+ }
89
+
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "commonjs",
5
+ "lib": ["ES2020"],
6
+ "declaration": true,
7
+ "outDir": "./dist",
8
+ "rootDir": "./src",
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "moduleResolution": "node",
14
+ "resolveJsonModule": true,
15
+ "noUnusedLocals": true,
16
+ "noUnusedParameters": true,
17
+ "noImplicitReturns": true,
18
+ "noFallthroughCasesInSwitch": true
19
+ },
20
+ "include": ["src/**/*"],
21
+ "exclude": ["node_modules", "dist", "__tests__"]
22
+ }
23
+