@effected/github 0.23.0 → 0.24.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 +17 -4
- package/ArtifactMetadata.js +4 -5
- package/Attestation.js +5 -6
- package/AuthenticatedApp.js +8 -9
- package/CheckRun.js +12 -13
- package/CodeScanning.js +5 -6
- package/DeploymentEnvironment.js +6 -7
- package/GitBranch.js +11 -12
- package/GitCommit.js +7 -8
- package/GitHubApp.js +9 -10
- package/GitHubClient.js +42 -11
- package/GitHubCommit.js +7 -8
- package/GitHubContent.js +5 -6
- package/GitHubIssue.js +10 -11
- package/GitHubRelease.js +10 -11
- package/GitHubRepository.js +10 -10
- package/GitTag.js +9 -10
- package/InstallationTokenStore.js +5 -3
- package/PullRequest.js +14 -15
- package/PullRequestComment.js +7 -8
- package/RepositorySecret.js +9 -10
- package/RepositorySecurity.js +9 -10
- package/RepositoryVariable.js +9 -10
- package/Ruleset.js +8 -9
- package/WorkflowDispatch.js +10 -10
- package/index.d.ts +36 -34
- package/internal/unstubbed.js +25 -0
- package/package.json +4 -4
package/GitTag.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GitHubError } from "./GitHubError.js";
|
|
2
|
+
import { unstubbed } from "./internal/unstubbed.js";
|
|
2
3
|
import { GitHubClient } from "./GitHubClient.js";
|
|
3
4
|
import { Repo } from "./Repo.js";
|
|
4
5
|
import { Context, Effect, Layer, Option, Result, Schema, Stream } from "effect";
|
|
@@ -63,21 +64,19 @@ const versionFromTag = (tag) => {
|
|
|
63
64
|
var GitTag = class GitTag extends Context.Service()("@effected/github/GitTag") {
|
|
64
65
|
/** The live service, built over a `GitHubClient`. */
|
|
65
66
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
66
|
-
/** An in-memory double; unstubbed
|
|
67
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
67
68
|
static makeTest = (overrides = {}) => ({
|
|
68
|
-
create: overrides.create ?? (() =>
|
|
69
|
-
upsert: overrides.upsert ?? (() =>
|
|
70
|
-
delete: overrides.delete ?? (() =>
|
|
71
|
-
list: overrides.list ?? (() =>
|
|
72
|
-
resolve: overrides.resolve ?? (() =>
|
|
73
|
-
latestSemver: overrides.latestSemver ?? (() =>
|
|
69
|
+
create: overrides.create ?? (() => dies("create")),
|
|
70
|
+
upsert: overrides.upsert ?? (() => dies("upsert")),
|
|
71
|
+
delete: overrides.delete ?? (() => dies("delete")),
|
|
72
|
+
list: overrides.list ?? (() => dies("list")),
|
|
73
|
+
resolve: overrides.resolve ?? (() => dies("resolve")),
|
|
74
|
+
latestSemver: overrides.latestSemver ?? (() => dies("latestSemver"))
|
|
74
75
|
});
|
|
75
76
|
/** {@link GitTag.makeTest} behind a `Layer`. */
|
|
76
77
|
static layerTest = (overrides = {}) => Layer.succeed(GitTag, GitTag.makeTest(overrides));
|
|
77
78
|
};
|
|
78
|
-
const
|
|
79
|
-
throw new Error(`GitTag.makeTest: ${member}() was called but not stubbed — pass an override.`);
|
|
80
|
-
};
|
|
79
|
+
const dies = unstubbed("GitTag.makeTest");
|
|
81
80
|
const shortTag = (tag) => tag.replace(/^refs\/tags\//, "").replace(/^tags\//, "");
|
|
82
81
|
const rejectEmpty = (operation, tag) => {
|
|
83
82
|
const short = shortTag(tag).trim();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { unstubbed } from "./internal/unstubbed.js";
|
|
1
2
|
import { Clock, Context, Duration, Effect, Layer, Option, Ref } from "effect";
|
|
2
3
|
|
|
3
4
|
// src/InstallationTokenStore.ts
|
|
@@ -38,13 +39,14 @@ var InstallationTokenStore = class InstallationTokenStore extends Context.Servic
|
|
|
38
39
|
}));
|
|
39
40
|
})
|
|
40
41
|
})));
|
|
41
|
-
/** An in-memory double; unstubbed
|
|
42
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
42
43
|
static makeTest = (overrides = {}) => ({
|
|
43
|
-
get: overrides.get ?? (() =>
|
|
44
|
-
set: overrides.set ?? (() =>
|
|
44
|
+
get: overrides.get ?? (() => dies("get")),
|
|
45
|
+
set: overrides.set ?? (() => dies("set"))
|
|
45
46
|
});
|
|
46
47
|
/** {@link InstallationTokenStore.makeTest} behind a `Layer`. */
|
|
47
48
|
static layerTest = (overrides = {}) => Layer.succeed(InstallationTokenStore, InstallationTokenStore.makeTest(overrides));
|
|
48
49
|
};
|
|
50
|
+
const dies = unstubbed("InstallationTokenStore.makeTest");
|
|
49
51
|
|
|
50
52
|
export { InstallationTokenStore };
|
package/PullRequest.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { GitHubError } from "./GitHubError.js";
|
|
2
2
|
import { GraphQLDocument } from "./GraphQL.js";
|
|
3
|
+
import { unstubbed } from "./internal/unstubbed.js";
|
|
3
4
|
import { GitHubClient } from "./GitHubClient.js";
|
|
4
5
|
import { Repo } from "./Repo.js";
|
|
5
6
|
import { fileOf } from "./GitHubCommit.js";
|
|
@@ -110,26 +111,24 @@ const GRAPHQL_MERGE_METHOD = {
|
|
|
110
111
|
var PullRequest = class PullRequest extends Context.Service()("@effected/github/PullRequest") {
|
|
111
112
|
/** The live service, built over a `GitHubClient`. */
|
|
112
113
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
113
|
-
/** An in-memory double; unstubbed
|
|
114
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
114
115
|
static makeTest = (overrides = {}) => ({
|
|
115
|
-
get: overrides.get ?? (() =>
|
|
116
|
-
list: overrides.list ?? (() =>
|
|
117
|
-
listFiles: overrides.listFiles ?? (() =>
|
|
118
|
-
listAssociatedWithCommit: overrides.listAssociatedWithCommit ?? (() =>
|
|
119
|
-
create: overrides.create ?? (() =>
|
|
120
|
-
update: overrides.update ?? (() =>
|
|
121
|
-
upsert: overrides.upsert ?? (() =>
|
|
122
|
-
merge: overrides.merge ?? (() =>
|
|
123
|
-
addLabels: overrides.addLabels ?? (() =>
|
|
124
|
-
requestReviewers: overrides.requestReviewers ?? (() =>
|
|
125
|
-
setAutoMerge: overrides.setAutoMerge ?? (() =>
|
|
116
|
+
get: overrides.get ?? (() => dies("get")),
|
|
117
|
+
list: overrides.list ?? (() => dies("list")),
|
|
118
|
+
listFiles: overrides.listFiles ?? (() => dies("listFiles")),
|
|
119
|
+
listAssociatedWithCommit: overrides.listAssociatedWithCommit ?? (() => dies("listAssociatedWithCommit")),
|
|
120
|
+
create: overrides.create ?? (() => dies("create")),
|
|
121
|
+
update: overrides.update ?? (() => dies("update")),
|
|
122
|
+
upsert: overrides.upsert ?? (() => dies("upsert")),
|
|
123
|
+
merge: overrides.merge ?? (() => dies("merge")),
|
|
124
|
+
addLabels: overrides.addLabels ?? (() => dies("addLabels")),
|
|
125
|
+
requestReviewers: overrides.requestReviewers ?? (() => dies("requestReviewers")),
|
|
126
|
+
setAutoMerge: overrides.setAutoMerge ?? (() => dies("setAutoMerge"))
|
|
126
127
|
});
|
|
127
128
|
/** {@link PullRequest.makeTest} behind a `Layer`. */
|
|
128
129
|
static layerTest = (overrides = {}) => Layer.succeed(PullRequest, PullRequest.makeTest(overrides));
|
|
129
130
|
};
|
|
130
|
-
const
|
|
131
|
-
throw new Error(`PullRequest.makeTest: ${member}() was called but not stubbed — pass an override.`);
|
|
132
|
-
};
|
|
131
|
+
const dies = unstubbed("PullRequest.makeTest");
|
|
133
132
|
const project = (raw) => Effect.try({
|
|
134
133
|
try: () => PullRequestInfo.make({
|
|
135
134
|
number: raw.number,
|
package/PullRequestComment.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { unstubbed } from "./internal/unstubbed.js";
|
|
1
2
|
import { GitHubClient } from "./GitHubClient.js";
|
|
2
3
|
import { Repo } from "./Repo.js";
|
|
3
4
|
import { numericId } from "./internal/ids.js";
|
|
@@ -66,19 +67,17 @@ var CommentRecord = class extends Schema.Class("CommentRecord")({
|
|
|
66
67
|
var PullRequestComment = class PullRequestComment extends Context.Service()("@effected/github/PullRequestComment") {
|
|
67
68
|
/** The live service, built over a `GitHubClient`. */
|
|
68
69
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
69
|
-
/** An in-memory double; unstubbed
|
|
70
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
70
71
|
static makeTest = (overrides = {}) => ({
|
|
71
|
-
create: overrides.create ?? (() =>
|
|
72
|
-
upsert: overrides.upsert ?? (() =>
|
|
73
|
-
find: overrides.find ?? (() =>
|
|
74
|
-
delete: overrides.delete ?? (() =>
|
|
72
|
+
create: overrides.create ?? (() => dies("create")),
|
|
73
|
+
upsert: overrides.upsert ?? (() => dies("upsert")),
|
|
74
|
+
find: overrides.find ?? (() => dies("find")),
|
|
75
|
+
delete: overrides.delete ?? (() => dies("delete"))
|
|
75
76
|
});
|
|
76
77
|
/** {@link PullRequestComment.makeTest} behind a `Layer`. */
|
|
77
78
|
static layerTest = (overrides = {}) => Layer.succeed(PullRequestComment, PullRequestComment.makeTest(overrides));
|
|
78
79
|
};
|
|
79
|
-
const
|
|
80
|
-
throw new Error(`PullRequestComment.makeTest: ${member}() was called but not stubbed — pass an override.`);
|
|
81
|
-
};
|
|
80
|
+
const dies = unstubbed("PullRequestComment.makeTest");
|
|
82
81
|
const recordOf = (raw) => CommentRecord.make({
|
|
83
82
|
id: numericId(raw.id),
|
|
84
83
|
body: raw.body ?? "",
|
package/RepositorySecret.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GitHubError } from "./GitHubError.js";
|
|
2
|
+
import { unstubbed } from "./internal/unstubbed.js";
|
|
2
3
|
import { GitHubClient } from "./GitHubClient.js";
|
|
3
4
|
import { Repo } from "./Repo.js";
|
|
4
5
|
import { encryptSecret } from "./internal/crypto.js";
|
|
@@ -70,21 +71,19 @@ var RepositorySecret = class RepositorySecret extends Context.Service()("@effect
|
|
|
70
71
|
* further down throws at import time with a clean typecheck.
|
|
71
72
|
*/
|
|
72
73
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
73
|
-
/** An in-memory double; unstubbed
|
|
74
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
74
75
|
static makeTest = (overrides = {}) => ({
|
|
75
|
-
set: overrides.set ?? (() =>
|
|
76
|
-
list: overrides.list ?? (() =>
|
|
77
|
-
delete: overrides.delete ?? (() =>
|
|
78
|
-
setForEnvironment: overrides.setForEnvironment ?? (() =>
|
|
79
|
-
listForEnvironment: overrides.listForEnvironment ?? (() =>
|
|
80
|
-
deleteForEnvironment: overrides.deleteForEnvironment ?? (() =>
|
|
76
|
+
set: overrides.set ?? (() => dies("set")),
|
|
77
|
+
list: overrides.list ?? (() => dies("list")),
|
|
78
|
+
delete: overrides.delete ?? (() => dies("delete")),
|
|
79
|
+
setForEnvironment: overrides.setForEnvironment ?? (() => dies("setForEnvironment")),
|
|
80
|
+
listForEnvironment: overrides.listForEnvironment ?? (() => dies("listForEnvironment")),
|
|
81
|
+
deleteForEnvironment: overrides.deleteForEnvironment ?? (() => dies("deleteForEnvironment"))
|
|
81
82
|
});
|
|
82
83
|
/** {@link RepositorySecret.makeTest} behind a `Layer`. */
|
|
83
84
|
static layerTest = (overrides = {}) => Layer.succeed(RepositorySecret, RepositorySecret.makeTest(overrides));
|
|
84
85
|
};
|
|
85
|
-
const
|
|
86
|
-
throw new Error(`RepositorySecret.makeTest: ${member}() was called but not stubbed — pass an override.`);
|
|
87
|
-
};
|
|
86
|
+
const dies = unstubbed("RepositorySecret.makeTest");
|
|
88
87
|
/**
|
|
89
88
|
* Seal a value, turning a malformed public key into a typed failure.
|
|
90
89
|
*
|
package/RepositorySecurity.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { unstubbed } from "./internal/unstubbed.js";
|
|
1
2
|
import { GitHubClient } from "./GitHubClient.js";
|
|
2
3
|
import { Repo } from "./Repo.js";
|
|
3
4
|
import { Context, Effect, Layer } from "effect";
|
|
@@ -56,21 +57,19 @@ var RepositorySecurity = class RepositorySecurity extends Context.Service()("@ef
|
|
|
56
57
|
* further down throws at import time with a clean typecheck.
|
|
57
58
|
*/
|
|
58
59
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
59
|
-
/** An in-memory double; unstubbed
|
|
60
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
60
61
|
static makeTest = (overrides = {}) => ({
|
|
61
|
-
vulnerabilityAlerts: overrides.vulnerabilityAlerts ?? (() =>
|
|
62
|
-
setVulnerabilityAlerts: overrides.setVulnerabilityAlerts ?? (() =>
|
|
63
|
-
automatedSecurityFixes: overrides.automatedSecurityFixes ?? (() =>
|
|
64
|
-
setAutomatedSecurityFixes: overrides.setAutomatedSecurityFixes ?? (() =>
|
|
65
|
-
privateVulnerabilityReporting: overrides.privateVulnerabilityReporting ?? (() =>
|
|
66
|
-
setPrivateVulnerabilityReporting: overrides.setPrivateVulnerabilityReporting ?? (() =>
|
|
62
|
+
vulnerabilityAlerts: overrides.vulnerabilityAlerts ?? (() => dies("vulnerabilityAlerts")),
|
|
63
|
+
setVulnerabilityAlerts: overrides.setVulnerabilityAlerts ?? (() => dies("setVulnerabilityAlerts")),
|
|
64
|
+
automatedSecurityFixes: overrides.automatedSecurityFixes ?? (() => dies("automatedSecurityFixes")),
|
|
65
|
+
setAutomatedSecurityFixes: overrides.setAutomatedSecurityFixes ?? (() => dies("setAutomatedSecurityFixes")),
|
|
66
|
+
privateVulnerabilityReporting: overrides.privateVulnerabilityReporting ?? (() => dies("privateVulnerabilityReporting")),
|
|
67
|
+
setPrivateVulnerabilityReporting: overrides.setPrivateVulnerabilityReporting ?? (() => dies("setPrivateVulnerabilityReporting"))
|
|
67
68
|
});
|
|
68
69
|
/** {@link RepositorySecurity.makeTest} behind a `Layer`. */
|
|
69
70
|
static layerTest = (overrides = {}) => Layer.succeed(RepositorySecurity, RepositorySecurity.makeTest(overrides));
|
|
70
71
|
};
|
|
71
|
-
const
|
|
72
|
-
throw new Error(`RepositorySecurity.makeTest: ${member}() was called but not stubbed — pass an override.`);
|
|
73
|
-
};
|
|
72
|
+
const dies = unstubbed("RepositorySecurity.makeTest");
|
|
74
73
|
const make = (client) => {
|
|
75
74
|
return {
|
|
76
75
|
vulnerabilityAlerts: Effect.fn("RepositorySecurity.vulnerabilityAlerts")(function* () {
|
package/RepositoryVariable.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { unstubbed } from "./internal/unstubbed.js";
|
|
1
2
|
import { GitHubClient } from "./GitHubClient.js";
|
|
2
3
|
import { Repo } from "./Repo.js";
|
|
3
4
|
import { Context, Effect, Layer } from "effect";
|
|
@@ -40,21 +41,19 @@ var RepositoryVariable = class RepositoryVariable extends Context.Service()("@ef
|
|
|
40
41
|
* further down throws at import time with a clean typecheck.
|
|
41
42
|
*/
|
|
42
43
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
43
|
-
/** An in-memory double; unstubbed
|
|
44
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
44
45
|
static makeTest = (overrides = {}) => ({
|
|
45
|
-
set: overrides.set ?? (() =>
|
|
46
|
-
list: overrides.list ?? (() =>
|
|
47
|
-
delete: overrides.delete ?? (() =>
|
|
48
|
-
setForEnvironment: overrides.setForEnvironment ?? (() =>
|
|
49
|
-
listForEnvironment: overrides.listForEnvironment ?? (() =>
|
|
50
|
-
deleteForEnvironment: overrides.deleteForEnvironment ?? (() =>
|
|
46
|
+
set: overrides.set ?? (() => dies("set")),
|
|
47
|
+
list: overrides.list ?? (() => dies("list")),
|
|
48
|
+
delete: overrides.delete ?? (() => dies("delete")),
|
|
49
|
+
setForEnvironment: overrides.setForEnvironment ?? (() => dies("setForEnvironment")),
|
|
50
|
+
listForEnvironment: overrides.listForEnvironment ?? (() => dies("listForEnvironment")),
|
|
51
|
+
deleteForEnvironment: overrides.deleteForEnvironment ?? (() => dies("deleteForEnvironment"))
|
|
51
52
|
});
|
|
52
53
|
/** {@link RepositoryVariable.makeTest} behind a `Layer`. */
|
|
53
54
|
static layerTest = (overrides = {}) => Layer.succeed(RepositoryVariable, RepositoryVariable.makeTest(overrides));
|
|
54
55
|
};
|
|
55
|
-
const
|
|
56
|
-
throw new Error(`RepositoryVariable.makeTest: ${member}() was called but not stubbed — pass an override.`);
|
|
57
|
-
};
|
|
56
|
+
const dies = unstubbed("RepositoryVariable.makeTest");
|
|
58
57
|
const make = (client) => {
|
|
59
58
|
/**
|
|
60
59
|
* Does this variable already exist? One by-name read, not a listing.
|
package/Ruleset.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GitHubError } from "./GitHubError.js";
|
|
2
|
+
import { unstubbed } from "./internal/unstubbed.js";
|
|
2
3
|
import { GitHubClient } from "./GitHubClient.js";
|
|
3
4
|
import { Repo } from "./Repo.js";
|
|
4
5
|
import { Context, Effect, Layer } from "effect";
|
|
@@ -52,20 +53,18 @@ var Ruleset = class Ruleset extends Context.Service()("@effected/github/Ruleset"
|
|
|
52
53
|
* further down throws at import time with a clean typecheck.
|
|
53
54
|
*/
|
|
54
55
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
55
|
-
/** An in-memory double; unstubbed
|
|
56
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
56
57
|
static makeTest = (overrides = {}) => ({
|
|
57
|
-
upsert: overrides.upsert ?? (() =>
|
|
58
|
-
list: overrides.list ?? (() =>
|
|
59
|
-
delete: overrides.delete ?? (() =>
|
|
60
|
-
teamId: overrides.teamId ?? (() =>
|
|
61
|
-
roleId: overrides.roleId ?? (() =>
|
|
58
|
+
upsert: overrides.upsert ?? (() => dies("upsert")),
|
|
59
|
+
list: overrides.list ?? (() => dies("list")),
|
|
60
|
+
delete: overrides.delete ?? (() => dies("delete")),
|
|
61
|
+
teamId: overrides.teamId ?? (() => dies("teamId")),
|
|
62
|
+
roleId: overrides.roleId ?? (() => dies("roleId"))
|
|
62
63
|
});
|
|
63
64
|
/** {@link Ruleset.makeTest} behind a `Layer`. */
|
|
64
65
|
static layerTest = (overrides = {}) => Layer.succeed(Ruleset, Ruleset.makeTest(overrides));
|
|
65
66
|
};
|
|
66
|
-
const
|
|
67
|
-
throw new Error(`Ruleset.makeTest: ${member}() was called but not stubbed — pass an override.`);
|
|
68
|
-
};
|
|
67
|
+
const dies = unstubbed("Ruleset.makeTest");
|
|
69
68
|
/** An inherited ruleset belongs to the organization and is not this repository's to write. */
|
|
70
69
|
const isOwnedByRepository = (ruleset) => ruleset.source_type !== "Organization";
|
|
71
70
|
const make = (client) => {
|
package/WorkflowDispatch.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GitHubError } from "./GitHubError.js";
|
|
2
|
+
import { unstubbed, unstubbedRead } from "./internal/unstubbed.js";
|
|
2
3
|
import { GitHubClient } from "./GitHubClient.js";
|
|
3
4
|
import { Repo } from "./Repo.js";
|
|
4
5
|
import { numericId } from "./internal/ids.js";
|
|
@@ -75,21 +76,20 @@ const DEFAULT_TIMEOUT = Duration.minutes(5);
|
|
|
75
76
|
var WorkflowDispatch = class WorkflowDispatch extends Context.Service()("@effected/github/WorkflowDispatch") {
|
|
76
77
|
/** The live service, built over a `GitHubClient`. */
|
|
77
78
|
static layer = Layer.effect(this, Effect.map(GitHubClient, (client) => make(client)));
|
|
78
|
-
/** An in-memory double; unstubbed
|
|
79
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
79
80
|
static makeTest = (overrides = {}) => ({
|
|
80
|
-
dispatch: overrides.dispatch ?? (() =>
|
|
81
|
-
dispatchWithRun: overrides.dispatchWithRun ?? (() =>
|
|
82
|
-
runStatus: overrides.runStatus ?? (() =>
|
|
83
|
-
cancelRun: overrides.cancelRun ?? (() =>
|
|
84
|
-
list: overrides.list ??
|
|
85
|
-
dispatchAndWait: overrides.dispatchAndWait ?? (() =>
|
|
81
|
+
dispatch: overrides.dispatch ?? (() => dies("dispatch")),
|
|
82
|
+
dispatchWithRun: overrides.dispatchWithRun ?? (() => dies("dispatchWithRun")),
|
|
83
|
+
runStatus: overrides.runStatus ?? (() => dies("runStatus")),
|
|
84
|
+
cancelRun: overrides.cancelRun ?? (() => dies("cancelRun")),
|
|
85
|
+
list: overrides.list ?? unread("list"),
|
|
86
|
+
dispatchAndWait: overrides.dispatchAndWait ?? (() => dies("dispatchAndWait"))
|
|
86
87
|
});
|
|
87
88
|
/** {@link WorkflowDispatch.makeTest} behind a `Layer`. */
|
|
88
89
|
static layerTest = (overrides = {}) => Layer.succeed(WorkflowDispatch, WorkflowDispatch.makeTest(overrides));
|
|
89
90
|
};
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
};
|
|
91
|
+
const dies = unstubbed("WorkflowDispatch.makeTest");
|
|
92
|
+
const unread = unstubbedRead("WorkflowDispatch.makeTest");
|
|
93
93
|
const statusOf = (raw) => WorkflowRunStatus.make({
|
|
94
94
|
id: numericId(raw.id),
|
|
95
95
|
status: raw.status ?? "unknown",
|
package/index.d.ts
CHANGED
|
@@ -174,11 +174,12 @@ interface ActionsOidcVerifyOptions {
|
|
|
174
174
|
*
|
|
175
175
|
* @public
|
|
176
176
|
*/
|
|
177
|
-
export declare
|
|
177
|
+
export declare class ActionsOidc {
|
|
178
|
+
private constructor();
|
|
178
179
|
/** The Actions OIDC issuer, `https://token.actions.githubusercontent.com`. */
|
|
179
|
-
readonly issuer: "https://token.actions.githubusercontent.com";
|
|
180
|
+
static readonly issuer: "https://token.actions.githubusercontent.com";
|
|
180
181
|
/** Verify a runner-issued OIDC token: signature against GitHub's JWKS, iss, aud, exp/nbf, then typed claims. */
|
|
181
|
-
readonly verify: (token: string, options: ActionsOidcVerifyOptions) => Effect.Effect<ActionsOidcClaims, JwtError, JwksResolver>;
|
|
182
|
+
static readonly verify: (token: string, options: ActionsOidcVerifyOptions) => Effect.Effect<ActionsOidcClaims, JwtError, JwksResolver>;
|
|
182
183
|
/**
|
|
183
184
|
* A valid claims payload for tests, overridable field by field.
|
|
184
185
|
*
|
|
@@ -189,8 +190,8 @@ export declare const ActionsOidc: {
|
|
|
189
190
|
* {@link ActionsOidc.issuer}; `aud` is a placeholder to override with the
|
|
190
191
|
* audience under test.
|
|
191
192
|
*/
|
|
192
|
-
readonly testClaims: (overrides?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
|
|
193
|
-
}
|
|
193
|
+
static readonly testClaims: (overrides?: Readonly<Record<string, unknown>>) => Record<string, unknown>;
|
|
194
|
+
}
|
|
194
195
|
/**
|
|
195
196
|
* Why a GitHub call failed, as a value you can branch on.
|
|
196
197
|
*
|
|
@@ -864,7 +865,7 @@ interface RecordedCall {
|
|
|
864
865
|
}
|
|
865
866
|
/**
|
|
866
867
|
* A raw HTTP failure recorded for {@link GitHubClient.layerFixture}, made by
|
|
867
|
-
* {@link (GitHubFixtures:
|
|
868
|
+
* {@link (GitHubFixtures:class).failure}.
|
|
868
869
|
*
|
|
869
870
|
* @remarks
|
|
870
871
|
* Branded, so a fixture's data payload that happens to have a `status` and a
|
|
@@ -894,7 +895,8 @@ export declare class RawFailure {
|
|
|
894
895
|
*
|
|
895
896
|
* @public
|
|
896
897
|
*/
|
|
897
|
-
export declare
|
|
898
|
+
export declare class GitHubFixtures {
|
|
899
|
+
private constructor();
|
|
898
900
|
/**
|
|
899
901
|
* A raw failure: what GitHub answered, classified at call time by the same
|
|
900
902
|
* classifier the live client uses.
|
|
@@ -924,12 +926,12 @@ export declare const GitHubFixtures: {
|
|
|
924
926
|
* });
|
|
925
927
|
* ```
|
|
926
928
|
*/
|
|
927
|
-
readonly failure: (response: {
|
|
929
|
+
static readonly failure: (response: {
|
|
928
930
|
readonly status: number;
|
|
929
931
|
readonly headers?: Readonly<Record<string, string>> | undefined;
|
|
930
932
|
readonly body?: unknown;
|
|
931
933
|
}) => RawFailure;
|
|
932
|
-
}
|
|
934
|
+
}
|
|
933
935
|
/**
|
|
934
936
|
* A recorded response table for {@link GitHubClient.layerFixture}.
|
|
935
937
|
*
|
|
@@ -944,7 +946,7 @@ export interface GitHubFixtures {
|
|
|
944
946
|
* is how a suite stubs a 404 (or a rate-limit, or a 422) deliberately,
|
|
945
947
|
* rather than relying on a route's absence to produce one — absence is a
|
|
946
948
|
* wiring mistake and {@link (GitHubFixtures:interface).unstubbed} treats it as
|
|
947
|
-
* such. A {@link RawFailure} from {@link (GitHubFixtures:
|
|
949
|
+
* such. A {@link RawFailure} from {@link (GitHubFixtures:class).failure}
|
|
948
950
|
* fails it too, classified from GitHub's raw response.
|
|
949
951
|
*
|
|
950
952
|
* A value of `undefined` counts as unstubbed, so stub a route that answers
|
|
@@ -1088,7 +1090,7 @@ export declare class GitHubClient extends GitHubClient_base {
|
|
|
1088
1090
|
*
|
|
1089
1091
|
* **It records every call it serves, including one that fails.** A call
|
|
1090
1092
|
* answered by a recorded `GitHubError` or a
|
|
1091
|
-
* {@link (GitHubFixtures:
|
|
1093
|
+
* {@link (GitHubFixtures:class).failure} is recorded before it fails, so
|
|
1092
1094
|
* one fixture both records the calls and classifies a raw failure the way
|
|
1093
1095
|
* the live client would; there is no need to classify by hand inside a
|
|
1094
1096
|
* {@link GitHubClient.layerTest} handler.
|
|
@@ -1249,7 +1251,7 @@ declare const ArtifactMetadata_base: Context.ServiceClass<ArtifactMetadata, "@ef
|
|
|
1249
1251
|
export declare class ArtifactMetadata extends ArtifactMetadata_base {
|
|
1250
1252
|
/** The live service, built over a `GitHubClient`. */
|
|
1251
1253
|
static readonly layer: Layer.Layer<ArtifactMetadata, never, GitHubClient>;
|
|
1252
|
-
/** An in-memory double; unstubbed
|
|
1254
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
1253
1255
|
static readonly makeTest: (overrides?: Partial<ArtifactMetadataShape>) => ArtifactMetadataShape;
|
|
1254
1256
|
/** {@link ArtifactMetadata.makeTest} behind a `Layer`. */
|
|
1255
1257
|
static readonly layerTest: (overrides?: Partial<ArtifactMetadataShape>) => Layer.Layer<ArtifactMetadata>;
|
|
@@ -1317,7 +1319,7 @@ declare const Attestation_base: Context.ServiceClass<Attestation, "@effected/git
|
|
|
1317
1319
|
export declare class Attestation extends Attestation_base {
|
|
1318
1320
|
/** The live service, built over a `GitHubClient`. */
|
|
1319
1321
|
static readonly layer: Layer.Layer<Attestation, never, GitHubClient>;
|
|
1320
|
-
/** An in-memory double; unstubbed
|
|
1322
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
1321
1323
|
static readonly makeTest: (overrides?: Partial<AttestationShape>) => AttestationShape;
|
|
1322
1324
|
/** {@link Attestation.makeTest} behind a `Layer`. */
|
|
1323
1325
|
static readonly layerTest: (overrides?: Partial<AttestationShape>) => Layer.Layer<Attestation>;
|
|
@@ -1510,7 +1512,7 @@ declare const AuthenticatedApp_base: Context.ServiceClass<AuthenticatedApp, "@ef
|
|
|
1510
1512
|
export declare class AuthenticatedApp extends AuthenticatedApp_base {
|
|
1511
1513
|
/** The live service, built over an App-JWT `GitHubClient`. */
|
|
1512
1514
|
static readonly layer: Layer.Layer<AuthenticatedApp, never, GitHubClient>;
|
|
1513
|
-
/** An in-memory double; unstubbed
|
|
1515
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
1514
1516
|
static readonly makeTest: (overrides?: Partial<AuthenticatedAppShape>) => AuthenticatedAppShape;
|
|
1515
1517
|
/** {@link AuthenticatedApp.makeTest} behind a `Layer`. */
|
|
1516
1518
|
static readonly layerTest: (overrides?: Partial<AuthenticatedAppShape>) => Layer.Layer<AuthenticatedApp>;
|
|
@@ -1915,7 +1917,7 @@ declare const CheckRun_base: Context.ServiceClass<CheckRun, "@effected/github/Ch
|
|
|
1915
1917
|
export declare class CheckRun extends CheckRun_base {
|
|
1916
1918
|
/** The live service, built over a `GitHubClient`. */
|
|
1917
1919
|
static readonly layer: Layer.Layer<CheckRun, never, GitHubClient>;
|
|
1918
|
-
/** An in-memory double; unstubbed
|
|
1920
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
1919
1921
|
static readonly makeTest: (overrides?: Partial<CheckRunShape>) => CheckRunShape;
|
|
1920
1922
|
/** {@link CheckRun.makeTest} behind a `Layer`. */
|
|
1921
1923
|
static readonly layerTest: (overrides?: Partial<CheckRunShape>) => Layer.Layer<CheckRun>;
|
|
@@ -2003,7 +2005,7 @@ export declare class CodeScanning extends CodeScanning_base {
|
|
|
2003
2005
|
* with a clean typecheck.
|
|
2004
2006
|
*/
|
|
2005
2007
|
static readonly layer: Layer.Layer<CodeScanning, never, GitHubClient>;
|
|
2006
|
-
/** An in-memory double; unstubbed
|
|
2008
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
2007
2009
|
static readonly makeTest: (overrides?: Partial<CodeScanningShape>) => CodeScanningShape;
|
|
2008
2010
|
/** {@link CodeScanning.makeTest} behind a `Layer`. */
|
|
2009
2011
|
static readonly layerTest: (overrides?: Partial<CodeScanningShape>) => Layer.Layer<CodeScanning>;
|
|
@@ -2080,7 +2082,7 @@ export declare class DeploymentEnvironment extends DeploymentEnvironment_base {
|
|
|
2080
2082
|
* further down throws at import time with a clean typecheck.
|
|
2081
2083
|
*/
|
|
2082
2084
|
static readonly layer: Layer.Layer<DeploymentEnvironment, never, GitHubClient>;
|
|
2083
|
-
/** An in-memory double; unstubbed
|
|
2085
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
2084
2086
|
static readonly makeTest: (overrides?: Partial<DeploymentEnvironmentShape>) => DeploymentEnvironmentShape;
|
|
2085
2087
|
/** {@link DeploymentEnvironment.makeTest} behind a `Layer`. */
|
|
2086
2088
|
static readonly layerTest: (overrides?: Partial<DeploymentEnvironmentShape>) => Layer.Layer<DeploymentEnvironment>;
|
|
@@ -2192,7 +2194,7 @@ export declare class GitBranch extends GitBranch_base {
|
|
|
2192
2194
|
* layer is built.
|
|
2193
2195
|
*/
|
|
2194
2196
|
static readonly layer: Layer.Layer<GitBranch, never, GitHubClient>;
|
|
2195
|
-
/** An in-memory double; unstubbed
|
|
2197
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
2196
2198
|
static readonly makeTest: (overrides?: Partial<GitBranchShape>) => GitBranchShape;
|
|
2197
2199
|
/** {@link GitBranch.makeTest} behind a `Layer`. */
|
|
2198
2200
|
static readonly layerTest: (overrides?: Partial<GitBranchShape>) => Layer.Layer<GitBranch>;
|
|
@@ -2328,7 +2330,7 @@ declare const GitCommit_base: Context.ServiceClass<GitCommit, "@effected/github/
|
|
|
2328
2330
|
export declare class GitCommit extends GitCommit_base {
|
|
2329
2331
|
/** The live service, built over a `GitHubClient`. */
|
|
2330
2332
|
static readonly layer: Layer.Layer<GitCommit, never, GitHubClient>;
|
|
2331
|
-
/** An in-memory double; unstubbed
|
|
2333
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
2332
2334
|
static readonly makeTest: (overrides?: Partial<GitCommitShape>) => GitCommitShape;
|
|
2333
2335
|
/** {@link GitCommit.makeTest} behind a `Layer`. */
|
|
2334
2336
|
static readonly layerTest: (overrides?: Partial<GitCommitShape>) => Layer.Layer<GitCommit>;
|
|
@@ -2372,7 +2374,7 @@ declare const InstallationTokenStore_base: Context.ServiceClass<InstallationToke
|
|
|
2372
2374
|
export declare class InstallationTokenStore extends InstallationTokenStore_base {
|
|
2373
2375
|
/** An in-process store over a `Ref`, expiring entries against `Clock`. */
|
|
2374
2376
|
static readonly layerMemory: Layer.Layer<InstallationTokenStore>;
|
|
2375
|
-
/** An in-memory double; unstubbed
|
|
2377
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
2376
2378
|
static readonly makeTest: (overrides?: Partial<InstallationTokenStoreShape>) => InstallationTokenStoreShape;
|
|
2377
2379
|
/** {@link InstallationTokenStore.makeTest} behind a `Layer`. */
|
|
2378
2380
|
static readonly layerTest: (overrides?: Partial<InstallationTokenStoreShape>) => Layer.Layer<InstallationTokenStore>;
|
|
@@ -2875,7 +2877,7 @@ export declare class GitHubApp extends GitHubApp_base {
|
|
|
2875
2877
|
* ```
|
|
2876
2878
|
*/
|
|
2877
2879
|
static readonly cachedClientLayer: (request: CachedTokenRequest, options?: GitHubAppOptions) => Layer.Layer<GitHubClient, GitHubAppError, GitHubApp | InstallationTokenStore>;
|
|
2878
|
-
/** An in-memory double; unstubbed
|
|
2880
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
2879
2881
|
static readonly makeTest: (overrides?: Partial<GitHubAppShape>) => GitHubAppShape;
|
|
2880
2882
|
/** {@link GitHubApp.makeTest} behind a `Layer`. */
|
|
2881
2883
|
static readonly layerTest: (overrides?: Partial<GitHubAppShape>) => Layer.Layer<GitHubApp>;
|
|
@@ -3077,7 +3079,7 @@ declare const GitHubCommit_base: Context.ServiceClass<GitHubCommit, "@effected/g
|
|
|
3077
3079
|
export declare class GitHubCommit extends GitHubCommit_base {
|
|
3078
3080
|
/** The live service, built over a `GitHubClient`. */
|
|
3079
3081
|
static readonly layer: Layer.Layer<GitHubCommit, never, GitHubClient>;
|
|
3080
|
-
/** An in-memory double; unstubbed
|
|
3082
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
3081
3083
|
static readonly makeTest: (overrides?: Partial<GitHubCommitShape>) => GitHubCommitShape;
|
|
3082
3084
|
/** {@link GitHubCommit.makeTest} behind a `Layer`. */
|
|
3083
3085
|
static readonly layerTest: (overrides?: Partial<GitHubCommitShape>) => Layer.Layer<GitHubCommit>;
|
|
@@ -3137,7 +3139,7 @@ declare const GitHubContent_base: Context.ServiceClass<GitHubContent, "@effected
|
|
|
3137
3139
|
export declare class GitHubContent extends GitHubContent_base {
|
|
3138
3140
|
/** The live service, built over a `GitHubClient`. */
|
|
3139
3141
|
static readonly layer: Layer.Layer<GitHubContent, never, GitHubClient>;
|
|
3140
|
-
/** An in-memory double; unstubbed
|
|
3142
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
3141
3143
|
static readonly makeTest: (overrides?: Partial<GitHubContentShape>) => GitHubContentShape;
|
|
3142
3144
|
/** {@link GitHubContent.makeTest} behind a `Layer`. */
|
|
3143
3145
|
static readonly layerTest: (overrides?: Partial<GitHubContentShape>) => Layer.Layer<GitHubContent>;
|
|
@@ -3233,7 +3235,7 @@ declare const PullRequestComment_base: Context.ServiceClass<PullRequestComment,
|
|
|
3233
3235
|
export declare class PullRequestComment extends PullRequestComment_base {
|
|
3234
3236
|
/** The live service, built over a `GitHubClient`. */
|
|
3235
3237
|
static readonly layer: Layer.Layer<PullRequestComment, never, GitHubClient>;
|
|
3236
|
-
/** An in-memory double; unstubbed
|
|
3238
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
3237
3239
|
static readonly makeTest: (overrides?: Partial<PullRequestCommentShape>) => PullRequestCommentShape;
|
|
3238
3240
|
/** {@link PullRequestComment.makeTest} behind a `Layer`. */
|
|
3239
3241
|
static readonly layerTest: (overrides?: Partial<PullRequestCommentShape>) => Layer.Layer<PullRequestComment>;
|
|
@@ -3390,7 +3392,7 @@ declare const GitHubIssue_base: Context.ServiceClass<GitHubIssue, "@effected/git
|
|
|
3390
3392
|
export declare class GitHubIssue extends GitHubIssue_base {
|
|
3391
3393
|
/** The live service, built over a `GitHubClient`. */
|
|
3392
3394
|
static readonly layer: Layer.Layer<GitHubIssue, never, GitHubClient>;
|
|
3393
|
-
/** An in-memory double; unstubbed
|
|
3395
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
3394
3396
|
static readonly makeTest: (overrides?: Partial<GitHubIssueShape>) => GitHubIssueShape;
|
|
3395
3397
|
/** {@link GitHubIssue.makeTest} behind a `Layer`. */
|
|
3396
3398
|
static readonly layerTest: (overrides?: Partial<GitHubIssueShape>) => Layer.Layer<GitHubIssue>;
|
|
@@ -3510,7 +3512,7 @@ declare const GitHubRelease_base: Context.ServiceClass<GitHubRelease, "@effected
|
|
|
3510
3512
|
export declare class GitHubRelease extends GitHubRelease_base {
|
|
3511
3513
|
/** The live service, built over a `GitHubClient`. */
|
|
3512
3514
|
static readonly layer: Layer.Layer<GitHubRelease, never, GitHubClient>;
|
|
3513
|
-
/** An in-memory double; unstubbed
|
|
3515
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
3514
3516
|
static readonly makeTest: (overrides?: Partial<GitHubReleaseShape>) => GitHubReleaseShape;
|
|
3515
3517
|
/** {@link GitHubRelease.makeTest} behind a `Layer`. */
|
|
3516
3518
|
static readonly layerTest: (overrides?: Partial<GitHubReleaseShape>) => Layer.Layer<GitHubRelease>;
|
|
@@ -3750,7 +3752,7 @@ declare const GitHubRepository_base: Context.ServiceClass<GitHubRepository, "@ef
|
|
|
3750
3752
|
export declare class GitHubRepository extends GitHubRepository_base {
|
|
3751
3753
|
/** The live service, built over a `GitHubClient`. */
|
|
3752
3754
|
static readonly layer: Layer.Layer<GitHubRepository, never, GitHubClient>;
|
|
3753
|
-
/** An in-memory double; unstubbed
|
|
3755
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
3754
3756
|
static readonly makeTest: (overrides?: Partial<GitHubRepositoryShape>) => GitHubRepositoryShape;
|
|
3755
3757
|
/** {@link GitHubRepository.makeTest} behind a `Layer`. */
|
|
3756
3758
|
static readonly layerTest: (overrides?: Partial<GitHubRepositoryShape>) => Layer.Layer<GitHubRepository>;
|
|
@@ -3880,7 +3882,7 @@ declare const GitTag_base: Context.ServiceClass<GitTag, "@effected/github/GitTag
|
|
|
3880
3882
|
export declare class GitTag extends GitTag_base {
|
|
3881
3883
|
/** The live service, built over a `GitHubClient`. */
|
|
3882
3884
|
static readonly layer: Layer.Layer<GitTag, never, GitHubClient>;
|
|
3883
|
-
/** An in-memory double; unstubbed
|
|
3885
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
3884
3886
|
static readonly makeTest: (overrides?: Partial<GitTagShape>) => GitTagShape;
|
|
3885
3887
|
/** {@link GitTag.makeTest} behind a `Layer`. */
|
|
3886
3888
|
static readonly layerTest: (overrides?: Partial<GitTagShape>) => Layer.Layer<GitTag>;
|
|
@@ -4079,7 +4081,7 @@ declare const PullRequest_base: Context.ServiceClass<PullRequest, "@effected/git
|
|
|
4079
4081
|
export declare class PullRequest extends PullRequest_base {
|
|
4080
4082
|
/** The live service, built over a `GitHubClient`. */
|
|
4081
4083
|
static readonly layer: Layer.Layer<PullRequest, never, GitHubClient>;
|
|
4082
|
-
/** An in-memory double; unstubbed
|
|
4084
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
4083
4085
|
static readonly makeTest: (overrides?: Partial<PullRequestShape>) => PullRequestShape;
|
|
4084
4086
|
/** {@link PullRequest.makeTest} behind a `Layer`. */
|
|
4085
4087
|
static readonly layerTest: (overrides?: Partial<PullRequestShape>) => Layer.Layer<PullRequest>;
|
|
@@ -4175,7 +4177,7 @@ export declare class RepositorySecret extends RepositorySecret_base {
|
|
|
4175
4177
|
* further down throws at import time with a clean typecheck.
|
|
4176
4178
|
*/
|
|
4177
4179
|
static readonly layer: Layer.Layer<RepositorySecret, never, GitHubClient>;
|
|
4178
|
-
/** An in-memory double; unstubbed
|
|
4180
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
4179
4181
|
static readonly makeTest: (overrides?: Partial<RepositorySecretShape>) => RepositorySecretShape;
|
|
4180
4182
|
/** {@link RepositorySecret.makeTest} behind a `Layer`. */
|
|
4181
4183
|
static readonly layerTest: (overrides?: Partial<RepositorySecretShape>) => Layer.Layer<RepositorySecret>;
|
|
@@ -4255,7 +4257,7 @@ export declare class RepositorySecurity extends RepositorySecurity_base {
|
|
|
4255
4257
|
* further down throws at import time with a clean typecheck.
|
|
4256
4258
|
*/
|
|
4257
4259
|
static readonly layer: Layer.Layer<RepositorySecurity, never, GitHubClient>;
|
|
4258
|
-
/** An in-memory double; unstubbed
|
|
4260
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
4259
4261
|
static readonly makeTest: (overrides?: Partial<RepositorySecurityShape>) => RepositorySecurityShape;
|
|
4260
4262
|
/** {@link RepositorySecurity.makeTest} behind a `Layer`. */
|
|
4261
4263
|
static readonly layerTest: (overrides?: Partial<RepositorySecurityShape>) => Layer.Layer<RepositorySecurity>;
|
|
@@ -4360,7 +4362,7 @@ export declare class RepositoryVariable extends RepositoryVariable_base {
|
|
|
4360
4362
|
* further down throws at import time with a clean typecheck.
|
|
4361
4363
|
*/
|
|
4362
4364
|
static readonly layer: Layer.Layer<RepositoryVariable, never, GitHubClient>;
|
|
4363
|
-
/** An in-memory double; unstubbed
|
|
4365
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
4364
4366
|
static readonly makeTest: (overrides?: Partial<RepositoryVariableShape>) => RepositoryVariableShape;
|
|
4365
4367
|
/** {@link RepositoryVariable.makeTest} behind a `Layer`. */
|
|
4366
4368
|
static readonly layerTest: (overrides?: Partial<RepositoryVariableShape>) => Layer.Layer<RepositoryVariable>;
|
|
@@ -4490,7 +4492,7 @@ export declare class Ruleset extends Ruleset_base {
|
|
|
4490
4492
|
* further down throws at import time with a clean typecheck.
|
|
4491
4493
|
*/
|
|
4492
4494
|
static readonly layer: Layer.Layer<Ruleset, never, GitHubClient>;
|
|
4493
|
-
/** An in-memory double; unstubbed
|
|
4495
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
4494
4496
|
static readonly makeTest: (overrides?: Partial<RulesetShape>) => RulesetShape;
|
|
4495
4497
|
/** {@link Ruleset.makeTest} behind a `Layer`. */
|
|
4496
4498
|
static readonly layerTest: (overrides?: Partial<RulesetShape>) => Layer.Layer<Ruleset>;
|
|
@@ -4801,7 +4803,7 @@ declare const WorkflowDispatch_base: Context.ServiceClass<WorkflowDispatch, "@ef
|
|
|
4801
4803
|
export declare class WorkflowDispatch extends WorkflowDispatch_base {
|
|
4802
4804
|
/** The live service, built over a `GitHubClient`. */
|
|
4803
4805
|
static readonly layer: Layer.Layer<WorkflowDispatch, never, GitHubClient>;
|
|
4804
|
-
/** An in-memory double; unstubbed
|
|
4806
|
+
/** An in-memory double; an unstubbed member dies when run, naming itself. */
|
|
4805
4807
|
static readonly makeTest: (overrides?: Partial<WorkflowDispatchShape>) => WorkflowDispatchShape;
|
|
4806
4808
|
/** {@link WorkflowDispatch.makeTest} behind a `Layer`. */
|
|
4807
4809
|
static readonly layerTest: (overrides?: Partial<WorkflowDispatchShape>) => Layer.Layer<WorkflowDispatch>;
|
|
@@ -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 };
|