@dual-os/github-api 0.0.0-stage → 6.0.5
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/LICENSE +28 -0
- package/README.md +34 -2
- package/Runner.js +5537 -0
- package/Runner.js.map +59 -0
- package/bundle-inventory.json +1 -0
- package/dist/_virtual/_rolldown/runtime.js +10 -0
- package/dist/_virtual/_rolldown/runtime.js.map +9 -0
- package/dist/auth.d.ts +49 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +21 -0
- package/dist/auth.js.map +9 -0
- package/dist/channel/github-app-client.d.ts +67 -0
- package/dist/channel/github-app-client.d.ts.map +1 -0
- package/dist/channel/github-app-client.js +18 -0
- package/dist/channel/github-app-client.js.map +9 -0
- package/dist/channel/github-app-definition.d.ts +190 -0
- package/dist/channel/github-app-definition.d.ts.map +1 -0
- package/dist/channel/github-app-definition.js +32 -0
- package/dist/channel/github-app-definition.js.map +9 -0
- package/dist/channel/github-app.d.ts +126 -0
- package/dist/channel/github-app.d.ts.map +1 -0
- package/dist/channel/github-app.js +17 -0
- package/dist/channel/github-app.js.map +9 -0
- package/dist/channel/internal/webhook.d.ts +38 -0
- package/dist/channel/internal/webhook.d.ts.map +1 -0
- package/dist/channel/internal/webhook.js +22 -0
- package/dist/channel/internal/webhook.js.map +9 -0
- package/dist/generated/http.d.ts +81 -0
- package/dist/generated/http.d.ts.map +1 -0
- package/dist/generated/http.js +66 -0
- package/dist/generated/http.js.map +9 -0
- package/dist/generated/operations.d.ts +20998 -0
- package/dist/generated/operations.d.ts.map +1 -0
- package/dist/generated/operations.js +4934 -0
- package/dist/generated/operations.js.map +9 -0
- package/dist/generated/plugin.d.ts +6318 -0
- package/dist/generated/plugin.d.ts.map +1 -0
- package/dist/generated/plugin.js +20 -0
- package/dist/generated/plugin.js.map +9 -0
- package/dist/plugin.d.ts +10 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +33 -0
- package/dist/plugin.js.map +10 -0
- package/dist/triggers.d.ts +151 -0
- package/dist/triggers.d.ts.map +1 -0
- package/dist/triggers.js +19 -0
- package/dist/triggers.js.map +9 -0
- package/dual-plugin.json +1 -0
- package/licenses/@dual-os_sdk@0.9.0/LICENSE +4 -0
- package/licenses/@effect_platform-node-shared@4.1.2/LICENSE +21 -0
- package/licenses/@effect_platform-node@4.1.2/LICENSE +21 -0
- package/licenses/effect@4.1.2/LICENSE +21 -0
- package/package.json +1 -6
- package/plugin-1b35jx9g.js +64 -0
- package/plugin-1b35jx9g.js.map +10 -0
- package/plugin-2jdfj02n.js +18 -0
- package/plugin-2jdfj02n.js.map +10 -0
- package/plugin-2qqpmr67.js +108 -0
- package/plugin-2qqpmr67.js.map +10 -0
- package/plugin-3ryytw13.js +1257 -0
- package/plugin-3ryytw13.js.map +17 -0
- package/plugin-5rkcrntd.js +160 -0
- package/plugin-5rkcrntd.js.map +10 -0
- package/plugin-7hfrx1dg.js +167 -0
- package/plugin-7hfrx1dg.js.map +10 -0
- package/plugin-e0mt19z7.js +377 -0
- package/plugin-e0mt19z7.js.map +10 -0
- package/plugin-gtd7vh23.js +25272 -0
- package/plugin-gtd7vh23.js.map +10 -0
- package/plugin-p1y3h7d7.js +10516 -0
- package/plugin-p1y3h7d7.js.map +10 -0
- package/plugin-p6f7n836.js +631 -0
- package/plugin-p6f7n836.js.map +12 -0
- package/plugin-r0m0v72b.js +156 -0
- package/plugin-r0m0v72b.js.map +10 -0
- package/plugin-w0va8331.js +19347 -0
- package/plugin-w0va8331.js.map +158 -0
- package/plugin.json +49 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
Never,
|
|
4
|
+
String3,
|
|
5
|
+
Struct,
|
|
6
|
+
Record,
|
|
7
|
+
ArraySchema,
|
|
8
|
+
Literals,
|
|
9
|
+
isPattern,
|
|
10
|
+
isMaxLength,
|
|
11
|
+
NonEmptyString,
|
|
12
|
+
AuthMethod_exports,
|
|
13
|
+
AgentChannel_exports,
|
|
14
|
+
Plugin_exports
|
|
15
|
+
} from "./plugin-w0va8331.js";
|
|
16
|
+
|
|
17
|
+
// dist/channel/github-app-definition.js
|
|
18
|
+
var apiVersion2 = "2022-11-28";
|
|
19
|
+
var maxCommentLength2 = 65536;
|
|
20
|
+
var GitHubId2 = String3.check(isPattern(/^[1-9][0-9]{0,19}$/u));
|
|
21
|
+
var Permission2 = Literals([
|
|
22
|
+
"read",
|
|
23
|
+
"triage",
|
|
24
|
+
"write",
|
|
25
|
+
"maintain",
|
|
26
|
+
"admin"
|
|
27
|
+
]);
|
|
28
|
+
var Repository3 = String3.check(isPattern(/^[A-Za-z0-9-]{1,39}\/[A-Za-z0-9._-]{1,100}$/u));
|
|
29
|
+
var ConversationKey2 = AgentChannel_exports.Key.check(isPattern(/^[A-Za-z0-9-]{1,39}\/[A-Za-z0-9._-]{1,100}#[1-9][0-9]{0,9}$/u));
|
|
30
|
+
var Credentials2 = Struct({
|
|
31
|
+
appId: GitHubId2,
|
|
32
|
+
privateKey: NonEmptyString.check(isMaxLength(16384)),
|
|
33
|
+
webhookSecret: NonEmptyString.check(isMaxLength(1024))
|
|
34
|
+
});
|
|
35
|
+
var gitHubAppAuth2 = AuthMethod_exports.make("app", {
|
|
36
|
+
description: "The customer's own GitHub App: its App ID, a private key in PEM and the webhook secret. Replies come from the App's bot account.",
|
|
37
|
+
name: "GitHub App",
|
|
38
|
+
schema: Credentials2
|
|
39
|
+
});
|
|
40
|
+
var issuesDefinition2 = {
|
|
41
|
+
authMethods: [gitHubAppAuth2],
|
|
42
|
+
definitionSettings: Record(String3, Never),
|
|
43
|
+
deploymentSettings: Struct({
|
|
44
|
+
installationId: GitHubId2.annotate({
|
|
45
|
+
description: "The App installation, on one user or organization, whose repositories this Channel serves.",
|
|
46
|
+
title: "Installation ID"
|
|
47
|
+
}),
|
|
48
|
+
repositories: ArraySchema(Repository3).check(isMaxLength(1000)).annotate({
|
|
49
|
+
description: "Repositories (owner/repo) of the installation where the Agent can be activated. Leave empty for every repository of the installation.",
|
|
50
|
+
title: "Repositories"
|
|
51
|
+
}),
|
|
52
|
+
access: Literals(["open", "restricted"]).annotate({
|
|
53
|
+
description: "Who can activate the Agent: anyone who can comment (open) or only the allowed people (restricted).",
|
|
54
|
+
title: "Access"
|
|
55
|
+
}),
|
|
56
|
+
allowedSenderKeys: ArraySchema(GitHubId2).check(isMaxLength(1000)).annotate({
|
|
57
|
+
description: "Numeric GitHub user IDs who can activate the Agent when access is restricted.",
|
|
58
|
+
title: "Allowed people"
|
|
59
|
+
}),
|
|
60
|
+
mentionPermission: Permission2.annotate({
|
|
61
|
+
description: "The lowest repository role that can activate the Agent, also when access is open: anyone can comment on a public repository.",
|
|
62
|
+
title: "Lowest repository role"
|
|
63
|
+
}),
|
|
64
|
+
respondTo: Literals(["mentions", "all_messages"]).annotate({
|
|
65
|
+
description: "Which comments activate the Agent: only those that mention the App, or every new issue, pull request and comment in the chosen repositories.",
|
|
66
|
+
title: "Respond to"
|
|
67
|
+
})
|
|
68
|
+
}),
|
|
69
|
+
exposure: "webhook",
|
|
70
|
+
features: {
|
|
71
|
+
assets: false,
|
|
72
|
+
deliveryMode: "at-most-once",
|
|
73
|
+
deliveryState: false,
|
|
74
|
+
directText: true,
|
|
75
|
+
groups: true,
|
|
76
|
+
maxTextLength: maxCommentLength2,
|
|
77
|
+
mentions: false,
|
|
78
|
+
operations: [
|
|
79
|
+
"present_outcome",
|
|
80
|
+
"create_message",
|
|
81
|
+
"update_message",
|
|
82
|
+
"delete_message",
|
|
83
|
+
"set_reaction",
|
|
84
|
+
"render_plan"
|
|
85
|
+
],
|
|
86
|
+
readContext: true,
|
|
87
|
+
replies: false,
|
|
88
|
+
threads: false
|
|
89
|
+
},
|
|
90
|
+
requiredChecks: ["access"],
|
|
91
|
+
state: Struct({
|
|
92
|
+
appId: GitHubId2,
|
|
93
|
+
botUserId: GitHubId2,
|
|
94
|
+
ingressUrl: String3,
|
|
95
|
+
installationId: GitHubId2,
|
|
96
|
+
slug: String3.check(isPattern(/^[a-z0-9][a-z0-9-]{0,99}$/u))
|
|
97
|
+
})
|
|
98
|
+
};
|
|
99
|
+
var issuesChannel2 = AgentChannel_exports.make("agent-issues", {
|
|
100
|
+
...issuesDefinition2,
|
|
101
|
+
description: "GitHub issues and pull requests: one conversation each. A mention of the App, or any comment, starts a turn; it answers with comments and reactions.",
|
|
102
|
+
name: "GitHub issues and pull requests"
|
|
103
|
+
});
|
|
104
|
+
var gitHubAppPluginBase2 = Plugin_exports.make("github-api").pipe(Plugin_exports.withName("GitHub App"), Plugin_exports.withIconUrl("https://github.com/apple-touch-icon.png"), Plugin_exports.withDescription("The customer's own GitHub App, so an Agent answers in issues and pull requests as the App's bot."), Plugin_exports.withAuthMethods([gitHubAppAuth2]), Plugin_exports.withAgentChannel(issuesChannel2));
|
|
105
|
+
export { apiVersion2, maxCommentLength2, GitHubId2, Permission2, Repository3, ConversationKey2, Credentials2, gitHubAppAuth2, issuesDefinition2, issuesChannel2, gitHubAppPluginBase2 };
|
|
106
|
+
|
|
107
|
+
//# debugId=A098643FED41CE4C64756E2164756E21
|
|
108
|
+
//# sourceMappingURL=plugin-2qqpmr67.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../bundle-input/dist/channel/github-app-definition.js"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { Schema } from \"effect\";\nimport { AgentChannel, AuthMethod, Plugin } from \"@dual-os/sdk\";\n//#region src/channel/github-app-definition.ts\n/** The REST API version every request pins. */\nconst apiVersion = \"2022-11-28\";\n/** GitHub's longest comment body, in characters. */\nconst maxCommentLength = 65536;\n/** A numeric GitHub ID, as decimal digits. */\nconst GitHubId = Schema.String.check(Schema.isPattern(/^[1-9][0-9]{0,19}$/u));\n/** The repository roles, lowest first. */\nconst Permission = Schema.Literals([\n\t\"read\",\n\t\"triage\",\n\t\"write\",\n\t\"maintain\",\n\t\"admin\"\n]);\n/** A repository: `owner/repo`. */\nconst Repository = Schema.String.check(Schema.isPattern(/^[A-Za-z0-9-]{1,39}\\/[A-Za-z0-9._-]{1,100}$/u));\n/** An issue or pull request: `owner/repo#number`. */\nconst ConversationKey = AgentChannel.Key.check(Schema.isPattern(/^[A-Za-z0-9-]{1,39}\\/[A-Za-z0-9._-]{1,100}#[1-9][0-9]{0,9}$/u));\n/** What the customer copies from their GitHub App's settings. */\nconst Credentials = Schema.Struct({\n\tappId: GitHubId,\n\tprivateKey: Schema.NonEmptyString.check(Schema.isMaxLength(16384)),\n\twebhookSecret: Schema.NonEmptyString.check(Schema.isMaxLength(1024))\n});\nconst gitHubAppAuth = AuthMethod.make(\"app\", {\n\tdescription: \"The customer's own GitHub App: its App ID, a private key in PEM and the webhook secret. Replies come from the App's bot account.\",\n\tname: \"GitHub App\",\n\tschema: Credentials\n});\nconst issuesDefinition = {\n\tauthMethods: [gitHubAppAuth],\n\tdefinitionSettings: Schema.Record(Schema.String, Schema.Never),\n\tdeploymentSettings: Schema.Struct({\n\t\tinstallationId: GitHubId.annotate({\n\t\t\tdescription: \"The App installation, on one user or organization, whose repositories this Channel serves.\",\n\t\t\ttitle: \"Installation ID\"\n\t\t}),\n\t\trepositories: Schema.Array(Repository).check(Schema.isMaxLength(1e3)).annotate({\n\t\t\tdescription: \"Repositories (owner/repo) of the installation where the Agent can be activated. Leave empty for every repository of the installation.\",\n\t\t\ttitle: \"Repositories\"\n\t\t}),\n\t\taccess: Schema.Literals([\"open\", \"restricted\"]).annotate({\n\t\t\tdescription: \"Who can activate the Agent: anyone who can comment (open) or only the allowed people (restricted).\",\n\t\t\ttitle: \"Access\"\n\t\t}),\n\t\tallowedSenderKeys: Schema.Array(GitHubId).check(Schema.isMaxLength(1e3)).annotate({\n\t\t\tdescription: \"Numeric GitHub user IDs who can activate the Agent when access is restricted.\",\n\t\t\ttitle: \"Allowed people\"\n\t\t}),\n\t\tmentionPermission: Permission.annotate({\n\t\t\tdescription: \"The lowest repository role that can activate the Agent, also when access is open: anyone can comment on a public repository.\",\n\t\t\ttitle: \"Lowest repository role\"\n\t\t}),\n\t\trespondTo: Schema.Literals([\"mentions\", \"all_messages\"]).annotate({\n\t\t\tdescription: \"Which comments activate the Agent: only those that mention the App, or every new issue, pull request and comment in the chosen repositories.\",\n\t\t\ttitle: \"Respond to\"\n\t\t})\n\t}),\n\texposure: \"webhook\",\n\tfeatures: {\n\t\tassets: false,\n\t\tdeliveryMode: \"at-most-once\",\n\t\tdeliveryState: false,\n\t\tdirectText: true,\n\t\tgroups: true,\n\t\tmaxTextLength: maxCommentLength,\n\t\tmentions: false,\n\t\toperations: [\n\t\t\t\"present_outcome\",\n\t\t\t\"create_message\",\n\t\t\t\"update_message\",\n\t\t\t\"delete_message\",\n\t\t\t\"set_reaction\",\n\t\t\t\"render_plan\"\n\t\t],\n\t\treadContext: true,\n\t\treplies: false,\n\t\tthreads: false\n\t},\n\trequiredChecks: [\"access\"],\n\tstate: Schema.Struct({\n\t\tappId: GitHubId,\n\t\tbotUserId: GitHubId,\n\t\tingressUrl: Schema.String,\n\t\tinstallationId: GitHubId,\n\t\tslug: Schema.String.check(Schema.isPattern(/^[a-z0-9][a-z0-9-]{0,99}$/u))\n\t})\n};\nconst issuesChannel = AgentChannel.make(\"agent-issues\", {\n\t...issuesDefinition,\n\tdescription: \"GitHub issues and pull requests: one conversation each. A mention of the App, or any comment, starts a turn; it answers with comments and reactions.\",\n\tname: \"GitHub issues and pull requests\"\n});\nconst gitHubAppPluginBase = Plugin.make(\"github-api\").pipe(Plugin.withName(\"GitHub App\"), Plugin.withIconUrl(\"https://github.com/apple-touch-icon.png\"), Plugin.withDescription(\"The customer's own GitHub App, so an Agent answers in issues and pull requests as the App's bot.\"), Plugin.withAuthMethods([gitHubAppAuth]), Plugin.withAgentChannel(issuesChannel));\n//#endregion\nexport { ConversationKey, Credentials, GitHubId, Permission, Repository, apiVersion, gitHubAppAuth, gitHubAppPlugin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