@dual-os/github-api 0.0.0-stage → 6.0.3

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.
Files changed (46) hide show
  1. package/LICENSE +4 -0
  2. package/Runner.js +5771 -0
  3. package/Runner.js.map +63 -0
  4. package/bundle-inventory.json +1 -0
  5. package/dist/_virtual/_rolldown/runtime.js +10 -0
  6. package/dist/_virtual/_rolldown/runtime.js.map +9 -0
  7. package/dist/auth.d.ts +37 -0
  8. package/dist/auth.d.ts.map +1 -0
  9. package/dist/auth.js +19 -0
  10. package/dist/auth.js.map +9 -0
  11. package/dist/generated/http.d.ts +81 -0
  12. package/dist/generated/http.d.ts.map +1 -0
  13. package/dist/generated/http.js +64 -0
  14. package/dist/generated/http.js.map +9 -0
  15. package/dist/generated/operations.d.ts +20998 -0
  16. package/dist/generated/operations.d.ts.map +1 -0
  17. package/dist/generated/operations.js +4932 -0
  18. package/dist/generated/operations.js.map +9 -0
  19. package/dist/generated/plugin.d.ts +6318 -0
  20. package/dist/generated/plugin.d.ts.map +1 -0
  21. package/dist/generated/plugin.js +10521 -0
  22. package/dist/generated/plugin.js.map +10 -0
  23. package/dist/triggers.d.ts +127 -0
  24. package/dist/triggers.d.ts.map +1 -0
  25. package/dist/triggers.js +17 -0
  26. package/dist/triggers.js.map +9 -0
  27. package/dual-plugin.json +1 -0
  28. package/licenses/@dual-os_sdk@0.8.1/LICENSE +4 -0
  29. package/licenses/@effect_platform-node-shared@4.1.2/LICENSE +21 -0
  30. package/licenses/@effect_platform-node@4.1.2/LICENSE +21 -0
  31. package/licenses/effect@4.1.2/LICENSE +21 -0
  32. package/package.json +1 -6
  33. package/plugin-2jdfj02n.js +18 -0
  34. package/plugin-2jdfj02n.js.map +10 -0
  35. package/plugin-3mpmm6hc.js +160 -0
  36. package/plugin-3mpmm6hc.js.map +10 -0
  37. package/plugin-ahctqzvj.js +25272 -0
  38. package/plugin-ahctqzvj.js.map +10 -0
  39. package/plugin-gajxsj3f.js +19140 -0
  40. package/plugin-gajxsj3f.js.map +159 -0
  41. package/plugin-t4j28rxn.js +62 -0
  42. package/plugin-t4j28rxn.js.map +10 -0
  43. package/plugin-yzj02c6j.js +1372 -0
  44. package/plugin-yzj02c6j.js.map +18 -0
  45. package/plugin.json +49 -0
  46. package/README.md +0 -3
@@ -0,0 +1,127 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { Action, Trigger } from "@dual-os/sdk";
3
+ //#region src/triggers.d.ts
4
+ export declare const triggers: readonly [Trigger.Trigger<"event", "webhook", Schema.Struct<{
5
+ readonly events: Schema.$Array<Schema.Literals<readonly ["*", "check_run", "check_suite", "commit_comment", "create", "delete", "deploy_key", "deployment", "deployment_status", "fork", "github_app_authorization", "gollum", "installation", "installation_repositories", "issue_comment", "issues", "label", "marketplace_purchase", "member", "membership", "meta", "milestone", "org_block", "organization", "page_build", "project", "project_card", "project_column", "public", "pull_request", "pull_request_review", "pull_request_review_comment", "push", "release", "repository", "repository_import", "repository_vulnerability_alert", "security_advisory", "star", "status", "team", "team_add", "watch"]>>;
6
+ readonly insecureSSL: Schema.optionalKey<Schema.Boolean>;
7
+ readonly owner: Schema.String;
8
+ readonly repository: Schema.String;
9
+ }>, Schema.StructWithRest<Schema.Struct<{
10
+ readonly action: Schema.optionalKey<Schema.String>;
11
+ readonly ref: Schema.optionalKey<Schema.String>;
12
+ }>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>, Schema.Struct<{
13
+ readonly hookId: Schema.Int;
14
+ readonly secret: Schema.String;
15
+ }>, true>];
16
+ export declare const handlers: {
17
+ event: {
18
+ activate: (input: Trigger.WebhookActivationInput<{
19
+ readonly events: readonly ("*" | "check_run" | "check_suite" | "commit_comment" | "create" | "delete" | "deploy_key" | "deployment" | "deployment_status" | "fork" | "github_app_authorization" | "gollum" | "installation" | "installation_repositories" | "issue_comment" | "issues" | "label" | "marketplace_purchase" | "member" | "membership" | "meta" | "milestone" | "org_block" | "organization" | "page_build" | "project" | "project_card" | "project_column" | "public" | "pull_request" | "pull_request_review" | "pull_request_review_comment" | "push" | "release" | "repository" | "repository_import" | "repository_vulnerability_alert" | "security_advisory" | "star" | "status" | "team" | "team_add" | "watch")[];
20
+ readonly insecureSSL?: boolean;
21
+ readonly owner: string;
22
+ readonly repository: string;
23
+ }, {
24
+ readonly hookId: number;
25
+ readonly secret: string;
26
+ } | undefined>, context: {
27
+ readonly auth: import("@dual-os/sdk/AuthMethodBinding").Context<readonly [import("@dual-os/sdk/AuthMethod").AuthMethod<"personal-access-token", undefined, Schema.Struct<{
28
+ readonly server: Schema.optionalKey<Schema.String>;
29
+ readonly token: Schema.NonEmptyString;
30
+ }>, Schema.Struct<{
31
+ readonly server: Schema.optionalKey<Schema.String>;
32
+ readonly token: Schema.NonEmptyString;
33
+ }>, Schema.Struct<{
34
+ readonly server: Schema.optionalKey<Schema.String>;
35
+ readonly token: Schema.NonEmptyString;
36
+ }>, never>, import("@dual-os/sdk/AuthMethod").AuthMethod<"oauth2", Schema.Struct<{
37
+ readonly clientId: Schema.String;
38
+ readonly clientSecret: Schema.String;
39
+ readonly server: Schema.optional<Schema.String>;
40
+ }>, undefined, Schema.Struct<{
41
+ readonly accessToken: Schema.String;
42
+ readonly expiresAt: Schema.optional<Schema.Number>;
43
+ readonly expiresIn: Schema.optional<Schema.Number>;
44
+ readonly raw: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
45
+ readonly refreshToken: Schema.optional<Schema.String>;
46
+ readonly scope: Schema.optional<Schema.String>;
47
+ readonly tokenType: Schema.optional<Schema.String>;
48
+ }>, Schema.Struct<{
49
+ readonly accessToken: Schema.String;
50
+ readonly server: Schema.optional<Schema.String>;
51
+ }>, import("@dual-os/sdk/OAuth2TokenRefresher").Service>]>;
52
+ } & import("@dual-os/sdk/ConnectionResolver").ConnectionResolutionContext) => Effect.Effect<{
53
+ state: {
54
+ hookId: number;
55
+ secret: string;
56
+ };
57
+ }, Action.ActionHandlerFailure, import("effect/http/HttpClient").HttpClient>;
58
+ deactivate: (input: Trigger.WebhookActivationInput<{
59
+ readonly events: readonly ("*" | "check_run" | "check_suite" | "commit_comment" | "create" | "delete" | "deploy_key" | "deployment" | "deployment_status" | "fork" | "github_app_authorization" | "gollum" | "installation" | "installation_repositories" | "issue_comment" | "issues" | "label" | "marketplace_purchase" | "member" | "membership" | "meta" | "milestone" | "org_block" | "organization" | "page_build" | "project" | "project_card" | "project_column" | "public" | "pull_request" | "pull_request_review" | "pull_request_review_comment" | "push" | "release" | "repository" | "repository_import" | "repository_vulnerability_alert" | "security_advisory" | "star" | "status" | "team" | "team_add" | "watch")[];
60
+ readonly insecureSSL?: boolean;
61
+ readonly owner: string;
62
+ readonly repository: string;
63
+ }, {
64
+ readonly hookId: number;
65
+ readonly secret: string;
66
+ } | undefined>, context: {
67
+ readonly auth: import("@dual-os/sdk/AuthMethodBinding").Context<readonly [import("@dual-os/sdk/AuthMethod").AuthMethod<"personal-access-token", undefined, Schema.Struct<{
68
+ readonly server: Schema.optionalKey<Schema.String>;
69
+ readonly token: Schema.NonEmptyString;
70
+ }>, Schema.Struct<{
71
+ readonly server: Schema.optionalKey<Schema.String>;
72
+ readonly token: Schema.NonEmptyString;
73
+ }>, Schema.Struct<{
74
+ readonly server: Schema.optionalKey<Schema.String>;
75
+ readonly token: Schema.NonEmptyString;
76
+ }>, never>, import("@dual-os/sdk/AuthMethod").AuthMethod<"oauth2", Schema.Struct<{
77
+ readonly clientId: Schema.String;
78
+ readonly clientSecret: Schema.String;
79
+ readonly server: Schema.optional<Schema.String>;
80
+ }>, undefined, Schema.Struct<{
81
+ readonly accessToken: Schema.String;
82
+ readonly expiresAt: Schema.optional<Schema.Number>;
83
+ readonly expiresIn: Schema.optional<Schema.Number>;
84
+ readonly raw: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
85
+ readonly refreshToken: Schema.optional<Schema.String>;
86
+ readonly scope: Schema.optional<Schema.String>;
87
+ readonly tokenType: Schema.optional<Schema.String>;
88
+ }>, Schema.Struct<{
89
+ readonly accessToken: Schema.String;
90
+ readonly server: Schema.optional<Schema.String>;
91
+ }>, import("@dual-os/sdk/OAuth2TokenRefresher").Service>]>;
92
+ } & import("@dual-os/sdk/ConnectionResolver").ConnectionResolutionContext) => Effect.Effect<void, Action.ActionHandlerFailure, import("effect/http/HttpClient").HttpClient>;
93
+ parse: (input: Trigger.WebhookLifecycleInput<{
94
+ readonly events: readonly ("*" | "check_run" | "check_suite" | "commit_comment" | "create" | "delete" | "deploy_key" | "deployment" | "deployment_status" | "fork" | "github_app_authorization" | "gollum" | "installation" | "installation_repositories" | "issue_comment" | "issues" | "label" | "marketplace_purchase" | "member" | "membership" | "meta" | "milestone" | "org_block" | "organization" | "page_build" | "project" | "project_card" | "project_column" | "public" | "pull_request" | "pull_request_review" | "pull_request_review_comment" | "push" | "release" | "repository" | "repository_import" | "repository_vulnerability_alert" | "security_advisory" | "star" | "status" | "team" | "team_add" | "watch")[];
95
+ readonly insecureSSL?: boolean;
96
+ readonly owner: string;
97
+ readonly repository: string;
98
+ }, {
99
+ readonly hookId: number;
100
+ readonly secret: string;
101
+ } | undefined>) => Effect.Effect<{
102
+ events: never[] | {
103
+ key: string;
104
+ payload: {
105
+ readonly [x: string]: unknown;
106
+ readonly action?: string;
107
+ readonly ref?: string;
108
+ };
109
+ }[];
110
+ state: {
111
+ readonly hookId: number;
112
+ readonly secret: string;
113
+ } | undefined;
114
+ }, Schema.SchemaError, never>;
115
+ verify: (input: Trigger.WebhookLifecycleInput<{
116
+ readonly events: readonly ("*" | "check_run" | "check_suite" | "commit_comment" | "create" | "delete" | "deploy_key" | "deployment" | "deployment_status" | "fork" | "github_app_authorization" | "gollum" | "installation" | "installation_repositories" | "issue_comment" | "issues" | "label" | "marketplace_purchase" | "member" | "membership" | "meta" | "milestone" | "org_block" | "organization" | "page_build" | "project" | "project_card" | "project_column" | "public" | "pull_request" | "pull_request_review" | "pull_request_review_comment" | "push" | "release" | "repository" | "repository_import" | "repository_vulnerability_alert" | "security_advisory" | "star" | "status" | "team" | "team_add" | "watch")[];
117
+ readonly insecureSSL?: boolean;
118
+ readonly owner: string;
119
+ readonly repository: string;
120
+ }, {
121
+ readonly hookId: number;
122
+ readonly secret: string;
123
+ } | undefined>) => Effect.Effect<undefined, Action.ActionHandlerError, never>;
124
+ };
125
+ };
126
+ //#endregion
127
+ //# sourceMappingURL=triggers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"triggers.d.ts","names":[],"sources":["../src/triggers.ts"],"mappings":";;;qBAgFa,oBAAQ,QAAA,4BAAA,OAAA;;;;;;;;;;;;qBAER;;IAET,WAAQ,OAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAyBR,aAAU,OAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAOV,QAAK,OAAA,QAAA;;;;;;;;;;;;;;;;;;;;;;IAaL,SAAM,OAAA,QAAA"}
@@ -0,0 +1,17 @@
1
+ // @bun
2
+ import {
3
+ triggers2,
4
+ handlers2
5
+ } from "../plugin-3mpmm6hc.js";
6
+ import"../plugin-ahctqzvj.js";
7
+ import"../plugin-t4j28rxn.js";
8
+ import"../plugin-yzj02c6j.js";
9
+ import"../plugin-2jdfj02n.js";
10
+ import"../plugin-gajxsj3f.js";
11
+ export {
12
+ handlers2 as handlers,
13
+ triggers2 as triggers
14
+ };
15
+
16
+ //# debugId=839FD91A59A8813364756E2164756E21
17
+ //# sourceMappingURL=triggers.js.map
@@ -0,0 +1,9 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [
5
+ ],
6
+ "mappings": "",
7
+ "debugId": "839FD91A59A8813364756E2164756E21",
8
+ "names": []
9
+ }
@@ -0,0 +1 @@
1
+ {"entrypoint":"dist/generated/plugin.js","export":"githubApiPlugin","format":2,"plugin":"github-api","runner":"Runner.js","sdk_version":"0.8.1","version":"6.0.3"}
@@ -0,0 +1,4 @@
1
+ All rights reserved.
2
+
3
+ This package is proprietary and is not licensed for public use or redistribution.
4
+ Use and distribution require permission from the rights holder under a separate agreement.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Effectful Technologies Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Effectful Technologies Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Effectful Technologies Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1 @@
1
- {
2
- "name": "@dual-os/github-api",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
1
+ {"name":"@dual-os/github-api","version":"6.0.3","license":"UNLICENSED","exports":{".":"./dist/generated/plugin.js","./definition":"./dist/generated/plugin.js","./executable":"./dist/generated/plugin.js","./plugin.json":"./plugin.json","./package.json":"./package.json"},"files":["**/*"],"type":"module","scripts":{},"dependencies":{},"devDependencies":{},"dual":{"plugin":{"entrypoint":"dist/generated/plugin.js","export":"githubApiPlugin","format":2,"plugin":"github-api","runner":"Runner.js","sdk_version":"0.8.1","version":"6.0.3","assets":["dist/_virtual/_rolldown/runtime.js","dist/auth.d.ts","dist/auth.d.ts.map","dist/auth.js","dist/auth.js.map","dist/generated/http.d.ts","dist/generated/http.d.ts.map","dist/generated/http.js","dist/generated/http.js.map","dist/generated/operations.d.ts","dist/generated/operations.d.ts.map","dist/generated/operations.js","dist/generated/operations.js.map","dist/generated/plugin.d.ts","dist/generated/plugin.d.ts.map","dist/generated/plugin.js","dist/generated/plugin.js.map","dist/triggers.d.ts","dist/triggers.d.ts.map","dist/triggers.js","dist/triggers.js.map","plugin.json","package.json"]}},"peerDependencies":{},"optionalDependencies":{}}
@@ -0,0 +1,18 @@
1
+ // @bun
2
+ // dist/_virtual/_rolldown/runtime.js
3
+ var __defProp = Object.defineProperty;
4
+ var __exportAll2 = (all, no_symbols) => {
5
+ let target = {};
6
+ for (var name in all)
7
+ __defProp(target, name, {
8
+ get: all[name],
9
+ enumerable: true
10
+ });
11
+ if (!no_symbols)
12
+ __defProp(target, Symbol.toStringTag, { value: "Module" });
13
+ return target;
14
+ };
15
+ export { __exportAll2 };
16
+
17
+ //# debugId=082734D28D54F6AF64756E2164756E21
18
+ //# sourceMappingURL=plugin-2jdfj02n.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../bundle-input/dist/_virtual/_rolldown/runtime.js"],
4
+ "sourcesContent": [
5
+ "//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\nexport { __exportAll };\n"
6
+ ],
7
+ "mappings": ";;AACA,IAAI,YAAY,OAAO;AACvB,IAAI,eAAc,CAAC,KAAK,eAAe;AAAA,EACtC,IAAI,SAAS,CAAC;AAAA,EACd,SAAS,QAAQ;AAAA,IAAK,UAAU,QAAQ,MAAM;AAAA,MAC7C,KAAK,IAAI;AAAA,MACT,YAAY;AAAA,IACb,CAAC;AAAA,EACD,IAAI,CAAC;AAAA,IAAY,UAAU,QAAQ,OAAO,aAAa,EAAE,OAAO,SAAS,CAAC;AAAA,EAC1E,OAAO;AAAA;",
8
+ "debugId": "082734D28D54F6AF64756E2164756E21",
9
+ "names": []
10
+ }
@@ -0,0 +1,160 @@
1
+ // @bun
2
+ import {
3
+ isNotUndefined,
4
+ encode,
5
+ slice,
6
+ startsWith,
7
+ fn,
8
+ decodeUnknownEffect,
9
+ optionalKey,
10
+ Unknown,
11
+ String3,
12
+ Boolean2,
13
+ Struct,
14
+ Record,
15
+ StructWithRest,
16
+ ArraySchema,
17
+ Literals,
18
+ Int,
19
+ Action_exports,
20
+ Trigger_exports
21
+ } from "./plugin-gajxsj3f.js";
22
+ import {
23
+ match
24
+ } from "./plugin-yzj02c6j.js";
25
+ import {
26
+ repos_createWebhook2,
27
+ repos_deleteWebhook2
28
+ } from "./plugin-ahctqzvj.js";
29
+
30
+ // dist/triggers.js
31
+ var Event = StructWithRest(Struct({
32
+ action: optionalKey(String3),
33
+ ref: optionalKey(String3)
34
+ }), [Record(String3, Unknown)]);
35
+ var triggers2 = [Trigger_exports.webhook("event", {
36
+ description: "Triggers when subscribed GitHub repository events occur",
37
+ name: "GitHub repository event",
38
+ config: Struct({
39
+ events: ArraySchema(Literals([
40
+ "*",
41
+ "check_run",
42
+ "check_suite",
43
+ "commit_comment",
44
+ "create",
45
+ "delete",
46
+ "deploy_key",
47
+ "deployment",
48
+ "deployment_status",
49
+ "fork",
50
+ "github_app_authorization",
51
+ "gollum",
52
+ "installation",
53
+ "installation_repositories",
54
+ "issue_comment",
55
+ "issues",
56
+ "label",
57
+ "marketplace_purchase",
58
+ "member",
59
+ "membership",
60
+ "meta",
61
+ "milestone",
62
+ "org_block",
63
+ "organization",
64
+ "page_build",
65
+ "project",
66
+ "project_card",
67
+ "project_column",
68
+ "public",
69
+ "pull_request",
70
+ "pull_request_review",
71
+ "pull_request_review_comment",
72
+ "push",
73
+ "release",
74
+ "repository",
75
+ "repository_import",
76
+ "repository_vulnerability_alert",
77
+ "security_advisory",
78
+ "star",
79
+ "status",
80
+ "team",
81
+ "team_add",
82
+ "watch"
83
+ ])),
84
+ insecureSSL: optionalKey(Boolean2),
85
+ owner: String3,
86
+ repository: String3
87
+ }),
88
+ output: Event,
89
+ state: Struct({
90
+ hookId: Int,
91
+ secret: String3
92
+ })
93
+ })];
94
+ var handlers2 = { event: {
95
+ activate: fn("GitHub.event.activate")(function* (input, context) {
96
+ const secret = encode(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)));
97
+ return { state: {
98
+ hookId: (yield* repos_createWebhook2.run({
99
+ owner: input.config.owner,
100
+ payload: {
101
+ active: true,
102
+ config: {
103
+ content_type: "json",
104
+ insecure_ssl: match(input.config.insecureSSL === true, {
105
+ onFalse: () => "0",
106
+ onTrue: () => "1"
107
+ }),
108
+ secret,
109
+ url: input.webhookUrl
110
+ },
111
+ events: input.config.events,
112
+ name: "web"
113
+ },
114
+ repo: input.config.repository
115
+ }, context)).id,
116
+ secret
117
+ } };
118
+ }),
119
+ deactivate: fn("GitHub.event.deactivate")(function* (input, context) {
120
+ if (input.state === undefined)
121
+ return;
122
+ yield* repos_deleteWebhook2.run({
123
+ hook_id: input.state.hookId,
124
+ owner: input.config.owner,
125
+ repo: input.config.repository
126
+ }, context);
127
+ }),
128
+ parse: fn("GitHub.event.parse")(function* (input) {
129
+ const body = yield* decodeUnknownEffect(Event)(input.request.body);
130
+ const isPing = isNotUndefined(body["hook_id"]) && body.action === undefined;
131
+ const key = yield* Trigger_exports.bodyDigest(input.request.rawBody ?? "");
132
+ return {
133
+ events: match(isPing, {
134
+ onFalse: () => [{
135
+ key,
136
+ payload: body
137
+ }],
138
+ onTrue: () => []
139
+ }),
140
+ state: input.state
141
+ };
142
+ }),
143
+ verify: fn("GitHub.event.verify")(function* (input) {
144
+ if (input.state === undefined)
145
+ return yield* Action_exports.ActionHandlerError.make({ message: "GitHub webhook is not activated" });
146
+ const signature = input.request.headers?.["x-hub-signature-256"];
147
+ if (!(signature !== undefined && startsWith("sha256=")(signature) && (yield* Trigger_exports.verifyHmac({
148
+ algorithm: "sha256",
149
+ encoding: "hex",
150
+ message: input.request.rawBody ?? "",
151
+ secret: input.state.secret,
152
+ signature: slice(7)(signature)
153
+ }))))
154
+ return yield* Action_exports.ActionHandlerError.make({ message: "Invalid GitHub webhook signature" });
155
+ })
156
+ } };
157
+ export { triggers2, handlers2 };
158
+
159
+ //# debugId=D11ECF0011E199AD64756E2164756E21
160
+ //# sourceMappingURL=plugin-3mpmm6hc.js.map
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../bundle-input/dist/triggers.js"],
4
+ "sourcesContent": [
5
+ "import { repos_createWebhook, repos_deleteWebhook } from \"./generated/operations.js\";\nimport { Boolean, Effect, Predicate, Schema, String } from \"effect\";\nimport { Action, Trigger } from \"@dual-os/sdk\";\nimport { Hex } from \"effect/encoding\";\n//#region src/triggers.ts\nconst Event = Schema.StructWithRest(Schema.Struct({\n\taction: Schema.optionalKey(Schema.String),\n\tref: Schema.optionalKey(Schema.String)\n}), [Schema.Record(Schema.String, Schema.Unknown)]);\nconst triggers = [Trigger.webhook(\"event\", {\n\tdescription: \"Triggers when subscribed GitHub repository events occur\",\n\tname: \"GitHub repository event\",\n\tconfig: Schema.Struct({\n\t\tevents: Schema.Array(Schema.Literals([\n\t\t\t\"*\",\n\t\t\t\"check_run\",\n\t\t\t\"check_suite\",\n\t\t\t\"commit_comment\",\n\t\t\t\"create\",\n\t\t\t\"delete\",\n\t\t\t\"deploy_key\",\n\t\t\t\"deployment\",\n\t\t\t\"deployment_status\",\n\t\t\t\"fork\",\n\t\t\t\"github_app_authorization\",\n\t\t\t\"gollum\",\n\t\t\t\"installation\",\n\t\t\t\"installation_repositories\",\n\t\t\t\"issue_comment\",\n\t\t\t\"issues\",\n\t\t\t\"label\",\n\t\t\t\"marketplace_purchase\",\n\t\t\t\"member\",\n\t\t\t\"membership\",\n\t\t\t\"meta\",\n\t\t\t\"milestone\",\n\t\t\t\"org_block\",\n\t\t\t\"organization\",\n\t\t\t\"page_build\",\n\t\t\t\"project\",\n\t\t\t\"project_card\",\n\t\t\t\"project_column\",\n\t\t\t\"public\",\n\t\t\t\"pull_request\",\n\t\t\t\"pull_request_review\",\n\t\t\t\"pull_request_review_comment\",\n\t\t\t\"push\",\n\t\t\t\"release\",\n\t\t\t\"repository\",\n\t\t\t\"repository_import\",\n\t\t\t\"repository_vulnerability_alert\",\n\t\t\t\"security_advisory\",\n\t\t\t\"star\",\n\t\t\t\"status\",\n\t\t\t\"team\",\n\t\t\t\"team_add\",\n\t\t\t\"watch\"\n\t\t])),\n\t\tinsecureSSL: Schema.optionalKey(Schema.Boolean),\n\t\towner: Schema.String,\n\t\trepository: Schema.String\n\t}),\n\toutput: Event,\n\tstate: Schema.Struct({\n\t\thookId: Schema.Int,\n\t\tsecret: Schema.String\n\t})\n})];\nconst handlers = { event: {\n\tactivate: Effect.fn(\"GitHub.event.activate\")(function* (input, context) {\n\t\tconst secret = Hex.encode(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)));\n\t\treturn { state: {\n\t\t\thookId: (yield* repos_createWebhook.run({\n\t\t\t\towner: input.config.owner,\n\t\t\t\tpayload: {\n\t\t\t\t\tactive: true,\n\t\t\t\t\tconfig: {\n\t\t\t\t\t\tcontent_type: \"json\",\n\t\t\t\t\t\tinsecure_ssl: Boolean.match(input.config.insecureSSL === true, {\n\t\t\t\t\t\t\tonFalse: () => \"0\",\n\t\t\t\t\t\t\tonTrue: () => \"1\"\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tsecret,\n\t\t\t\t\t\turl: input.webhookUrl\n\t\t\t\t\t},\n\t\t\t\t\tevents: input.config.events,\n\t\t\t\t\tname: \"web\"\n\t\t\t\t},\n\t\t\t\trepo: input.config.repository\n\t\t\t}, context)).id,\n\t\t\tsecret\n\t\t} };\n\t}),\n\tdeactivate: Effect.fn(\"GitHub.event.deactivate\")(function* (input, context) {\n\t\tif (input.state === void 0) return;\n\t\tyield* repos_deleteWebhook.run({\n\t\t\thook_id: input.state.hookId,\n\t\t\towner: input.config.owner,\n\t\t\trepo: input.config.repository\n\t\t}, context);\n\t}),\n\tparse: Effect.fn(\"GitHub.event.parse\")(function* (input) {\n\t\tconst body = yield* Schema.decodeUnknownEffect(Event)(input.request.body);\n\t\tconst isPing = Predicate.isNotUndefined(body[\"hook_id\"]) && body.action === void 0;\n\t\tconst key = yield* Trigger.bodyDigest(input.request.rawBody ?? \"\");\n\t\treturn {\n\t\t\tevents: Boolean.match(isPing, {\n\t\t\t\tonFalse: () => [{\n\t\t\t\t\tkey,\n\t\t\t\t\tpayload: body\n\t\t\t\t}],\n\t\t\t\tonTrue: () => []\n\t\t\t}),\n\t\t\tstate: input.state\n\t\t};\n\t}),\n\tverify: Effect.fn(\"GitHub.event.verify\")(function* (input) {\n\t\tif (input.state === void 0) return yield* Action.ActionHandlerError.make({ message: \"GitHub webhook is not activated\" });\n\t\tconst signature = input.request.headers?.[\"x-hub-signature-256\"];\n\t\tif (!(signature !== void 0 && String.startsWith(\"sha256=\")(signature) && (yield* Trigger.verifyHmac({\n\t\t\talgorithm: \"sha256\",\n\t\t\tencoding: \"hex\",\n\t\t\tmessage: input.request.rawBody ?? \"\",\n\t\t\tsecret: input.state.secret,\n\t\t\tsignature: String.slice(7)(signature)\n\t\t})))) return yield* Action.ActionHandlerError.make({ message: \"Invalid GitHub webhook signature\" });\n\t})\n} };\n//#endregion\nexport { handlers, triggers };\n\n//# sourceMappingURL=triggers.js.map"
6
+ ],
7
+ "mappings": "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",
8
+ "debugId": "D11ECF0011E199AD64756E2164756E21",
9
+ "names": []
10
+ }