@github-tools/sdk 1.8.1 → 1.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.
Files changed (43) hide show
  1. package/README.md +195 -68
  2. package/dist/connect/eve.d.mts +11 -5
  3. package/dist/connect/eve.d.mts.map +1 -1
  4. package/dist/connect/eve.mjs +10 -2
  5. package/dist/connect/eve.mjs.map +1 -1
  6. package/dist/connect.d.mts +23 -11
  7. package/dist/connect.d.mts.map +1 -1
  8. package/dist/connect.mjs +6 -3
  9. package/dist/connect.mjs.map +1 -1
  10. package/dist/eve-DmiXBuli.mjs +864 -0
  11. package/dist/eve-DmiXBuli.mjs.map +1 -0
  12. package/dist/eve.d.mts +338 -90
  13. package/dist/eve.d.mts.map +1 -1
  14. package/dist/eve.mjs +3 -3
  15. package/dist/index-CtID5dUi.d.mts +606 -0
  16. package/dist/index-CtID5dUi.d.mts.map +1 -0
  17. package/dist/index.d.mts +2 -2
  18. package/dist/index.mjs +3 -3
  19. package/dist/{src-CfzZfU82.mjs → src-D6vC3V8r.mjs} +293 -20
  20. package/dist/src-D6vC3V8r.mjs.map +1 -0
  21. package/dist/{token-CW8lQBND.mjs → token-sbepWIkd.mjs} +45 -7
  22. package/dist/token-sbepWIkd.mjs.map +1 -0
  23. package/dist/{types-B0mvQgJf.d.mts → types-BOnJ0Rou.d.mts} +28 -8
  24. package/dist/types-BOnJ0Rou.d.mts.map +1 -0
  25. package/dist/types-BVLof-5R.d.mts +39 -0
  26. package/dist/types-BVLof-5R.d.mts.map +1 -0
  27. package/dist/workflow.d.mts +7 -7
  28. package/dist/workflow.d.mts.map +1 -1
  29. package/dist/workflow.mjs +6 -4
  30. package/dist/workflow.mjs.map +1 -1
  31. package/dist/{write-tools-Dx9LfYlU.mjs → write-tools-cg_ialNd.mjs} +1009 -107
  32. package/dist/write-tools-cg_ialNd.mjs.map +1 -0
  33. package/package.json +13 -13
  34. package/dist/eve-UPaHEGVi.mjs +0 -512
  35. package/dist/eve-UPaHEGVi.mjs.map +0 -1
  36. package/dist/index-Cs1Kebmt.d.mts +0 -463
  37. package/dist/index-Cs1Kebmt.d.mts.map +0 -1
  38. package/dist/src-CfzZfU82.mjs.map +0 -1
  39. package/dist/token-CW8lQBND.mjs.map +0 -1
  40. package/dist/types-B0mvQgJf.d.mts.map +0 -1
  41. package/dist/types-DwHrGKWO.d.mts +0 -27
  42. package/dist/types-DwHrGKWO.d.mts.map +0 -1
  43. package/dist/write-tools-Dx9LfYlU.mjs.map +0 -1
@@ -1,12 +1,15 @@
1
- import { Y as AllGithubTools, at as GithubTokenInput, dt as GithubToolPreset, ht as GithubToolName } from "./index-Cs1Kebmt.mjs";
2
- import { i as GithubConnectParams, n as ConnectGithubTokenOptions, r as ConnectGithubToolsOptions, t as ConnectGithubEveToolsOptions } from "./types-DwHrGKWO.mjs";
1
+ import { Dt as GithubToolPreset, jt as GithubToolName, mt as GithubTokenInput, ut as AllGithubTools } from "./index-CtID5dUi.mjs";
2
+ import { a as GithubConnectorInput, i as GithubConnectParams, n as ConnectGithubTokenOptions, o as resolveGithubConnector, r as ConnectGithubToolsOptions, t as ConnectGithubEveToolsOptions } from "./types-BVLof-5R.mjs";
3
+ import "@vercel/connect";
3
4
  //#region src/connect/scopes.d.ts
4
5
  /**
5
6
  * Vercel Connect scope strings mapped to each {@link GithubToolPreset}.
6
7
  *
7
8
  * Scopes mirror GitHub App permissions (`contents`, `pull_requests`, `issues`,
8
- * `actions`, `administration`, `metadata`) and must cover every read/write
9
- * family a preset's tools touch, not just its primary domain.
9
+ * `actions`, `checks`, `statuses`, `administration`, `metadata`) and must cover
10
+ * every read/write family a preset's tools touch, not just its primary domain.
11
+ * Release tools fall under the `contents` permission on GitHub Apps, so they
12
+ * need no scope of their own.
10
13
  *
11
14
  * Gist tools in `repo-explorer` and `maintainer` are intentionally left
12
15
  * unscoped: the Gists API only accepts GitHub App *user* access tokens, never
@@ -16,11 +19,13 @@ import { i as GithubConnectParams, n as ConnectGithubTokenOptions, r as ConnectG
16
19
  * account permission for those tools instead.
17
20
  */
18
21
  declare const PRESET_CONNECT_SCOPES: {
19
- readonly 'repo-explorer': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read", "actions:read"];
20
- readonly 'code-review': readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write"];
22
+ readonly 'repo-explorer': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read", "actions:read", "checks:read", "statuses:read"];
23
+ readonly 'code-review': readonly ["contents:read", "metadata:read", "pull_requests:read", "pull_requests:write", "checks:read", "statuses:read"];
21
24
  readonly 'issue-triage': readonly ["contents:read", "metadata:read", "issues:read", "issues:write"];
22
- readonly 'ci-ops': readonly ["contents:read", "metadata:read", "actions:read", "actions:write"];
23
- readonly maintainer: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write", "issues:read", "issues:write", "actions:read", "actions:write", "administration:read", "administration:write"];
25
+ readonly 'ci-ops': readonly ["contents:read", "metadata:read", "actions:read", "actions:write", "checks:read", "statuses:read"];
26
+ readonly 'security-audit': readonly ["contents:read", "metadata:read", "pull_requests:read", "issues:read", "issues:write", "actions:read", "checks:read", "statuses:read"];
27
+ readonly 'release-manager': readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "actions:read", "actions:write"];
28
+ readonly maintainer: readonly ["contents:read", "contents:write", "metadata:read", "pull_requests:read", "pull_requests:write", "issues:read", "issues:write", "actions:read", "actions:write", "checks:read", "statuses:read", "administration:read", "administration:write"];
24
29
  };
25
30
  /**
26
31
  * Returns Vercel Connect scopes for a preset or combined presets.
@@ -32,15 +37,22 @@ declare function connectGithubScopesForPreset(preset?: GithubToolPreset | Github
32
37
  /**
33
38
  * Returns a lazy GitHub token provider backed by a Vercel Connect connector.
34
39
  * Scopes are derived from `preset` unless overridden in `params.scopes`.
40
+ *
41
+ * `connector` may be a static name or a resolver function — e.g. to pick a
42
+ * different connector per environment (production vs. preview) or tenant.
43
+ * It's re-resolved on every call, alongside the token itself.
35
44
  */
36
- declare function connectGithubToken(connector: string, options?: ConnectGithubTokenOptions): GithubTokenInput;
45
+ declare function connectGithubToken(connector: GithubConnectorInput, options?: ConnectGithubTokenOptions): GithubTokenInput;
37
46
  //#endregion
38
47
  //#region src/connect/tools.d.ts
39
48
  /**
40
49
  * Create GitHub tools backed by a Vercel Connect connector.
41
50
  * Scopes are derived from `preset` unless overridden in `connect.scopes`.
51
+ *
52
+ * `connector` may be a static name or a resolver function — e.g. to pick a
53
+ * different connector per environment (production vs. preview) or tenant.
42
54
  */
43
- declare function connectGithubTools(connector: string, options?: ConnectGithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>;
55
+ declare function connectGithubTools(connector: GithubConnectorInput, options?: ConnectGithubToolsOptions): AllGithubTools | Pick<AllGithubTools, GithubToolName>;
44
56
  //#endregion
45
- export { type ConnectGithubEveToolsOptions, type ConnectGithubTokenOptions, type ConnectGithubToolsOptions, type GithubConnectParams, PRESET_CONNECT_SCOPES, connectGithubScopesForPreset, connectGithubToken, connectGithubTools };
57
+ export { type ConnectGithubEveToolsOptions, type ConnectGithubTokenOptions, type ConnectGithubToolsOptions, type GithubConnectParams, type GithubConnectorInput, PRESET_CONNECT_SCOPES, connectGithubScopesForPreset, connectGithubToken, connectGithubTools, resolveGithubConnector };
46
58
  //# sourceMappingURL=connect.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.d.mts","names":[],"sources":["../src/connect/scopes.ts","../src/connect/token.ts","../src/connect/tools.ts"],"mappings":";;;;;;;AAgBA;;;;;;;;;;cAAa,qBAAA;EAAA;;;;;;;;;;iBAkDG,4BAAA,CACd,MAAA,GAAS,gBAAA,GAAmB,gBAAA;;;;;AAnD9B;;iBCPgB,kBAAA,CACd,SAAA,UACA,OAAA,GAAS,yBAAA,GACR,gBAAA;;;;;;;iBCJa,kBAAA,CACd,SAAA,UACA,OAAA,GAAS,yBAAA,GAA8B,cAAA,GAAA,IAAA,CAAA,cAAA,EAAA,cAAA"}
1
+ {"version":3,"file":"connect.d.mts","names":[],"sources":["../src/connect/scopes.ts","../src/connect/token.ts","../src/connect/tools.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAkBa;;;;;;;;;;;;;iBA4EG,6BACd,SAAS,mBAAmB;;;;;;;;;;;iBCjFd,mBACd,WAAW,sBACX,UAAS,4BACR;;;;;;;;;;iBCLa,mBACd,WAAW,sBACX,UAAS,4BAAA,iBAA8B,KAAA,gBAAA"}
package/dist/connect.mjs CHANGED
@@ -1,9 +1,12 @@
1
- import { t as createGithubTools } from "./src-CfzZfU82.mjs";
2
- import { n as PRESET_CONNECT_SCOPES, r as connectGithubScopesForPreset, t as connectGithubToken } from "./token-CW8lQBND.mjs";
1
+ import { t as createGithubTools } from "./src-D6vC3V8r.mjs";
2
+ import { i as resolveGithubConnector, n as PRESET_CONNECT_SCOPES, r as connectGithubScopesForPreset, t as connectGithubToken } from "./token-sbepWIkd.mjs";
3
3
  //#region src/connect/tools.ts
4
4
  /**
5
5
  * Create GitHub tools backed by a Vercel Connect connector.
6
6
  * Scopes are derived from `preset` unless overridden in `connect.scopes`.
7
+ *
8
+ * `connector` may be a static name or a resolver function — e.g. to pick a
9
+ * different connector per environment (production vs. preview) or tenant.
7
10
  */
8
11
  function connectGithubTools(connector, options = {}) {
9
12
  const { connect, preset, ...rest } = options;
@@ -17,6 +20,6 @@ function connectGithubTools(connector, options = {}) {
17
20
  });
18
21
  }
19
22
  //#endregion
20
- export { PRESET_CONNECT_SCOPES, connectGithubScopesForPreset, connectGithubToken, connectGithubTools };
23
+ export { PRESET_CONNECT_SCOPES, connectGithubScopesForPreset, connectGithubToken, connectGithubTools, resolveGithubConnector };
21
24
 
22
25
  //# sourceMappingURL=connect.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"connect.mjs","names":[],"sources":["../src/connect/tools.ts"],"sourcesContent":["import { createGithubTools } from '../index'\nimport { connectGithubToken } from './token'\nimport type { ConnectGithubToolsOptions } from './types'\n\n/**\n * Create GitHub tools backed by a Vercel Connect connector.\n * Scopes are derived from `preset` unless overridden in `connect.scopes`.\n */\nexport function connectGithubTools(\n connector: string,\n options: ConnectGithubToolsOptions = {},\n) {\n const { connect, preset, ...rest } = options\n\n return createGithubTools({\n ...rest,\n preset,\n token: connectGithubToken(connector, { preset, params: connect }),\n })\n}\n"],"mappings":";;;;;;;AAQA,SAAgB,mBACd,WACA,UAAqC,EAAE,EACvC;CACA,MAAM,EAAE,SAAS,QAAQ,GAAG,SAAS;AAErC,QAAO,kBAAkB;EACvB,GAAG;EACH;EACA,OAAO,mBAAmB,WAAW;GAAE;GAAQ,QAAQ;GAAS,CAAC;EAClE,CAAC"}
1
+ {"version":3,"file":"connect.mjs","names":[],"sources":["../src/connect/tools.ts"],"sourcesContent":["import { createGithubTools } from '../index'\nimport type { GithubConnectorInput } from './connector'\nimport { connectGithubToken } from './token'\nimport type { ConnectGithubToolsOptions } from './types'\n\n/**\n * Create GitHub tools backed by a Vercel Connect connector.\n * Scopes are derived from `preset` unless overridden in `connect.scopes`.\n *\n * `connector` may be a static name or a resolver function — e.g. to pick a\n * different connector per environment (production vs. preview) or tenant.\n */\nexport function connectGithubTools(\n connector: GithubConnectorInput,\n options: ConnectGithubToolsOptions = {},\n) {\n const { connect, preset, ...rest } = options\n\n return createGithubTools({\n ...rest,\n preset,\n token: connectGithubToken(connector, { preset, params: connect }),\n })\n}\n"],"mappings":";;;;;;;;;;AAYA,SAAgB,mBACd,WACA,UAAqC,CAAC,GACtC;CACA,MAAM,EAAE,SAAS,QAAQ,GAAG,SAAS;CAErC,OAAO,kBAAkB;EACvB,GAAG;EACH;EACA,OAAO,mBAAmB,WAAW;GAAE;GAAQ,QAAQ;EAAQ,CAAC;CAClE,CAAC;AACH"}