@effected/github 0.14.0 → 0.15.1
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/ArtifactMetadata.js +7 -5
- package/Attestation.js +7 -1
- package/CheckRun.js +10 -5
- package/CodeScanning.js +8 -1
- package/DeploymentEnvironment.js +19 -1
- package/GitBranch.js +22 -3
- package/GitCommit.js +25 -5
- package/GitHubApp.js +33 -14
- package/GitHubClient.js +24 -18
- package/GitHubCommit.js +20 -1
- package/GitHubContent.js +19 -1
- package/GitHubError.js +11 -22
- package/GitHubIssue.js +24 -8
- package/GitHubRelease.js +20 -2
- package/GitHubRepository.js +25 -11
- package/GitTag.js +19 -1
- package/GraphQL.js +21 -18
- package/PullRequest.js +27 -8
- package/PullRequestComment.js +25 -7
- package/README.md +5 -5
- package/Repo.js +8 -15
- package/RepositorySecret.js +19 -1
- package/RepositorySecurity.js +20 -1
- package/RepositoryVariable.js +19 -1
- package/Resilience.js +18 -16
- package/Rest.js +2 -4
- package/Ruleset.js +25 -4
- package/TokenPermissions.js +8 -11
- package/WorkflowDispatch.js +25 -1
- package/index.d.ts +684 -323
- package/internal/headers.js +0 -10
- package/internal/octokit.js +5 -11
- package/internal/paginate.js +1 -4
- package/package.json +5 -5
package/WorkflowDispatch.js
CHANGED
|
@@ -12,11 +12,13 @@ import { Clock, Context, Duration, Effect, Layer, Option, Schedule, Schema } fro
|
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
14
14
|
var WorkflowRunStatus = class extends Schema.Class("WorkflowRunStatus")({
|
|
15
|
+
/** The run's numeric id. */
|
|
15
16
|
id: Schema.Int,
|
|
16
17
|
/** `queued`, `in_progress`, `completed`, … */
|
|
17
18
|
status: Schema.String,
|
|
18
19
|
/** Set once `status` is `completed`. */
|
|
19
20
|
conclusion: Schema.optionalKey(Schema.String),
|
|
21
|
+
/** The run's web URL. */
|
|
20
22
|
url: Schema.String
|
|
21
23
|
}) {
|
|
22
24
|
/** Has the run finished, whatever the outcome? */
|
|
@@ -27,11 +29,33 @@ var WorkflowRunStatus = class extends Schema.Class("WorkflowRunStatus")({
|
|
|
27
29
|
const DEFAULT_INTERVAL = Duration.seconds(10);
|
|
28
30
|
const DEFAULT_TIMEOUT = Duration.minutes(5);
|
|
29
31
|
/**
|
|
30
|
-
*
|
|
32
|
+
* Dispatch workflows, wait for the run they start, and list the repository's
|
|
33
|
+
* workflows.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Provide it with {@link WorkflowDispatch.layer}, which needs a `GitHubClient`;
|
|
37
|
+
* each method also needs a `Repo` in `R`. `list` is an `Effect` value, not a
|
|
38
|
+
* function.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* import { WorkflowDispatch } from "@effected/github";
|
|
43
|
+
* import { Duration, Effect } from "effect";
|
|
44
|
+
*
|
|
45
|
+
* const release = Effect.gen(function* () {
|
|
46
|
+
* const workflows = yield* WorkflowDispatch;
|
|
47
|
+
* const run = yield* workflows.dispatchAndWait("release.yml", "main", {
|
|
48
|
+
* inputs: { dryRun: "false" },
|
|
49
|
+
* poll: { interval: Duration.seconds(15), timeout: Duration.minutes(20) },
|
|
50
|
+
* });
|
|
51
|
+
* return run.conclusion;
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
31
54
|
*
|
|
32
55
|
* @public
|
|
33
56
|
*/
|
|
34
57
|
var WorkflowDispatch = class WorkflowDispatch extends Context.Service()("@effected/github/WorkflowDispatch") {
|
|
58
|
+
/** The live service, built over a `GitHubClient`. */
|
|
35
59
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
36
60
|
/** An in-memory double; unstubbed members die naming themselves. */
|
|
37
61
|
static makeTest = (overrides = {}) => ({
|