@effected/github 0.14.0 → 0.15.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.
@@ -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
- * Workflow dispatch.
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 = {}) => ({