@effected/github 0.21.0 → 0.23.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/ActionsOidc.js CHANGED
@@ -1,7 +1,7 @@
1
- import { JwksResolver, Jwt, JwtError } from "@effected/jwt";
1
+ import { Oidc } from "@effected/oidc";
2
2
  import { Effect, Schema, SchemaTransformation } from "effect";
3
3
 
4
- //#region src/ActionsOidc.ts
4
+ // src/ActionsOidc.ts
5
5
  /** The issuer of every GitHub Actions OIDC token on github.com. */
6
6
  const ISSUER = "https://token.actions.githubusercontent.com";
7
7
  /**
@@ -23,6 +23,10 @@ const IdFromString = Schema.String.check(Schema.isPattern(/^\d+$/)).pipe(Schema.
23
23
  *
24
24
  * Claims GitHub adds that are not modelled here are dropped on decode.
25
25
  *
26
+ * To decode a payload as it arrives in the token (snake_case keys, string
27
+ * ids), use {@link ActionsOidcClaimsFromWire}; this class itself decodes the
28
+ * camelCase form.
29
+ *
26
30
  * @public
27
31
  */
28
32
  var ActionsOidcClaims = class extends Schema.Class("ActionsOidcClaims")({
@@ -71,8 +75,28 @@ var ActionsOidcClaims = class extends Schema.Class("ActionsOidcClaims")({
71
75
  /** `github-hosted` or `self-hosted` (wire key `runner_environment`). */
72
76
  runnerEnvironment: Schema.String
73
77
  }) {};
74
- /** The claims as they arrive in the token: snake_case keys, decoding to {@link ActionsOidcClaims}. */
75
- const ClaimsFromWire = ActionsOidcClaims.pipe(Schema.encodeKeys({
78
+ /**
79
+ * {@link ActionsOidcClaims} as the claims arrive in the token: snake_case
80
+ * keys and string ids, decoding to the class and encoding back to the wire.
81
+ *
82
+ * @remarks
83
+ * The codec {@link ActionsOidc.verify} decodes a verified payload with.
84
+ * Exported for reading a token this process already trusts, such as one the
85
+ * runner's own token service just issued, and for building one: encoding an
86
+ * instance yields the exact payload GitHub would sign.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * import { ActionsOidcClaimsFromWire } from "@effected/github";
91
+ * import { Oidc } from "@effected/oidc";
92
+ *
93
+ * // Unverified: only for a token handed over by a trusted runtime.
94
+ * const read = (token: string) => Oidc.decodeUnverified(token, ActionsOidcClaimsFromWire);
95
+ * ```
96
+ *
97
+ * @public
98
+ */
99
+ const ActionsOidcClaimsFromWire = ActionsOidcClaims.pipe(Schema.encodeKeys({
76
100
  repositoryId: "repository_id",
77
101
  repositoryOwner: "repository_owner",
78
102
  repositoryOwnerId: "repository_owner_id",
@@ -85,16 +109,11 @@ const ClaimsFromWire = ActionsOidcClaims.pipe(Schema.encodeKeys({
85
109
  runnerEnvironment: "runner_environment"
86
110
  }));
87
111
  const verify = Effect.fn("ActionsOidc.verify")(function* (token, options) {
88
- if (options.audience.length === 0) return yield* new JwtError({
89
- reason: "wrongAudience",
90
- detail: "no audience was given; an Actions OIDC token is never verified without one"
91
- });
92
- return yield* Jwt.verify(token, {
93
- key: JwksResolver.forIssuer(ISSUER),
94
- claims: ClaimsFromWire,
112
+ return yield* Oidc.verify(token, {
95
113
  issuer: ISSUER,
96
114
  audience: options.audience,
97
- ...options.clockTolerance !== void 0 ? { clockTolerance: options.clockTolerance } : {}
115
+ claims: ActionsOidcClaimsFromWire,
116
+ clockTolerance: options.clockTolerance
98
117
  });
99
118
  });
100
119
  const testClaims = (overrides = {}) => ({
@@ -122,8 +141,9 @@ const testClaims = (overrides = {}) => ({
122
141
  * repository, workflow and run it is.
123
142
  *
124
143
  * @remarks
125
- * {@link ActionsOidc.verify} checks the signature against GitHub's published
126
- * JWKS (through `@effected/jwt`'s `JwksResolver`, which caches it), then `iss`,
144
+ * {@link ActionsOidc.verify} is `@effected/oidc`'s `Oidc.verify` pinned to the
145
+ * Actions issuer: it checks the signature against GitHub's published JWKS
146
+ * (through `@effected/jwt`'s `JwksResolver`, which caches it), then `iss`,
127
147
  * `aud`, `exp`, `nbf` and `iat`, then decodes the payload into
128
148
  * {@link ActionsOidcClaims}. Every failure is a `JwtError`; route on its
129
149
  * `reason` (`wrongAudience`, `expired`, `claims`, ...), never on its message.
@@ -141,7 +161,8 @@ const testClaims = (overrides = {}) => ({
141
161
  * are refused as `wrongIssuer`.
142
162
  *
143
163
  * This module does not reach octokit: a service that only verifies tokens
144
- * links `@effected/jwt` and nothing else from this package.
164
+ * links `@effected/oidc` and `@effected/jwt` and nothing else from this
165
+ * package.
145
166
  *
146
167
  * @example
147
168
  * ```ts
@@ -176,5 +197,4 @@ const ActionsOidc = {
176
197
  testClaims
177
198
  };
178
199
 
179
- //#endregion
180
- export { ActionsOidc, ActionsOidcClaims };
200
+ export { ActionsOidc, ActionsOidcClaims, ActionsOidcClaimsFromWire };
@@ -2,7 +2,7 @@ import { GitHubClient } from "./GitHubClient.js";
2
2
  import { Repo } from "./Repo.js";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
4
 
5
- //#region src/ArtifactMetadata.ts
5
+ // src/ArtifactMetadata.ts
6
6
  /**
7
7
  * What to record about a published artifact.
8
8
  *
@@ -62,5 +62,4 @@ const make = (client) => ({ createStorageRecord: Effect.fn("ArtifactMetadata.cre
62
62
  })).storage_records ?? []).flatMap((record) => typeof record.id === "number" ? [record.id] : []);
63
63
  }) });
64
64
 
65
- //#endregion
66
65
  export { ArtifactMetadata, StorageRecordInput };
package/Attestation.js CHANGED
@@ -2,7 +2,7 @@ import { GitHubClient } from "./GitHubClient.js";
2
2
  import { Repo } from "./Repo.js";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
4
 
5
- //#region src/Attestation.ts
5
+ // src/Attestation.ts
6
6
  /**
7
7
  * The api-version this surface pins.
8
8
  *
@@ -108,5 +108,4 @@ const make = (client) => ({
108
108
  })
109
109
  });
110
110
 
111
- //#endregion
112
111
  export { Attestation, AttestationListEntry, AttestationRecord };
@@ -3,7 +3,7 @@ import { GitHubClient } from "./GitHubClient.js";
3
3
  import { numericId } from "./internal/ids.js";
4
4
  import { Context, Effect, Layer, Schema, Stream } from "effect";
5
5
 
6
- //#region src/AuthenticatedApp.ts
6
+ // src/AuthenticatedApp.ts
7
7
  /**
8
8
  * The GitHub App itself, as `GET /app` reports it.
9
9
  *
@@ -179,5 +179,4 @@ const make = (client) => ({
179
179
  })
180
180
  });
181
181
 
182
- //#endregion
183
182
  export { AppInfo, AuthenticatedApp, DeliveryAttempt };
package/CheckRun.js CHANGED
@@ -4,7 +4,7 @@ import { Repo } from "./Repo.js";
4
4
  import { numericId } from "./internal/ids.js";
5
5
  import { Cause, Context, DateTime, Effect, Exit, Layer, Option, Ref, Schema } from "effect";
6
6
 
7
- //#region src/CheckRun.ts
7
+ // src/CheckRun.ts
8
8
  /** How a check run finished. @public */
9
9
  const CheckConclusion = Schema.Literals([
10
10
  "success",
@@ -526,5 +526,4 @@ const make = (client) => {
526
526
  };
527
527
  };
528
528
 
529
- //#endregion
530
529
  export { Annotation, AnnotationLevel, CheckConclusion, CheckRun, CheckRunOutput, CheckRunRef, CheckRunStatus, ReportedCheckConclusion, ReportedCheckRunOutput };
package/CodeScanning.js CHANGED
@@ -2,7 +2,7 @@ import { GitHubClient } from "./GitHubClient.js";
2
2
  import { Repo } from "./Repo.js";
3
3
  import { Context, Effect, Layer } from "effect";
4
4
 
5
- //#region src/CodeScanning.ts
5
+ // src/CodeScanning.ts
6
6
  /**
7
7
  * Configure CodeQL default setup and read the languages GitHub detects in a
8
8
  * repository.
@@ -83,5 +83,4 @@ const make = (client) => {
83
83
  };
84
84
  };
85
85
 
86
- //#endregion
87
86
  export { CodeScanning };
@@ -2,7 +2,7 @@ import { GitHubClient } from "./GitHubClient.js";
2
2
  import { Repo } from "./Repo.js";
3
3
  import { Context, Effect, Layer } from "effect";
4
4
 
5
- //#region src/DeploymentEnvironment.ts
5
+ // src/DeploymentEnvironment.ts
6
6
  /**
7
7
  * Create or update, list and delete a repository's deployment environments.
8
8
  *
@@ -89,5 +89,4 @@ const make = (client) => {
89
89
  };
90
90
  };
91
91
 
92
- //#endregion
93
92
  export { DeploymentEnvironment };
package/GitBranch.js CHANGED
@@ -4,7 +4,7 @@ import { GitHubClient } from "./GitHubClient.js";
4
4
  import { Repo } from "./Repo.js";
5
5
  import { Context, Effect, Layer, Option, Schema } from "effect";
6
6
 
7
- //#region src/GitBranch.ts
7
+ // src/GitBranch.ts
8
8
  const CreateLinkedBranch = GraphQLDocument.make({
9
9
  name: "createLinkedBranch",
10
10
  document: `mutation ($issueId: ID!, $name: String!, $oid: GitObjectID!, $repositoryId: ID!) {
@@ -186,5 +186,4 @@ const make = (client) => {
186
186
  };
187
187
  };
188
188
 
189
- //#endregion
190
189
  export { GitBranch };
package/GitCommit.js CHANGED
@@ -2,7 +2,7 @@ import { GitHubClient } from "./GitHubClient.js";
2
2
  import { Repo } from "./Repo.js";
3
3
  import { Context, Effect, Layer, Schema } from "effect";
4
4
 
5
- //#region src/GitCommit.ts
5
+ // src/GitCommit.ts
6
6
  /**
7
7
  * A blob's file mode, as the Git Database API spells it.
8
8
  *
@@ -199,5 +199,4 @@ const make = (client) => {
199
199
  };
200
200
  };
201
201
 
202
- //#endregion
203
202
  export { CommitRef, FileChange, FileContent, FileDeletion, FileMode, GitCommit };
package/GitHubApp.js CHANGED
@@ -3,10 +3,10 @@ import { GitHubGraphQLError } from "./GraphQL.js";
3
3
  import { GitHubClient, makeClientShape } from "./GitHubClient.js";
4
4
  import { numericId } from "./internal/ids.js";
5
5
  import { InstallationTokenStore } from "./InstallationTokenStore.js";
6
- import { Jwt, JwtKey } from "@effected/jwt";
7
6
  import { Cause, Clock, Context, DateTime, Deferred, Duration, Effect, Layer, Option, Redacted, Ref, Schema, Semaphore, Stream } from "effect";
7
+ import { Jwt, JwtKey } from "@effected/jwt";
8
8
 
9
- //#region src/GitHubApp.ts
9
+ // src/GitHubApp.ts
10
10
  /**
11
11
  * A GitHub App call failed.
12
12
  *
@@ -683,5 +683,4 @@ const makeRotatingClient = (mint, release, options, operation) => Effect.gen(fun
683
683
  };
684
684
  });
685
685
 
686
- //#endregion
687
686
  export { AppIdentity, BotIdentity, BotUser, GitHubApp, GitHubAppError, Installation, InstallationToken };
package/GitHubClient.js CHANGED
@@ -5,7 +5,7 @@ import { makeTransport } from "./internal/octokit.js";
5
5
  import { fromArray, paginate } from "./internal/paginate.js";
6
6
  import { Clock, Config, Context, Effect, Layer, Option, Schema, Stream } from "effect";
7
7
 
8
- //#region src/GitHubClient.ts
8
+ // src/GitHubClient.ts
9
9
  /** GitHub's own maximum page size, and the default this package requests. */
10
10
  const DEFAULT_PER_PAGE = 100;
11
11
  /**
@@ -276,5 +276,4 @@ const makeFixture = (fixtures) => {
276
276
  };
277
277
  };
278
278
 
279
- //#endregion
280
279
  export { GitHubClient, GitHubFixtures, RawFailure, makeClientShape };
package/GitHubCommit.js CHANGED
@@ -3,7 +3,7 @@ import { GitHubClient } from "./GitHubClient.js";
3
3
  import { Repo } from "./Repo.js";
4
4
  import { Context, Effect, Layer, Option, Schema, Stream } from "effect";
5
5
 
6
- //#region src/GitHubCommit.ts
6
+ // src/GitHubCommit.ts
7
7
  /**
8
8
  * A commit, projected to what callers read.
9
9
  *
@@ -227,5 +227,4 @@ const make = (client) => ({
227
227
  })
228
228
  });
229
229
 
230
- //#endregion
231
230
  export { CommitComparison, CommitFile, CommitSummary, FileStatus, GitHubCommit, fileOf };
package/GitHubContent.js CHANGED
@@ -4,7 +4,7 @@ import { Repo } from "./Repo.js";
4
4
  import { Context, Effect, Layer, Option, Result } from "effect";
5
5
  import * as Base64 from "effect/encoding/Base64";
6
6
 
7
- //#region src/GitHubContent.ts
7
+ // src/GitHubContent.ts
8
8
  /**
9
9
  * Non-fatal, matching `Buffer`'s lenient decode of a non-UTF-8 file; `ignoreBOM`
10
10
  * keeps a leading BOM, since it is the file's content rather than framing.
@@ -76,5 +76,4 @@ const make = (client) => {
76
76
  };
77
77
  };
78
78
 
79
- //#endregion
80
79
  export { GitHubContent };
package/GitHubError.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { headerNumber, retryAfterMillisFrom } from "./internal/headers.js";
2
2
  import { Schema } from "effect";
3
3
 
4
- //#region src/GitHubError.ts
4
+ // src/GitHubError.ts
5
5
  /**
6
6
  * Why a GitHub call failed, as a value you can branch on.
7
7
  *
@@ -371,5 +371,4 @@ const readRateLimitHeaders = (headers) => {
371
371
  };
372
372
  };
373
373
 
374
- //#endregion
375
374
  export { GitHubError, GitHubErrorKind, GitHubValidationCode, GitHubValidationEntry, readRateLimitHeaders };
package/GitHubIssue.js CHANGED
@@ -5,7 +5,7 @@ import { numericId } from "./internal/ids.js";
5
5
  import { CommentRecord } from "./PullRequestComment.js";
6
6
  import { Context, Effect, Layer, Schema } from "effect";
7
7
 
8
- //#region src/GitHubIssue.ts
8
+ // src/GitHubIssue.ts
9
9
  /**
10
10
  * An issue, projected to what callers read.
11
11
  *
@@ -314,5 +314,4 @@ const make = (client) => ({
314
314
  })
315
315
  });
316
316
 
317
- //#endregion
318
317
  export { CommentOnceResult, GitHubIssue, IssueInfo, LinkedIssue };
package/GitHubRelease.js CHANGED
@@ -3,7 +3,7 @@ import { GitHubClient } from "./GitHubClient.js";
3
3
  import { Repo } from "./Repo.js";
4
4
  import { Context, Effect, Layer, Option, Schema } from "effect";
5
5
 
6
- //#region src/GitHubRelease.ts
6
+ // src/GitHubRelease.ts
7
7
  /**
8
8
  * A release, projected to the fields callers read.
9
9
  *
@@ -203,5 +203,4 @@ const make = (client) => {
203
203
  /** Release assets do not go to the API host. */
204
204
  const UPLOADS_BASE_URL = "https://uploads.github.com";
205
205
 
206
- //#endregion
207
206
  export { GitHubRelease, ReleaseAsset, ReleaseInfo };
@@ -3,7 +3,7 @@ import { GitHubClient } from "./GitHubClient.js";
3
3
  import { Repo } from "./Repo.js";
4
4
  import { Context, Effect, Layer, Schema } from "effect";
5
5
 
6
- //#region src/GitHubRepository.ts
6
+ // src/GitHubRepository.ts
7
7
  /**
8
8
  * A {@link RepositoryPatch} from a draft, dropping every explicitly-`undefined`
9
9
  * field.
@@ -288,5 +288,4 @@ const make = (client) => {
288
288
  };
289
289
  };
290
290
 
291
- //#endregion
292
291
  export { GRAPHQL_ONLY_SETTINGS, GitHubRepository, SECURITY_ANALYSIS_STATUS_FIELDS, repositoryPatch, transformSecurityAndAnalysis };
package/GitTag.js CHANGED
@@ -4,7 +4,7 @@ import { Repo } from "./Repo.js";
4
4
  import { Context, Effect, Layer, Option, Result, Schema, Stream } from "effect";
5
5
  import { SemVer } from "@effected/semver";
6
6
 
7
- //#region src/GitTag.ts
7
+ // src/GitTag.ts
8
8
  /** How many annotated-tag dereferences to follow before giving up. */
9
9
  const MAX_TAG_PEEL = 5;
10
10
  /**
@@ -205,5 +205,4 @@ const make = (client) => {
205
205
  };
206
206
  };
207
207
 
208
- //#endregion
209
208
  export { GitTag, SemverTag, TagRef, versionFromTag };
package/GraphQL.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { retryAfterMillisFrom } from "./internal/headers.js";
2
2
  import { Schema } from "effect";
3
3
 
4
- //#region src/GraphQL.ts
4
+ // src/GraphQL.ts
5
5
  /**
6
6
  * One entry from a GraphQL response's `errors` array.
7
7
  *
@@ -182,5 +182,4 @@ var GraphQLDocument = class GraphQLDocument {
182
182
  }
183
183
  };
184
184
 
185
- //#endregion
186
185
  export { GitHubGraphQLError, GraphQLDocument, GraphQLErrorEntry };
@@ -1,6 +1,6 @@
1
1
  import { Clock, Context, Duration, Effect, Layer, Option, Ref } from "effect";
2
2
 
3
- //#region src/InstallationTokenStore.ts
3
+ // src/InstallationTokenStore.ts
4
4
  /**
5
5
  * Where `GitHubApp.cachedToken` keeps installation tokens between request
6
6
  * scopes.
@@ -47,5 +47,4 @@ var InstallationTokenStore = class InstallationTokenStore extends Context.Servic
47
47
  static layerTest = (overrides = {}) => Layer.succeed(InstallationTokenStore, InstallationTokenStore.makeTest(overrides));
48
48
  };
49
49
 
50
- //#endregion
51
50
  export { InstallationTokenStore };
package/PullRequest.js CHANGED
@@ -6,7 +6,7 @@ import { fileOf } from "./GitHubCommit.js";
6
6
  import { PageOptions } from "./Rest.js";
7
7
  import { Context, DateTime, Effect, Layer, Option, Schema } from "effect";
8
8
 
9
- //#region src/PullRequest.ts
9
+ // src/PullRequest.ts
10
10
  /** How a pull request is merged. @public */
11
11
  const MergeMethod = Schema.Literals([
12
12
  "merge",
@@ -332,5 +332,4 @@ const make = (client) => {
332
332
  };
333
333
  };
334
334
 
335
- //#endregion
336
335
  export { MergeMethod, PullRequest, PullRequestInfo };
@@ -3,7 +3,7 @@ import { Repo } from "./Repo.js";
3
3
  import { numericId } from "./internal/ids.js";
4
4
  import { Context, Effect, Layer, Option, Schema } from "effect";
5
5
 
6
- //#region src/PullRequestComment.ts
6
+ // src/PullRequestComment.ts
7
7
  /**
8
8
  * The hidden marker that makes a comment findable again.
9
9
  *
@@ -147,5 +147,4 @@ const make = (client) => {
147
147
  };
148
148
  };
149
149
 
150
- //#endregion
151
150
  export { CommentMarker, CommentRecord, PullRequestComment };
package/Repo.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Config, Context, Effect, Layer, Result, Schema } from "effect";
2
2
 
3
- //#region src/Repo.ts
3
+ // src/Repo.ts
4
4
  /**
5
5
  * A repository slug was not `owner/repo`.
6
6
  *
@@ -111,5 +111,4 @@ var Repo = class Repo extends Context.Service()("@effected/github/Repo") {
111
111
  static provide = (ref) => (effect) => Effect.provideService(effect, Repo, ref);
112
112
  };
113
113
 
114
- //#endregion
115
114
  export { InvalidRepoRefError, Repo, RepoRef };
@@ -4,7 +4,7 @@ import { Repo } from "./Repo.js";
4
4
  import { encryptSecret } from "./internal/crypto.js";
5
5
  import { Context, Effect, Layer, Redacted, Result } from "effect";
6
6
 
7
- //#region src/RepositorySecret.ts
7
+ // src/RepositorySecret.ts
8
8
  const ROUTES = {
9
9
  actions: {
10
10
  publicKey: "GET /repos/{owner}/{repo}/actions/secrets/public-key",
@@ -200,5 +200,4 @@ const make = (client) => {
200
200
  };
201
201
  };
202
202
 
203
- //#endregion
204
203
  export { RepositorySecret };
@@ -2,7 +2,7 @@ import { GitHubClient } from "./GitHubClient.js";
2
2
  import { Repo } from "./Repo.js";
3
3
  import { Context, Effect, Layer } from "effect";
4
4
 
5
- //#region src/RepositorySecurity.ts
5
+ // src/RepositorySecurity.ts
6
6
  /**
7
7
  * Read and toggle Dependabot alerts, Dependabot security fixes and private
8
8
  * vulnerability reporting.
@@ -156,5 +156,4 @@ const make = (client) => {
156
156
  };
157
157
  };
158
158
 
159
- //#endregion
160
159
  export { RepositorySecurity };
@@ -2,7 +2,7 @@ import { GitHubClient } from "./GitHubClient.js";
2
2
  import { Repo } from "./Repo.js";
3
3
  import { Context, Effect, Layer } from "effect";
4
4
 
5
- //#region src/RepositoryVariable.ts
5
+ // src/RepositoryVariable.ts
6
6
  /**
7
7
  * Create or update, list and delete Actions variables on a repository and on
8
8
  * its environments.
@@ -188,5 +188,4 @@ const make = (client) => {
188
188
  };
189
189
  };
190
190
 
191
- //#endregion
192
191
  export { RepositoryVariable };
package/Resilience.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Duration, Effect, Random, Schedule, Schema } from "effect";
2
2
 
3
- //#region src/Resilience.ts
3
+ // src/Resilience.ts
4
4
  /**
5
5
  * What GitHub's rate-limit headers said on the most recent REST response.
6
6
  *
@@ -144,5 +144,4 @@ var RetryPolicy = class RetryPolicy extends Schema.Class("RetryPolicy")({
144
144
  }
145
145
  };
146
146
 
147
- //#endregion
148
147
  export { RateLimitSnapshot, RetryPolicy };
package/Rest.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Schema } from "effect";
2
2
 
3
- //#region src/Rest.ts
3
+ // src/Rest.ts
4
4
  /**
5
5
  * How far a paginated read should go.
6
6
  *
@@ -41,5 +41,4 @@ var PageOptions = class PageOptions extends Schema.Class("PageOptions")({
41
41
  }
42
42
  };
43
43
 
44
- //#endregion
45
44
  export { PageOptions };
package/Ruleset.js CHANGED
@@ -3,7 +3,7 @@ import { GitHubClient } from "./GitHubClient.js";
3
3
  import { Repo } from "./Repo.js";
4
4
  import { Context, Effect, Layer } from "effect";
5
5
 
6
- //#region src/Ruleset.ts
6
+ // src/Ruleset.ts
7
7
  /**
8
8
  * Create or update, list and delete repository rulesets, and look up the team
9
9
  * and role ids their bypass actors need.
@@ -160,5 +160,4 @@ const make = (client) => {
160
160
  };
161
161
  };
162
162
 
163
- //#endregion
164
163
  export { Ruleset };
@@ -1,6 +1,6 @@
1
1
  import { Effect, Schema } from "effect";
2
2
 
3
- //#region src/TokenPermissions.ts
3
+ // src/TokenPermissions.ts
4
4
  /**
5
5
  * How much access a permission grants.
6
6
  *
@@ -181,5 +181,4 @@ granted: Schema.Record(Schema.String, PermissionLevel) }) {
181
181
  }
182
182
  };
183
183
 
184
- //#endregion
185
184
  export { ExtraPermission, PermissionGap, PermissionLevel, PermissionResult, TokenPermissionError, TokenPermissions };
@@ -3,9 +3,9 @@ import { GitHubClient } from "./GitHubClient.js";
3
3
  import { Repo } from "./Repo.js";
4
4
  import { numericId } from "./internal/ids.js";
5
5
  import { PageOptions } from "./Rest.js";
6
- import { Clock, Context, Duration, Effect, Layer, Option, Schedule, Schema } from "effect";
6
+ import { Context, DateTime, Duration, Effect, Layer, Option, Schedule, Schema } from "effect";
7
7
 
8
- //#region src/WorkflowDispatch.ts
8
+ // src/WorkflowDispatch.ts
9
9
  /**
10
10
  * Where a workflow run has got to.
11
11
  *
@@ -205,7 +205,7 @@ const make = (client) => {
205
205
  ref,
206
206
  attempts
207
207
  });
208
- const dispatchedAt = new Date(yield* Clock.currentTimeMillis).toISOString();
208
+ const dispatchedAt = yield* Effect.map(DateTime.now, DateTime.formatIso);
209
209
  const dispatched = yield* dispatchWithRun(workflow, ref, options?.inputs);
210
210
  const findRun = Option.isSome(dispatched) ? Effect.map(runStatus(dispatched.value.runId), Option.some) : Effect.gen(function* () {
211
211
  const match = (yield* client.paginate("GET /repos/{owner}/{repo}/actions/runs", {
@@ -230,5 +230,4 @@ const make = (client) => {
230
230
  };
231
231
  };
232
232
 
233
- //#endregion
234
233
  export { DispatchedRun, WorkflowDispatch, WorkflowRunStatus };
package/index.d.ts CHANGED
@@ -4,7 +4,6 @@ import { Cause, Config, Context, Duration, Effect, Layer, Option, Redacted, Resu
4
4
  import { PaginatingEndpoints } from "@octokit/plugin-paginate-rest";
5
5
  import { Endpoints, RequestHeaders } from "@octokit/types";
6
6
  import { SemVer } from "@effected/semver";
7
- //#region src/ActionsOidc.d.ts
8
7
  declare const ActionsOidcClaims_base: Schema.Class<ActionsOidcClaims, Schema.Struct<{
9
8
  /** The issuer: always {@link ActionsOidc.issuer} once verified. */
10
9
  readonly iss: Schema.String;
@@ -64,9 +63,46 @@ declare const ActionsOidcClaims_base: Schema.Class<ActionsOidcClaims, Schema.Str
64
63
  *
65
64
  * Claims GitHub adds that are not modelled here are dropped on decode.
66
65
  *
66
+ * To decode a payload as it arrives in the token (snake_case keys, string
67
+ * ids), use {@link ActionsOidcClaimsFromWire}; this class itself decodes the
68
+ * camelCase form.
69
+ *
67
70
  * @public
68
71
  */
69
72
  export declare class ActionsOidcClaims extends ActionsOidcClaims_base {}
73
+ /**
74
+ * {@link ActionsOidcClaims} as the claims arrive in the token: snake_case
75
+ * keys and string ids, decoding to the class and encoding back to the wire.
76
+ *
77
+ * @remarks
78
+ * The codec {@link ActionsOidc.verify} decodes a verified payload with.
79
+ * Exported for reading a token this process already trusts, such as one the
80
+ * runner's own token service just issued, and for building one: encoding an
81
+ * instance yields the exact payload GitHub would sign.
82
+ *
83
+ * @example
84
+ * ```ts
85
+ * import { ActionsOidcClaimsFromWire } from "@effected/github";
86
+ * import { Oidc } from "@effected/oidc";
87
+ *
88
+ * // Unverified: only for a token handed over by a trusted runtime.
89
+ * const read = (token: string) => Oidc.decodeUnverified(token, ActionsOidcClaimsFromWire);
90
+ * ```
91
+ *
92
+ * @public
93
+ */
94
+ export declare const ActionsOidcClaimsFromWire: Schema.encodeKeys<typeof ActionsOidcClaims, {
95
+ readonly repositoryId: "repository_id";
96
+ readonly repositoryOwner: "repository_owner";
97
+ readonly repositoryOwnerId: "repository_owner_id";
98
+ readonly runId: "run_id";
99
+ readonly runAttempt: "run_attempt";
100
+ readonly workflowRef: "workflow_ref";
101
+ readonly jobWorkflowRef: "job_workflow_ref";
102
+ readonly eventName: "event_name";
103
+ readonly actorId: "actor_id";
104
+ readonly runnerEnvironment: "runner_environment";
105
+ }>;
70
106
  /**
71
107
  * Options for {@link ActionsOidc.verify}.
72
108
  *
@@ -88,8 +124,9 @@ interface ActionsOidcVerifyOptions {
88
124
  * repository, workflow and run it is.
89
125
  *
90
126
  * @remarks
91
- * {@link ActionsOidc.verify} checks the signature against GitHub's published
92
- * JWKS (through `@effected/jwt`'s `JwksResolver`, which caches it), then `iss`,
127
+ * {@link ActionsOidc.verify} is `@effected/oidc`'s `Oidc.verify` pinned to the
128
+ * Actions issuer: it checks the signature against GitHub's published JWKS
129
+ * (through `@effected/jwt`'s `JwksResolver`, which caches it), then `iss`,
93
130
  * `aud`, `exp`, `nbf` and `iat`, then decodes the payload into
94
131
  * {@link ActionsOidcClaims}. Every failure is a `JwtError`; route on its
95
132
  * `reason` (`wrongAudience`, `expired`, `claims`, ...), never on its message.
@@ -107,7 +144,8 @@ interface ActionsOidcVerifyOptions {
107
144
  * are refused as `wrongIssuer`.
108
145
  *
109
146
  * This module does not reach octokit: a service that only verifies tokens
110
- * links `@effected/jwt` and nothing else from this package.
147
+ * links `@effected/oidc` and `@effected/jwt` and nothing else from this
148
+ * package.
111
149
  *
112
150
  * @example
113
151
  * ```ts
@@ -153,8 +191,6 @@ export declare const ActionsOidc: {
153
191
  */
154
192
  readonly testClaims: (overrides?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
155
193
  };
156
- //#endregion
157
- //#region src/GitHubError.d.ts
158
194
  /**
159
195
  * Why a GitHub call failed, as a value you can branch on.
160
196
  *
@@ -342,8 +378,6 @@ export declare class GitHubError extends GitHubError_base {
342
378
  */
343
379
  static hasValidationCode(...codes: ReadonlyArray<(typeof GitHubValidationCode.literals)[number]>): (error: GitHubError) => boolean;
344
380
  }
345
- //#endregion
346
- //#region src/GraphQL.d.ts
347
381
  declare const GraphQLErrorEntry_base: Schema.Class<GraphQLErrorEntry, Schema.Struct<{
348
382
  /** GitHub's prose. */
349
383
  readonly message: Schema.String;
@@ -469,8 +503,6 @@ export declare class GraphQLDocument<A, V extends Record<string, unknown>> {
469
503
  readonly response: Schema.Codec<A, I>;
470
504
  }): <V extends Record<string, unknown>>(encodeVariables?: (variables: V) => Record<string, unknown>) => GraphQLDocument<A, V>;
471
505
  }
472
- //#endregion
473
- //#region src/Resilience.d.ts
474
506
  declare const RateLimitSnapshot_base: Schema.Class<RateLimitSnapshot, Schema.Struct<{
475
507
  /** Requests left in the current window. */
476
508
  readonly remaining: Schema.Int;
@@ -599,8 +631,6 @@ export declare class RetryPolicy extends RetryPolicy_base {
599
631
  */
600
632
  schedule<E extends RetryableFailure>(): Schedule.Schedule<number, E>;
601
633
  }
602
- //#endregion
603
- //#region src/Rest.d.ts
604
634
  /**
605
635
  * Every REST route GitHub documents, as a `"<METHOD> <path>"` literal — for
606
636
  * example `"GET /repos/{owner}/{repo}"`.
@@ -722,8 +752,6 @@ export declare class PageOptions extends PageOptions_base {
722
752
  */
723
753
  static first(perPage: number): PageOptions;
724
754
  }
725
- //#endregion
726
- //#region src/GitHubClient.d.ts
727
755
  /**
728
756
  * The typed GitHub transport: one request, one paginated read, one GraphQL
729
757
  * document, and whatever the rate-limit headers last said.
@@ -1067,8 +1095,6 @@ export declare class GitHubClient extends GitHubClient_base {
1067
1095
  */
1068
1096
  static readonly layerFixture: (fixtures: GitHubFixtures) => Layer.Layer<GitHubClient>;
1069
1097
  }
1070
- //#endregion
1071
- //#region src/Repo.d.ts
1072
1098
  declare const InvalidRepoRefError_base: Schema.Class<InvalidRepoRefError, Schema.TaggedStruct<"InvalidRepoRefError", {
1073
1099
  /** What was handed in. */
1074
1100
  readonly input: Schema.String;
@@ -1172,8 +1198,6 @@ export declare class Repo extends Repo_base {
1172
1198
  /** Run `effect` against a different repository. */
1173
1199
  static readonly provide: (ref: RepoRef) => <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, Exclude<R, Repo>>;
1174
1200
  }
1175
- //#endregion
1176
- //#region src/ArtifactMetadata.d.ts
1177
1201
  declare const StorageRecordInput_base: Schema.Class<StorageRecordInput, Schema.Struct<{
1178
1202
  /** The artifact's package URL (purl). */
1179
1203
  readonly name: Schema.NonEmptyString;
@@ -1230,8 +1254,6 @@ export declare class ArtifactMetadata extends ArtifactMetadata_base {
1230
1254
  /** {@link ArtifactMetadata.makeTest} behind a `Layer`. */
1231
1255
  static readonly layerTest: (overrides?: Partial<ArtifactMetadataShape>) => Layer.Layer<ArtifactMetadata>;
1232
1256
  }
1233
- //#endregion
1234
- //#region src/Attestation.d.ts
1235
1257
  declare const AttestationRecord_base: Schema.Class<AttestationRecord, Schema.Struct<{
1236
1258
  /** GitHub's id for it, when the response carried one. */
1237
1259
  readonly id: Schema.optionalKey<Schema.Int>;
@@ -1300,8 +1322,6 @@ export declare class Attestation extends Attestation_base {
1300
1322
  /** {@link Attestation.makeTest} behind a `Layer`. */
1301
1323
  static readonly layerTest: (overrides?: Partial<AttestationShape>) => Layer.Layer<Attestation>;
1302
1324
  }
1303
- //#endregion
1304
- //#region src/AuthenticatedApp.d.ts
1305
1325
  declare const AppInfo_base: Schema.Class<AppInfo, Schema.Struct<{
1306
1326
  /** The app's numeric id. */
1307
1327
  readonly id: Schema.Int;
@@ -1495,8 +1515,6 @@ export declare class AuthenticatedApp extends AuthenticatedApp_base {
1495
1515
  /** {@link AuthenticatedApp.makeTest} behind a `Layer`. */
1496
1516
  static readonly layerTest: (overrides?: Partial<AuthenticatedAppShape>) => Layer.Layer<AuthenticatedApp>;
1497
1517
  }
1498
- //#endregion
1499
- //#region src/CheckRun.d.ts
1500
1518
  /** How a check run finished. @public */
1501
1519
  export declare const CheckConclusion: Schema.Literals<readonly ["success", "failure", "neutral", "cancelled", "timed_out", "action_required", "skipped"]>;
1502
1520
  /**
@@ -1902,8 +1920,6 @@ export declare class CheckRun extends CheckRun_base {
1902
1920
  /** {@link CheckRun.makeTest} behind a `Layer`. */
1903
1921
  static readonly layerTest: (overrides?: Partial<CheckRunShape>) => Layer.Layer<CheckRun>;
1904
1922
  }
1905
- //#endregion
1906
- //#region src/CodeScanning.d.ts
1907
1923
  /**
1908
1924
  * A CodeQL default-setup configuration.
1909
1925
  *
@@ -1992,8 +2008,6 @@ export declare class CodeScanning extends CodeScanning_base {
1992
2008
  /** {@link CodeScanning.makeTest} behind a `Layer`. */
1993
2009
  static readonly layerTest: (overrides?: Partial<CodeScanningShape>) => Layer.Layer<CodeScanning>;
1994
2010
  }
1995
- //#endregion
1996
- //#region src/DeploymentEnvironment.d.ts
1997
2011
  /**
1998
2012
  * A deployment environment, as listing returns it.
1999
2013
  *
@@ -2071,8 +2085,6 @@ export declare class DeploymentEnvironment extends DeploymentEnvironment_base {
2071
2085
  /** {@link DeploymentEnvironment.makeTest} behind a `Layer`. */
2072
2086
  static readonly layerTest: (overrides?: Partial<DeploymentEnvironmentShape>) => Layer.Layer<DeploymentEnvironment>;
2073
2087
  }
2074
- //#endregion
2075
- //#region src/GitBranch.d.ts
2076
2088
  /**
2077
2089
  * What {@link GitBranchShape.upsert} did.
2078
2090
  *
@@ -2185,8 +2197,6 @@ export declare class GitBranch extends GitBranch_base {
2185
2197
  /** {@link GitBranch.makeTest} behind a `Layer`. */
2186
2198
  static readonly layerTest: (overrides?: Partial<GitBranchShape>) => Layer.Layer<GitBranch>;
2187
2199
  }
2188
- //#endregion
2189
- //#region src/GitCommit.d.ts
2190
2200
  /**
2191
2201
  * A blob's file mode, as the Git Database API spells it.
2192
2202
  *
@@ -2323,8 +2333,6 @@ export declare class GitCommit extends GitCommit_base {
2323
2333
  /** {@link GitCommit.makeTest} behind a `Layer`. */
2324
2334
  static readonly layerTest: (overrides?: Partial<GitCommitShape>) => Layer.Layer<GitCommit>;
2325
2335
  }
2326
- //#endregion
2327
- //#region src/InstallationTokenStore.d.ts
2328
2336
  /**
2329
2337
  * The operations of an {@link InstallationTokenStore}.
2330
2338
  *
@@ -2369,8 +2377,6 @@ export declare class InstallationTokenStore extends InstallationTokenStore_base
2369
2377
  /** {@link InstallationTokenStore.makeTest} behind a `Layer`. */
2370
2378
  static readonly layerTest: (overrides?: Partial<InstallationTokenStoreShape>) => Layer.Layer<InstallationTokenStore>;
2371
2379
  }
2372
- //#endregion
2373
- //#region src/GitHubApp.d.ts
2374
2380
  declare const GitHubAppError_base: Schema.Class<GitHubAppError, Schema.TaggedStruct<"GitHubAppError", {
2375
2381
  /** Which step failed. */
2376
2382
  readonly kind: Schema.Literals<readonly ["jwt", "token", "revoke", "identity", "installation"]>;
@@ -2942,8 +2948,6 @@ interface GitHubAppShape {
2942
2948
  */
2943
2949
  readonly cachedToken: (request: CachedTokenRequest) => Effect.Effect<CachedToken, GitHubAppError, InstallationTokenStore>;
2944
2950
  }
2945
- //#endregion
2946
- //#region src/GitHubCommit.d.ts
2947
2951
  declare const CommitSummary_base: Schema.Class<CommitSummary, Schema.Struct<{
2948
2952
  /** The commit sha. */
2949
2953
  readonly sha: Schema.String;
@@ -3078,8 +3082,6 @@ export declare class GitHubCommit extends GitHubCommit_base {
3078
3082
  /** {@link GitHubCommit.makeTest} behind a `Layer`. */
3079
3083
  static readonly layerTest: (overrides?: Partial<GitHubCommitShape>) => Layer.Layer<GitHubCommit>;
3080
3084
  }
3081
- //#endregion
3082
- //#region src/GitHubContent.d.ts
3083
3085
  /**
3084
3086
  * Read a text file out of a repository at a ref.
3085
3087
  *
@@ -3140,8 +3142,6 @@ export declare class GitHubContent extends GitHubContent_base {
3140
3142
  /** {@link GitHubContent.makeTest} behind a `Layer`. */
3141
3143
  static readonly layerTest: (overrides?: Partial<GitHubContentShape>) => Layer.Layer<GitHubContent>;
3142
3144
  }
3143
- //#endregion
3144
- //#region src/PullRequestComment.d.ts
3145
3145
  declare const CommentMarker_base: Schema.Class<CommentMarker, Schema.Struct<{
3146
3146
  /** Whose comments these are, e.g. your action's name. */
3147
3147
  readonly namespace: Schema.NonEmptyString;
@@ -3238,8 +3238,6 @@ export declare class PullRequestComment extends PullRequestComment_base {
3238
3238
  /** {@link PullRequestComment.makeTest} behind a `Layer`. */
3239
3239
  static readonly layerTest: (overrides?: Partial<PullRequestCommentShape>) => Layer.Layer<PullRequestComment>;
3240
3240
  }
3241
- //#endregion
3242
- //#region src/GitHubIssue.d.ts
3243
3241
  declare const IssueInfo_base: Schema.Class<IssueInfo, Schema.Struct<{
3244
3242
  readonly number: Schema.Int;
3245
3243
  readonly title: Schema.String;
@@ -3397,8 +3395,6 @@ export declare class GitHubIssue extends GitHubIssue_base {
3397
3395
  /** {@link GitHubIssue.makeTest} behind a `Layer`. */
3398
3396
  static readonly layerTest: (overrides?: Partial<GitHubIssueShape>) => Layer.Layer<GitHubIssue>;
3399
3397
  }
3400
- //#endregion
3401
- //#region src/GitHubRelease.d.ts
3402
3398
  declare const ReleaseInfo_base: Schema.Class<ReleaseInfo, Schema.Struct<{
3403
3399
  readonly id: Schema.Int;
3404
3400
  readonly tag: Schema.String;
@@ -3519,8 +3515,6 @@ export declare class GitHubRelease extends GitHubRelease_base {
3519
3515
  /** {@link GitHubRelease.makeTest} behind a `Layer`. */
3520
3516
  static readonly layerTest: (overrides?: Partial<GitHubReleaseShape>) => Layer.Layer<GitHubRelease>;
3521
3517
  }
3522
- //#endregion
3523
- //#region src/GitHubRepository.d.ts
3524
3518
  /**
3525
3519
  * Everything GitHub reports about a repository.
3526
3520
  *
@@ -3761,8 +3755,6 @@ export declare class GitHubRepository extends GitHubRepository_base {
3761
3755
  /** {@link GitHubRepository.makeTest} behind a `Layer`. */
3762
3756
  static readonly layerTest: (overrides?: Partial<GitHubRepositoryShape>) => Layer.Layer<GitHubRepository>;
3763
3757
  }
3764
- //#endregion
3765
- //#region src/GitTag.d.ts
3766
3758
  declare const TagRef_base: Schema.Class<TagRef, Schema.Struct<{
3767
3759
  /** The tag name, without `refs/tags/`. */
3768
3760
  readonly tag: Schema.NonEmptyString;
@@ -3893,8 +3885,6 @@ export declare class GitTag extends GitTag_base {
3893
3885
  /** {@link GitTag.makeTest} behind a `Layer`. */
3894
3886
  static readonly layerTest: (overrides?: Partial<GitTagShape>) => Layer.Layer<GitTag>;
3895
3887
  }
3896
- //#endregion
3897
- //#region src/PullRequest.d.ts
3898
3888
  /** How a pull request is merged. @public */
3899
3889
  export declare const MergeMethod: Schema.Literals<readonly ["merge", "squash", "rebase"]>;
3900
3890
  declare const PullRequestInfo_base: Schema.Class<PullRequestInfo, Schema.Struct<{
@@ -4094,8 +4084,6 @@ export declare class PullRequest extends PullRequest_base {
4094
4084
  /** {@link PullRequest.makeTest} behind a `Layer`. */
4095
4085
  static readonly layerTest: (overrides?: Partial<PullRequestShape>) => Layer.Layer<PullRequest>;
4096
4086
  }
4097
- //#endregion
4098
- //#region src/RepositorySecret.d.ts
4099
4087
  /**
4100
4088
  * Which secret store an operation acts on.
4101
4089
  *
@@ -4192,8 +4180,6 @@ export declare class RepositorySecret extends RepositorySecret_base {
4192
4180
  /** {@link RepositorySecret.makeTest} behind a `Layer`. */
4193
4181
  static readonly layerTest: (overrides?: Partial<RepositorySecretShape>) => Layer.Layer<RepositorySecret>;
4194
4182
  }
4195
- //#endregion
4196
- //#region src/RepositorySecurity.d.ts
4197
4183
  /**
4198
4184
  * Read and toggle the three repository security features that have their own
4199
4185
  * endpoints: Dependabot alerts, Dependabot security fixes and private
@@ -4274,8 +4260,6 @@ export declare class RepositorySecurity extends RepositorySecurity_base {
4274
4260
  /** {@link RepositorySecurity.makeTest} behind a `Layer`. */
4275
4261
  static readonly layerTest: (overrides?: Partial<RepositorySecurityShape>) => Layer.Layer<RepositorySecurity>;
4276
4262
  }
4277
- //#endregion
4278
- //#region src/RepositoryVariable.d.ts
4279
4263
  /**
4280
4264
  * A variable's name and value, as listing returns it.
4281
4265
  *
@@ -4381,8 +4365,6 @@ export declare class RepositoryVariable extends RepositoryVariable_base {
4381
4365
  /** {@link RepositoryVariable.makeTest} behind a `Layer`. */
4382
4366
  static readonly layerTest: (overrides?: Partial<RepositoryVariableShape>) => Layer.Layer<RepositoryVariable>;
4383
4367
  }
4384
- //#endregion
4385
- //#region src/Ruleset.d.ts
4386
4368
  /**
4387
4369
  * A ruleset, as listing returns it.
4388
4370
  *
@@ -4513,8 +4495,6 @@ export declare class Ruleset extends Ruleset_base {
4513
4495
  /** {@link Ruleset.makeTest} behind a `Layer`. */
4514
4496
  static readonly layerTest: (overrides?: Partial<RulesetShape>) => Layer.Layer<Ruleset>;
4515
4497
  }
4516
- //#endregion
4517
- //#region src/TokenPermissions.d.ts
4518
4498
  /**
4519
4499
  * How much access a permission grants.
4520
4500
  *
@@ -4635,8 +4615,6 @@ export declare class TokenPermissions extends TokenPermissions_base {
4635
4615
  */
4636
4616
  assertExact(required: Readonly<Record<string, PermissionLevel>>): Effect.Effect<void, TokenPermissionError>;
4637
4617
  }
4638
- //#endregion
4639
- //#region src/WorkflowDispatch.d.ts
4640
4618
  declare const WorkflowRunStatus_base: Schema.Class<WorkflowRunStatus, Schema.Struct<{
4641
4619
  /** The run's numeric id. */
4642
4620
  readonly id: Schema.Int;
@@ -4828,6 +4806,5 @@ export declare class WorkflowDispatch extends WorkflowDispatch_base {
4828
4806
  /** {@link WorkflowDispatch.makeTest} behind a `Layer`. */
4829
4807
  static readonly layerTest: (overrides?: Partial<WorkflowDispatchShape>) => Layer.Layer<WorkflowDispatch>;
4830
4808
  }
4831
- //#endregion
4832
4809
  export { type ActionsOidcVerifyOptions, type AppCredentials, type AppliedSettings, type ArtifactMetadataShape, type AttestationShape, type AuthenticatedAppShape, type BareLineReference, type BotUserRequest, type BranchOutcome, CLOSING_KEYWORDS, type CachedToken, type CachedTokenRequest, type CheckRunShape, type ClosingKeyword, type CodeScanningSetup, type CodeScanningShape, type CompleteCheckRunOptions, type ConcludeCheckRun, type CreateCheckRunOptions, type DeliveriesOptions, type DeploymentEnvironmentInfo, type DeploymentEnvironmentShape, type GitBranchShape, type GitCommitShape, type GitHubAppOptions, type GitHubAppShape, type GitHubClientOptions, type GitHubClientShape, type GitHubCommitShape, type GitHubContentShape, type GitHubIssueShape, type GitHubReleaseShape, type GitHubRepositoryShape, type GitTagShape, type InstallationTokenStoreShape, type IssueReference, type LatestSemverOptions, type ListCheckRunsOptions, type OwnerType, type PollOptions, type PullRequestCommentShape, type PullRequestShape, type RecordedCall, type RepositoryPatch, type RepositoryPatchDraft, type RepositorySecretShape, type RepositorySecurityShape, type RepositorySettings, type RepositoryVariableShape, type Data as RestData, type RequestExtras as RestExtras, type Item as RestItem, type PaginatingRoute as RestPaginatingRoute, type Params as RestParams, type Response as RestResponse, type Route as RestRoute, type RetryableFailure, type RulesetInfo, type RulesetPayload, type RulesetShape, type SecretInfo, type SecretScope, type TokenRequest, type UpdateCheckRunOptions, type UpsertedPullRequest, type VariableInfo, type VersionFromTag, type WorkflowDispatchShape, type WorkflowInfo, harvestIssueReferences, parseBareLineReference };
4833
4810
  //# sourceMappingURL=index.d.ts.map
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ActionsOidc, ActionsOidcClaims } from "./ActionsOidc.js";
1
+ import { ActionsOidc, ActionsOidcClaims, ActionsOidcClaimsFromWire } from "./ActionsOidc.js";
2
2
  import { GitHubError, GitHubErrorKind, GitHubValidationCode, GitHubValidationEntry } from "./GitHubError.js";
3
3
  import { GitHubGraphQLError, GraphQLDocument, GraphQLErrorEntry } from "./GraphQL.js";
4
4
  import { RateLimitSnapshot, RetryPolicy } from "./Resilience.js";
@@ -31,4 +31,4 @@ import { ExtraPermission, PermissionGap, PermissionLevel, PermissionResult, Toke
31
31
  import { DispatchedRun, WorkflowDispatch, WorkflowRunStatus } from "./WorkflowDispatch.js";
32
32
  import { CLOSING_KEYWORDS, harvestIssueReferences, parseBareLineReference } from "@effected/github-references";
33
33
 
34
- export { ActionsOidc, ActionsOidcClaims, Annotation, AnnotationLevel, AppIdentity, AppInfo, ArtifactMetadata, Attestation, AttestationListEntry, AttestationRecord, AuthenticatedApp, BotIdentity, BotUser, CLOSING_KEYWORDS, CheckConclusion, CheckRun, CheckRunOutput, CheckRunRef, CheckRunStatus, CodeScanning, CommentMarker, CommentOnceResult, CommentRecord, CommitComparison, CommitFile, CommitRef, CommitSummary, DeliveryAttempt, DeploymentEnvironment, DispatchedRun, ExtraPermission, FileChange, FileContent, FileDeletion, FileMode, FileStatus, GRAPHQL_ONLY_SETTINGS, GitBranch, GitCommit, GitHubApp, GitHubAppError, GitHubClient, GitHubCommit, GitHubContent, GitHubError, GitHubErrorKind, GitHubFixtures, GitHubGraphQLError, GitHubIssue, GitHubRelease, GitHubRepository, GitHubValidationCode, GitHubValidationEntry, GitTag, GraphQLDocument, GraphQLErrorEntry, Installation, InstallationToken, InstallationTokenStore, InvalidRepoRefError, IssueInfo, LinkedIssue, MergeMethod, PageOptions, PermissionGap, PermissionLevel, PermissionResult, PullRequest, PullRequestComment, PullRequestInfo, RateLimitSnapshot, RawFailure, ReleaseAsset, ReleaseInfo, Repo, RepoRef, ReportedCheckConclusion, ReportedCheckRunOutput, RepositorySecret, RepositorySecurity, RepositoryVariable, RetryPolicy, Ruleset, SECURITY_ANALYSIS_STATUS_FIELDS, SemverTag, StorageRecordInput, TagRef, TokenPermissionError, TokenPermissions, WorkflowDispatch, WorkflowRunStatus, harvestIssueReferences, parseBareLineReference, repositoryPatch, transformSecurityAndAnalysis, versionFromTag };
34
+ export { ActionsOidc, ActionsOidcClaims, ActionsOidcClaimsFromWire, Annotation, AnnotationLevel, AppIdentity, AppInfo, ArtifactMetadata, Attestation, AttestationListEntry, AttestationRecord, AuthenticatedApp, BotIdentity, BotUser, CLOSING_KEYWORDS, CheckConclusion, CheckRun, CheckRunOutput, CheckRunRef, CheckRunStatus, CodeScanning, CommentMarker, CommentOnceResult, CommentRecord, CommitComparison, CommitFile, CommitRef, CommitSummary, DeliveryAttempt, DeploymentEnvironment, DispatchedRun, ExtraPermission, FileChange, FileContent, FileDeletion, FileMode, FileStatus, GRAPHQL_ONLY_SETTINGS, GitBranch, GitCommit, GitHubApp, GitHubAppError, GitHubClient, GitHubCommit, GitHubContent, GitHubError, GitHubErrorKind, GitHubFixtures, GitHubGraphQLError, GitHubIssue, GitHubRelease, GitHubRepository, GitHubValidationCode, GitHubValidationEntry, GitTag, GraphQLDocument, GraphQLErrorEntry, Installation, InstallationToken, InstallationTokenStore, InvalidRepoRefError, IssueInfo, LinkedIssue, MergeMethod, PageOptions, PermissionGap, PermissionLevel, PermissionResult, PullRequest, PullRequestComment, PullRequestInfo, RateLimitSnapshot, RawFailure, ReleaseAsset, ReleaseInfo, Repo, RepoRef, ReportedCheckConclusion, ReportedCheckRunOutput, RepositorySecret, RepositorySecurity, RepositoryVariable, RetryPolicy, Ruleset, SECURITY_ANALYSIS_STATUS_FIELDS, SemverTag, StorageRecordInput, TagRef, TokenPermissionError, TokenPermissions, WorkflowDispatch, WorkflowRunStatus, harvestIssueReferences, parseBareLineReference, repositoryPatch, transformSecurityAndAnalysis, versionFromTag };
@@ -3,7 +3,7 @@ import * as Base64 from "effect/encoding/Base64";
3
3
  import blakejs from "blakejs";
4
4
  import nacl from "tweetnacl";
5
5
 
6
- //#region src/internal/crypto.ts
6
+ // src/internal/crypto.ts
7
7
  const { blake2b } = blakejs;
8
8
  /** A sealed box opens with the recipient's key; the nonce is derived, not sent. */
9
9
  const NONCE_BYTES = 24;
@@ -60,5 +60,4 @@ const encryptSecret = (publicKey, secretValue) => Result.map(Base64.decode(publi
60
60
  return Base64.encode(sealed);
61
61
  });
62
62
 
63
- //#endregion
64
63
  export { encryptSecret };
@@ -1,4 +1,4 @@
1
- //#region src/internal/headers.ts
1
+ // src/internal/headers.ts
2
2
  /** A header's value as a string, when it is present and non-empty. */
3
3
  const headerString = (headers, name) => {
4
4
  const value = headers?.[name];
@@ -38,5 +38,4 @@ const retryAfterMillisFrom = (headers, nowMillis) => {
38
38
  if (remaining !== void 0 && remaining <= 0 && reset !== void 0) return Math.max(0, reset * 1e3 - nowMillis);
39
39
  };
40
40
 
41
- //#endregion
42
41
  export { headerNumber, headerString, retryAfterMillisFrom };
package/internal/ids.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region src/internal/ids.ts
1
+ // src/internal/ids.ts
2
2
  /**
3
3
  * Narrows the `number | bigint` resource ids `@octokit/types` v17 declares
4
4
  * back to `number`.
@@ -13,5 +13,4 @@
13
13
  */
14
14
  const numericId = (id) => Number(id);
15
15
 
16
- //#endregion
17
16
  export { numericId };
@@ -5,7 +5,7 @@ import { Clock, Effect, Option, Redacted, Ref } from "effect";
5
5
  import { Octokit } from "@octokit/core";
6
6
  import { composePaginateRest } from "@octokit/plugin-paginate-rest";
7
7
 
8
- //#region src/internal/octokit.ts
8
+ // src/internal/octokit.ts
9
9
  const SILENT_LOG = {
10
10
  debug: () => {},
11
11
  info: () => {},
@@ -105,5 +105,4 @@ const readThrownHeaders = (error) => {
105
105
  return typeof headers === "object" && headers !== null ? headers : void 0;
106
106
  };
107
107
 
108
- //#endregion
109
108
  export { makeTransport };
@@ -1,6 +1,6 @@
1
1
  import { Effect, Option, Stream } from "effect";
2
2
 
3
- //#region src/internal/paginate.ts
3
+ // src/internal/paginate.ts
4
4
  /**
5
5
  * Walk a {@link PageSource} into a stream of its items.
6
6
  *
@@ -47,5 +47,4 @@ const fromArray = (items, perPage) => {
47
47
  }) };
48
48
  };
49
49
 
50
- //#endregion
51
50
  export { fromArray, paginate };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effected/github",
3
- "version": "0.21.0",
3
+ "version": "0.23.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": [
@@ -38,9 +38,10 @@
38
38
  "./package.json": "./package.json"
39
39
  },
40
40
  "dependencies": {
41
- "@effected/github-references": "^0.10.0",
42
- "@effected/jwt": "^0.4.0",
43
- "@effected/semver": "^0.14.0",
41
+ "@effected/github-references": "^0.11.0",
42
+ "@effected/jwt": "^0.5.0",
43
+ "@effected/oidc": "^0.1.0",
44
+ "@effected/semver": "^0.15.0",
44
45
  "@octokit/core": "^7.0.6",
45
46
  "@octokit/plugin-paginate-rest": "^16.0.0",
46
47
  "@octokit/types": "^18.0.0",