@usine/github 0.0.0 → 0.1.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.
Files changed (43) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +110 -1
  3. package/dist/github-app.d.ts +23 -0
  4. package/dist/github-app.d.ts.map +1 -0
  5. package/dist/github-app.js +169 -0
  6. package/dist/github-app.js.map +1 -0
  7. package/dist/http.d.ts +19 -0
  8. package/dist/http.d.ts.map +1 -0
  9. package/dist/http.js +68 -0
  10. package/dist/http.js.map +1 -0
  11. package/dist/index.d.ts +7 -0
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.js +7 -0
  14. package/dist/index.js.map +1 -0
  15. package/dist/item-writer.d.ts +22 -0
  16. package/dist/item-writer.d.ts.map +1 -0
  17. package/dist/item-writer.js +66 -0
  18. package/dist/item-writer.js.map +1 -0
  19. package/dist/jwt.d.ts +10 -0
  20. package/dist/jwt.d.ts.map +1 -0
  21. package/dist/jwt.js +72 -0
  22. package/dist/jwt.js.map +1 -0
  23. package/dist/local-secrets.d.ts +28 -0
  24. package/dist/local-secrets.d.ts.map +1 -0
  25. package/dist/local-secrets.js +56 -0
  26. package/dist/local-secrets.js.map +1 -0
  27. package/dist/model.d.ts +128 -0
  28. package/dist/model.d.ts.map +1 -0
  29. package/dist/model.js +133 -0
  30. package/dist/model.js.map +1 -0
  31. package/dist/polling/model.d.ts +624 -0
  32. package/dist/polling/model.d.ts.map +1 -0
  33. package/dist/polling/model.js +188 -0
  34. package/dist/polling/model.js.map +1 -0
  35. package/dist/polling/polling.d.ts +18 -0
  36. package/dist/polling/polling.d.ts.map +1 -0
  37. package/dist/polling/polling.js +320 -0
  38. package/dist/polling/polling.js.map +1 -0
  39. package/dist/polling/queries.d.ts +3 -0
  40. package/dist/polling/queries.d.ts.map +1 -0
  41. package/dist/polling/queries.js +125 -0
  42. package/dist/polling/queries.js.map +1 -0
  43. package/package.json +49 -4
@@ -0,0 +1,125 @@
1
+ export const ISSUE_PAYLOAD_QUERY = `
2
+ query UsineIssuePayload($owner: String!, $name: String!, $number: Int!) {
3
+ repository(owner: $owner, name: $name) {
4
+ issue(number: $number) {
5
+ number
6
+ title
7
+ body
8
+ url
9
+ state
10
+ stateReason
11
+ createdAt
12
+ updatedAt
13
+ closedAt
14
+ author { login }
15
+ issueType { name }
16
+ milestone { title }
17
+ labels(first: 50) {
18
+ totalCount
19
+ nodes { name }
20
+ }
21
+ assignees(first: 10) {
22
+ totalCount
23
+ nodes { login }
24
+ }
25
+ comments(last: 20) {
26
+ totalCount
27
+ nodes {
28
+ author { login }
29
+ body
30
+ createdAt
31
+ }
32
+ }
33
+ closedByPullRequestsReferences(first: 10, includeClosedPrs: true) {
34
+ totalCount
35
+ nodes {
36
+ number
37
+ state
38
+ isDraft
39
+ url
40
+ }
41
+ }
42
+ }
43
+ }
44
+ }
45
+ `;
46
+ export const PULL_REQUEST_PAYLOAD_QUERY = `
47
+ query UsinePullRequestPayload($owner: String!, $name: String!, $number: Int!) {
48
+ repository(owner: $owner, name: $name) {
49
+ pullRequest(number: $number) {
50
+ number
51
+ title
52
+ body
53
+ url
54
+ state
55
+ isDraft
56
+ merged
57
+ createdAt
58
+ updatedAt
59
+ mergedAt
60
+ author { login }
61
+ baseRefName
62
+ headRefName
63
+ headRefOid
64
+ additions
65
+ deletions
66
+ changedFiles
67
+ reviewDecision
68
+ statusCheckRollup { state }
69
+ labels(first: 50) {
70
+ totalCount
71
+ nodes { name }
72
+ }
73
+ reviewRequests(first: 10) {
74
+ totalCount
75
+ nodes {
76
+ requestedReviewer {
77
+ ... on User { login }
78
+ }
79
+ }
80
+ }
81
+ reviews(last: 20) {
82
+ totalCount
83
+ nodes {
84
+ author { login }
85
+ state
86
+ body
87
+ submittedAt
88
+ commit { oid }
89
+ }
90
+ }
91
+ reviewThreads(first: 50) {
92
+ totalCount
93
+ nodes {
94
+ isResolved
95
+ isOutdated
96
+ path
97
+ comments(first: 10) {
98
+ totalCount
99
+ nodes {
100
+ author { login }
101
+ body
102
+ }
103
+ }
104
+ }
105
+ }
106
+ comments(last: 20) {
107
+ totalCount
108
+ nodes {
109
+ author { login }
110
+ body
111
+ createdAt
112
+ }
113
+ }
114
+ closingIssuesReferences(first: 10) {
115
+ totalCount
116
+ nodes {
117
+ number
118
+ state
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ `;
125
+ //# sourceMappingURL=queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"queries.js","sourceRoot":"","sources":["../../src/polling/queries.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4ClC,CAAC;AAEF,MAAM,CAAC,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8EzC,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,52 @@
1
1
  {
2
2
  "name": "@usine/github",
3
- "version": "0.0.0",
4
- "description": "Name reservation for the usine blocks; real releases start at 0.0.1.",
3
+ "version": "0.1.0",
4
+ "description": "GitHub App authentication, installation discovery, project coverage, and scoped token minting for usine.",
5
5
  "license": "MIT",
6
- "repository": { "type": "git", "url": "git+https://github.com/basaltbytes/usine.git" }
7
- }
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/basaltbytes/usine.git",
9
+ "directory": "packages/github"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "type": "module",
15
+ "sideEffects": false,
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "default": "./dist/index.js"
20
+ },
21
+ "./local-secrets": {
22
+ "types": "./dist/local-secrets.d.ts",
23
+ "default": "./dist/local-secrets.js"
24
+ }
25
+ },
26
+ "publishConfig": {
27
+ "access": "public"
28
+ },
29
+ "dependencies": {
30
+ "@usine/core": "0.1.0"
31
+ },
32
+ "devDependencies": {
33
+ "@effect/platform-node": "4.0.0-rc.111",
34
+ "@effect/vitest": "4.0.0-rc.111",
35
+ "effect": "4.0.0-rc.111",
36
+ "typescript": "7.0.2",
37
+ "vitest": "4.1.11",
38
+ "@usine/tsconfig": "0.0.0"
39
+ },
40
+ "peerDependencies": {
41
+ "effect": "4.0.0-rc.111"
42
+ },
43
+ "engines": {
44
+ "node": ">=22"
45
+ },
46
+ "scripts": {
47
+ "build": "tsc -b",
48
+ "check": "tsc -p tsconfig.check.json",
49
+ "test": "vitest run --exclude 'test/integration/**'",
50
+ "test:integration": "vitest run test/integration/github-app.test.ts"
51
+ }
52
+ }