@effected/github 0.23.1 → 0.25.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.
@@ -6,6 +6,8 @@ import { Octokit } from "@octokit/core";
6
6
  import { composePaginateRest } from "@octokit/plugin-paginate-rest";
7
7
 
8
8
  // src/internal/octokit.ts
9
+ /** The REST api-version a client pins when its options name none. */
10
+ const DEFAULT_API_VERSION = "2026-03-10";
9
11
  const SILENT_LOG = {
10
12
  debug: () => {},
11
13
  info: () => {},
@@ -25,13 +27,19 @@ const SILENT_LOG = {
25
27
  * maps Effect's logs to whatever its runtime wants, so no GitHub Actions
26
28
  * knowledge lives in this client.
27
29
  */
28
- const makeOctokit = (options) => new Octokit({
29
- ...options.token !== void 0 ? { auth: Redacted.value(options.token) } : {},
30
- ...options.baseUrl !== void 0 ? { baseUrl: options.baseUrl } : {},
31
- ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {},
32
- ...options.fetch !== void 0 ? { request: { fetch: options.fetch } } : {},
33
- log: SILENT_LOG
34
- });
30
+ const makeOctokit = (options) => {
31
+ const octokit = new Octokit({
32
+ ...options.token !== void 0 ? { auth: Redacted.value(options.token) } : {},
33
+ ...options.baseUrl !== void 0 ? { baseUrl: options.baseUrl } : {},
34
+ ...options.userAgent !== void 0 ? { userAgent: options.userAgent } : {},
35
+ ...options.fetch !== void 0 ? { request: { fetch: options.fetch } } : {},
36
+ log: SILENT_LOG
37
+ });
38
+ octokit.hook.before("request", (request) => {
39
+ request.headers["x-github-api-version"] ??= options.apiVersion;
40
+ });
41
+ return octokit;
42
+ };
35
43
  /**
36
44
  * Build a transport over a freshly constructed octokit instance.
37
45
  *
@@ -105,4 +113,4 @@ const readThrownHeaders = (error) => {
105
113
  return typeof headers === "object" && headers !== null ? headers : void 0;
106
114
  };
107
115
 
108
- export { makeTransport };
116
+ export { DEFAULT_API_VERSION, makeTransport };
@@ -0,0 +1,44 @@
1
+ // src/internal/repositoryRestSettingKeys.ts
2
+ /**
3
+ * Every key the REST repository PATCH accepts, as GitHub's OpenAPI description declares it.
4
+ *
5
+ * @internal
6
+ */
7
+ const REPOSITORY_REST_SETTING_KEYS = /* @__PURE__ */ new Set([
8
+ "allow_auto_merge",
9
+ "allow_forking",
10
+ "allow_merge_commit",
11
+ "allow_rebase_merge",
12
+ "allow_squash_merge",
13
+ "allow_update_branch",
14
+ "archived",
15
+ "default_branch",
16
+ "delete_branch_on_merge",
17
+ "description",
18
+ "has_issues",
19
+ "has_projects",
20
+ "has_pull_requests",
21
+ "has_wiki",
22
+ "homepage",
23
+ "is_template",
24
+ "merge_commit_message",
25
+ "merge_commit_title",
26
+ "name",
27
+ "private",
28
+ "pull_request_creation_policy",
29
+ "security_and_analysis",
30
+ "squash_merge_commit_message",
31
+ "squash_merge_commit_title",
32
+ "use_squash_pr_title_as_default",
33
+ "visibility",
34
+ "web_commit_signoff_required"
35
+ ]);
36
+ /**
37
+ * Keys in {@link REPOSITORY_REST_SETTING_KEYS} that an api-version removed,
38
+ * mapped to that version: a client at or past it does not send the key.
39
+ *
40
+ * @internal
41
+ */
42
+ const REMOVED_BY_PINNED_VERSION = { use_squash_pr_title_as_default: "2026-03-10" };
43
+
44
+ export { REMOVED_BY_PINNED_VERSION, REPOSITORY_REST_SETTING_KEYS };
@@ -0,0 +1,25 @@
1
+ import { Effect } from "effect";
2
+
3
+ // src/internal/unstubbed.ts
4
+ /**
5
+ * The die-on-call members of `<double>.makeTest`: `dies("get")` is an `Effect`
6
+ * that defects naming `get()` when run. Each package double binds its own name
7
+ * once, then lists its members. `advice` replaces the default "pass a
8
+ * `<member>` override" tail for a double with a better remedy to name.
9
+ *
10
+ * @internal
11
+ */
12
+ const unstubbed = (double, advice) => (member) => Effect.die(/* @__PURE__ */ new Error(`${double}: ${member}() was called but not stubbed — ${advice ?? `pass a \`${member}\` override.`}`));
13
+ /**
14
+ * The die-on-read members of `<double>.makeTest`: a **value** member (an
15
+ * `Effect` the shape holds rather than a function returning one) has no call
16
+ * to defer to, so `unread("settings")` is the `Effect` the double holds in its
17
+ * place, and it defects naming `settings` when run. Dying while BUILDING the
18
+ * double would fail every test that provides it rather than the ones that
19
+ * read the member.
20
+ *
21
+ * @internal
22
+ */
23
+ const unstubbedRead = (double) => (member) => Effect.die(/* @__PURE__ */ new Error(`${double}: ${member} was read but not stubbed — pass a \`${member}\` override.`));
24
+
25
+ export { unstubbed, unstubbedRead };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/github",
3
- "version": "0.23.1",
3
+ "version": "0.25.0",
4
4
  "private": false,
5
5
  "description": "Typed GitHub REST and GraphQL services over the octokit core request surface, with app auth and resource helpers.",
6
6
  "keywords": [
@@ -41,7 +41,7 @@
41
41
  "@effected/github-references": "^0.11.0",
42
42
  "@effected/jwt": "^0.6.0",
43
43
  "@effected/oidc": "^0.1.2",
44
- "@effected/semver": "^0.16.0",
44
+ "@effected/semver": "^0.18.0",
45
45
  "@octokit/core": "^7.0.6",
46
46
  "@octokit/plugin-paginate-rest": "^16.0.0",
47
47
  "@octokit/types": "^18.0.0",