create-disposabl-app 0.5.0 → 0.6.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.
Files changed (87) hide show
  1. package/README.md +12 -0
  2. package/dist/disposabl.js +541 -0
  3. package/dist/index.js +91 -8
  4. package/dist/templates/default/.github/scripts/android-build.sh +18 -0
  5. package/dist/templates/default/.github/scripts/disposabl.mjs +95 -0
  6. package/dist/templates/default/.github/scripts/expo-channel.sh +10 -0
  7. package/dist/templates/default/.github/scripts/expo-env.sh +17 -0
  8. package/dist/templates/default/.github/scripts/expo-fingerprint.sh +28 -0
  9. package/dist/templates/default/.github/scripts/expo-update.sh +11 -0
  10. package/dist/templates/default/.github/scripts/package-release.sh +23 -0
  11. package/dist/templates/default/.github/scripts/platforms.sh +37 -0
  12. package/dist/templates/default/.github/scripts/release-publish.sh +28 -0
  13. package/dist/templates/default/.github/scripts/release-source.sh +14 -0
  14. package/dist/templates/default/.github/scripts/verify-artifacts.sh +13 -0
  15. package/dist/templates/default/.github/scripts/web-deploy.sh +10 -0
  16. package/dist/templates/default/.github/workflows/pipeline.yml +300 -0
  17. package/dist/templates/default/apps/mobile/AGENTS.md +2 -2
  18. package/dist/templates/default/apps/mobile/README.md +4 -3
  19. package/dist/templates/default/apps/mobile/app.json +3 -4
  20. package/dist/templates/default/apps/mobile/assets/images/android-icon-foreground.png +0 -0
  21. package/dist/templates/default/apps/mobile/assets/images/android-icon-monochrome.png +0 -0
  22. package/dist/templates/default/apps/mobile/assets/images/icon.png +0 -0
  23. package/dist/templates/default/apps/mobile/assets/images/splash-icon.png +0 -0
  24. package/dist/templates/default/apps/mobile/eas.json +5 -0
  25. package/dist/templates/default/apps/mobile/package.json +5 -4
  26. package/dist/templates/default/apps/web/package.json +1 -1
  27. package/dist/templates/default/apps/web/src/routeTree.gen.ts +0 -44
  28. package/dist/templates/default/apps/web/src/router/__root.tsx +1 -1
  29. package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +0 -1
  30. package/dist/templates/default/apps/web/src/router/index.tsx +11 -3
  31. package/dist/templates/default/bun.lock +19 -5
  32. package/dist/templates/default/bunfig.toml +0 -2
  33. package/dist/templates/default/package.json +3 -3
  34. package/dist/templates/default/packages/backend/AGENTS.md +15 -13
  35. package/dist/templates/default/packages/backend/README.md +6 -28
  36. package/dist/templates/default/packages/backend/convex/_generated/ai/ai-files.state.json +1 -1
  37. package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +32 -6
  38. package/dist/templates/default/packages/backend/convex/_generated/server.d.ts +8 -0
  39. package/dist/templates/default/packages/backend/convex/apps/actions/create.ts +19 -0
  40. package/dist/templates/default/packages/backend/convex/apps/internal.ts +197 -0
  41. package/dist/templates/default/packages/backend/convex/auth.ts +1 -1
  42. package/dist/templates/default/packages/backend/convex/convex.config.ts +8 -0
  43. package/dist/templates/default/packages/backend/convex/github/actions/http.ts +40 -0
  44. package/dist/templates/default/packages/backend/convex/github/actions/internal.ts +189 -0
  45. package/dist/templates/default/packages/backend/convex/github/actions/oidc.ts +75 -0
  46. package/dist/templates/default/packages/backend/convex/github/actions/provision.ts +80 -0
  47. package/dist/templates/default/packages/backend/convex/github/actions/tokens.ts +66 -0
  48. package/dist/templates/default/packages/backend/convex/github/internal.ts +34 -0
  49. package/dist/templates/default/packages/backend/convex/http.ts +3 -0
  50. package/dist/templates/default/packages/backend/convex/previews/internal.ts +270 -0
  51. package/dist/templates/default/packages/backend/convex/previews/token/actions/create.ts +69 -0
  52. package/dist/templates/default/packages/backend/convex/previews/token/actions/management.ts +133 -0
  53. package/dist/templates/default/packages/backend/convex/previews/token/internal.ts +1 -0
  54. package/dist/templates/default/packages/backend/convex/releases/internal.ts +28 -0
  55. package/dist/templates/default/packages/backend/convex/schema.ts +34 -4
  56. package/dist/templates/default/packages/backend/convex/users/index.ts +21 -0
  57. package/dist/templates/default/packages/backend/convex/users/internal.ts +44 -0
  58. package/dist/templates/default/packages/backend/convex/validator.ts +87 -0
  59. package/dist/templates/default/packages/backend/generate.ts +6 -1
  60. package/dist/templates/default/packages/backend/generated/openapi.json +961 -43
  61. package/dist/templates/default/packages/backend/generated/pages.json +0 -8
  62. package/dist/templates/default/packages/backend/generated/platforms.ts +14 -2
  63. package/dist/templates/default/packages/backend/package.json +1 -1
  64. package/dist/templates/default/packages/cli/README.md +15 -9
  65. package/dist/templates/default/packages/cli/auth.ts +11 -3
  66. package/dist/templates/default/packages/cli/commands.ts +236 -0
  67. package/dist/templates/default/packages/cli/index.ts +2 -142
  68. package/dist/templates/default/packages/cli/preview.ts +157 -0
  69. package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +2 -1
  70. package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +35 -1
  71. package/dist/templates/default/packages/disposabl-kit/mobile/lib/logo.png +0 -0
  72. package/dist/templates/default/packages/disposabl-kit/mobile/screens/account.tsx +1 -1
  73. package/dist/templates/default/packages/disposabl-kit/mobile/screens/home.tsx +20 -5
  74. package/dist/templates/default/packages/sdk/README.md +8 -4
  75. package/dist/templates/default/packages/sdk/src/config.ts +14 -7
  76. package/dist/templates/default/packages/sdk/src/generated/index.ts +48 -13
  77. package/dist/templates/default/packages/sdk/src/generated/sdk.gen.ts +139 -27
  78. package/dist/templates/default/packages/sdk/src/generated/types.gen.ts +440 -37
  79. package/package.json +6 -3
  80. package/dist/templates/default/.github/README.md +0 -99
  81. package/dist/templates/default/.github/actionlint.yaml +0 -6
  82. package/dist/templates/default/.github/workflows/pipeline.yml.example +0 -546
  83. package/dist/templates/default/apps/web/src/router/_authenticated/todos/$id.tsx +0 -27
  84. package/dist/templates/default/apps/web/src/router/_authenticated/todos/index.tsx +0 -33
  85. package/dist/templates/default/packages/backend/convex/todos/index.ts +0 -26
  86. package/dist/templates/default/packages/backend/convex/todos/internal.ts +0 -43
  87. package/dist/templates/default/packages/backend/convex/users.ts +0 -43
@@ -0,0 +1,189 @@
1
+ "use node";
2
+
3
+ import { internalAction } from "@disposabl/disposabl-kit/server/lib/functions";
4
+ import { v } from "convex/values";
5
+ import { internal } from "../../_generated/api";
6
+ import type { ActionCtx } from "../../_generated/server";
7
+ import { platform, releaseDetails } from "../../validator";
8
+ import { githubRequest, githubToken } from "./tokens";
9
+ import { verifyGitHubToken } from "./oidc";
10
+
11
+ type WorkflowRun = {
12
+ id: number;
13
+ run_attempt: number;
14
+ run_number: number;
15
+ head_sha: string;
16
+ head_branch: string;
17
+ event: string;
18
+ html_url: string;
19
+ path: string;
20
+ repository: { id: number };
21
+ head_repository: { id: number };
22
+ };
23
+ async function authorize(ctx: ActionCtx, appId: string, token: string) {
24
+ const claims = await verifyGitHubToken(token);
25
+ const app = await ctx.runQuery(internal.apps.internal.githubApp, { appId });
26
+ if (!app) throw new Error("Repository is not linked to this app.");
27
+ const repository = `${app.githubOwner}/${app.githubRepo}`;
28
+ const publisher = claims.environment === "publishing";
29
+ const workflowPath = ".github/workflows/pipeline.yml";
30
+ const workflow = `${repository}/${workflowPath}@${claims.ref}`;
31
+ if (
32
+ claims.repository !== repository ||
33
+ claims.workflow_ref !== workflow ||
34
+ (claims.job_workflow_ref && claims.job_workflow_ref !== workflow)
35
+ )
36
+ throw new Error("Unexpected workflow.");
37
+ const productionEvent =
38
+ claims.event_name === "push" && claims.ref === "refs/heads/main";
39
+ if (claims.event_name !== "pull_request" && !productionEvent)
40
+ throw new Error("Unexpected workflow event.");
41
+ // PR build code only receives read access. Write tokens go to main or its trusted artifact publisher.
42
+ const installationToken = await githubToken(
43
+ app.installationId,
44
+ [
45
+ publisher || productionEvent ? "contents:write" : "contents:read",
46
+ "actions:read",
47
+ "pull_requests:read",
48
+ ],
49
+ repository,
50
+ );
51
+ const { id: repositoryId } = await githubRequest<{ id: number }>(
52
+ installationToken,
53
+ `/repos/${repository}`,
54
+ );
55
+ if (String(repositoryId) !== claims.repository_id)
56
+ throw new Error("Repository does not match Actions identity.");
57
+ const workflowRun = await githubRequest<WorkflowRun>(
58
+ installationToken,
59
+ `/repos/${repository}/actions/runs/${claims.run_id}`,
60
+ );
61
+ if (
62
+ workflowRun.id !== Number(claims.run_id) ||
63
+ workflowRun.run_attempt !== Number(claims.run_attempt) ||
64
+ workflowRun.repository.id !== repositoryId ||
65
+ workflowRun.head_repository.id !== repositoryId ||
66
+ workflowRun.event !== claims.event_name ||
67
+ workflowRun.path.split("@")[0] !== workflowPath
68
+ )
69
+ throw new Error("Workflow run does not match Actions identity.");
70
+ if (publisher && !productionEvent) {
71
+ // PR changes cannot grant themselves a publishing environment or execute different publisher steps.
72
+ if (!/^[a-f0-9]{40}$/.test(claims.workflow_sha ?? ""))
73
+ throw new Error("Missing workflow source identity.");
74
+ const workflowFile = `/repos/${repository}/contents/${workflowPath}`;
75
+ const [source, trusted] = await Promise.all([
76
+ githubRequest<{ sha: string }>(
77
+ installationToken,
78
+ `${workflowFile}?ref=${claims.workflow_sha}`,
79
+ ),
80
+ githubRequest<{ sha: string }>(
81
+ installationToken,
82
+ `${workflowFile}?ref=main`,
83
+ ),
84
+ ]);
85
+ if (source.sha !== trusted.sha)
86
+ throw new Error(
87
+ "Merge workflow changes before publishing preview artifacts.",
88
+ );
89
+ }
90
+ const production = workflowRun.event === "push";
91
+ if (production && workflowRun.head_branch !== "main")
92
+ throw new Error("Production requires main.");
93
+ if (
94
+ !production &&
95
+ claims.head_ref &&
96
+ claims.head_ref !== workflowRun.head_branch
97
+ )
98
+ throw new Error("Unexpected preview branch.");
99
+ return {
100
+ app,
101
+ repository,
102
+ installationToken,
103
+ production,
104
+ reference: production ? "main" : workflowRun.head_branch,
105
+ run: {
106
+ id: workflowRun.id,
107
+ attempt: workflowRun.run_attempt,
108
+ number: workflowRun.run_number,
109
+ commitSha: workflowRun.head_sha,
110
+ url: workflowRun.html_url,
111
+ },
112
+ };
113
+ }
114
+ export const token = internalAction({
115
+ args: {
116
+ appId: v.string(),
117
+ token: v.string(),
118
+ },
119
+ returns: v.object({ token: v.string() }),
120
+ handler: async (ctx, args): Promise<{ token: string }> => ({
121
+ token: (await authorize(ctx, args.appId, args.token)).installationToken,
122
+ }),
123
+ });
124
+ export const report = internalAction({
125
+ args: {
126
+ appId: v.string(),
127
+ token: v.string(),
128
+ platform,
129
+ ...releaseDetails,
130
+ },
131
+ returns: v.null(),
132
+ handler: async (ctx, args) => {
133
+ const verified = await authorize(ctx, args.appId, args.token);
134
+ for (const field of [
135
+ "url",
136
+ "githubReleaseUrl",
137
+ "artifactUrl",
138
+ "updateUrl",
139
+ ] as const) {
140
+ if (!args[field]) continue;
141
+ const url = new URL(args[field]);
142
+ if (url.protocol !== "https:" || url.username || url.password)
143
+ throw new Error("Release links must use HTTPS.");
144
+ if (
145
+ field === "githubReleaseUrl" ||
146
+ (field === "artifactUrl" && url.hostname === "github.com")
147
+ ) {
148
+ if (
149
+ url.hostname !== "github.com" ||
150
+ !url.pathname.startsWith(`/${verified.repository}/releases/`)
151
+ )
152
+ throw new Error("Release belongs to another repository.");
153
+ }
154
+ }
155
+ if (args.githubReleaseUrl) {
156
+ const tag = new URL(args.githubReleaseUrl).pathname.split(
157
+ "/releases/tag/",
158
+ )[1];
159
+ if (!tag) throw new Error("Expected a GitHub release link.");
160
+ const release = await githubRequest<{
161
+ html_url: string;
162
+ draft: boolean;
163
+ assets: { browser_download_url: string }[];
164
+ }>(
165
+ verified.installationToken,
166
+ `/repos/${verified.repository}/releases/tags/${encodeURIComponent(decodeURIComponent(tag))}`,
167
+ );
168
+ if (
169
+ release.draft ||
170
+ release.html_url !== args.githubReleaseUrl ||
171
+ (args.artifactUrl &&
172
+ !release.assets.some(
173
+ (asset) => asset.browser_download_url === args.artifactUrl,
174
+ ))
175
+ )
176
+ throw new Error("Release or download is not published.");
177
+ }
178
+ const { token: _token, ...result } = args;
179
+ await ctx.runMutation(internal.previews.internal.report, {
180
+ ...result,
181
+ githubOwner: verified.app.githubOwner,
182
+ githubRepo: verified.app.githubRepo,
183
+ reference: verified.reference,
184
+ production: verified.production,
185
+ run: verified.run,
186
+ });
187
+ return null;
188
+ },
189
+ });
@@ -0,0 +1,75 @@
1
+ "use node";
2
+
3
+ const decode = (value: string) =>
4
+ Uint8Array.from(atob(value.replace(/-/g, "+").replace(/_/g, "/")), (char) =>
5
+ char.charCodeAt(0),
6
+ );
7
+ const json = (value: string) =>
8
+ JSON.parse(new TextDecoder().decode(decode(value)));
9
+
10
+ /** GitHub alone signs the repository, workflow and run identity. */
11
+ export async function verifyGitHubToken(token: string) {
12
+ if (token.length > 16_000) throw new Error("Invalid Actions token.");
13
+ const parts = token.split(".");
14
+ if (parts.length !== 3) throw new Error("Invalid Actions token.");
15
+ const [headerPart, bodyPart, signature] = parts as [string, string, string];
16
+ const header = json(headerPart);
17
+ if (header.alg !== "RS256" || typeof header.kid !== "string")
18
+ throw new Error("Invalid Actions signature.");
19
+ const response = await fetch(
20
+ "https://token.actions.githubusercontent.com/.well-known/jwks",
21
+ { redirect: "error", signal: AbortSignal.timeout(15_000) },
22
+ );
23
+ if (!response.ok) throw new Error("Cannot verify Actions identity.");
24
+ const { keys } = (await response.json()) as {
25
+ keys: (JsonWebKey & { kid: string })[];
26
+ };
27
+ const key = keys.find((key) => key.kid === header.kid);
28
+ if (!key) throw new Error("Invalid Actions signature.");
29
+ const publicKey = await crypto.subtle.importKey(
30
+ "jwk",
31
+ key,
32
+ {
33
+ name: "RSASSA-PKCS1-v1_5",
34
+ hash: "SHA-256",
35
+ },
36
+ false,
37
+ ["verify"],
38
+ );
39
+ if (
40
+ !(await crypto.subtle.verify(
41
+ "RSASSA-PKCS1-v1_5",
42
+ publicKey,
43
+ decode(signature),
44
+ new TextEncoder().encode(`${headerPart}.${bodyPart}`),
45
+ ))
46
+ )
47
+ throw new Error("Invalid Actions signature.");
48
+ const claims = json(bodyPart) as Record<string, unknown>;
49
+ const now = Date.now() / 1000;
50
+ if (
51
+ claims.iss !== "https://token.actions.githubusercontent.com" ||
52
+ claims.aud !== "https://disposabl.dev" ||
53
+ typeof claims.exp !== "number" ||
54
+ claims.exp <= now ||
55
+ typeof claims.nbf !== "number" ||
56
+ claims.nbf > now + 30
57
+ )
58
+ throw new Error("Expired or invalid Actions identity.");
59
+ for (const key of ["repository_id", "run_id", "run_attempt"] as const)
60
+ if (
61
+ typeof claims[key] !== "string" ||
62
+ !/^[1-9]\d*$/.test(claims[key]) ||
63
+ !Number.isSafeInteger(Number(claims[key]))
64
+ )
65
+ throw new Error("Invalid Actions run.");
66
+ for (const key of [
67
+ "repository",
68
+ "workflow_ref",
69
+ "ref",
70
+ "event_name",
71
+ ] as const)
72
+ if (typeof claims[key] !== "string")
73
+ throw new Error("Missing Actions identity.");
74
+ return claims as Record<string, string>;
75
+ }
@@ -0,0 +1,80 @@
1
+ "use node";
2
+
3
+ import {
4
+ identityFields,
5
+ internalAction,
6
+ } from "@disposabl/disposabl-kit/server/lib/functions";
7
+ import { v } from "convex/values";
8
+ import { internal } from "../../_generated/api";
9
+ import { env } from "../../_generated/server";
10
+ import { githubRequest, githubToken } from "./tokens";
11
+
12
+ type Repository = {
13
+ id: number;
14
+ name: string;
15
+ private: boolean;
16
+ description: string | null;
17
+ owner: { login: string };
18
+ };
19
+ export const run = internalAction({
20
+ args: { ...identityFields, appId: v.string() },
21
+ returns: v.null(),
22
+ handler: async (ctx, args) => {
23
+ const { app, connection } = await ctx.runQuery(
24
+ internal.apps.internal.githubSetup,
25
+ args,
26
+ );
27
+ if (app.githubOwner && app.githubRepo) return null;
28
+ const owner = connection?.owner ?? env.GITHUB_OWNER;
29
+ const installationId =
30
+ connection?.installationId ?? env.GITHUB_INSTALLATION_ID;
31
+ // Standalone apps do not require a GitHub connection.
32
+ if (!owner && !installationId) return null;
33
+ if (!owner || !installationId || !/^[a-zA-Z0-9-]+$/.test(owner))
34
+ throw new Error("Configure a verified GitHub installation.");
35
+ const token = await githubToken(installationId, [
36
+ "administration:write",
37
+ "contents:read",
38
+ ]);
39
+ const name = `${app.name
40
+ .toLowerCase()
41
+ .replace(/[^a-z0-9_.-]/g, "-")
42
+ .slice(0, 55)}-${app.appId}`;
43
+ const description = `Disposabl app ${app.appId}`;
44
+ const account = await githubRequest<{ type: string }>(
45
+ token,
46
+ `/users/${owner}`,
47
+ );
48
+ let repo: Repository;
49
+ try {
50
+ repo = await githubRequest<Repository>(
51
+ token,
52
+ account.type === "Organization"
53
+ ? `/orgs/${owner}/repos`
54
+ : "/user/repos",
55
+ { name, description, private: true, auto_init: false },
56
+ );
57
+ } catch (error) {
58
+ try {
59
+ repo = await githubRequest<Repository>(
60
+ token,
61
+ `/repos/${owner}/${name}`,
62
+ );
63
+ } catch {
64
+ throw error;
65
+ }
66
+ }
67
+ if (
68
+ !repo.private ||
69
+ repo.owner.login.toLowerCase() !== owner.toLowerCase() ||
70
+ repo.description !== description
71
+ )
72
+ throw new Error("Repository does not match this app.");
73
+ await ctx.runMutation(internal.apps.internal.connectGithub, {
74
+ ...args,
75
+ githubOwner: repo.owner.login,
76
+ githubRepo: repo.name,
77
+ });
78
+ return null;
79
+ },
80
+ });
@@ -0,0 +1,66 @@
1
+ "use node";
2
+
3
+ import { getToken } from "@vercel/connect";
4
+ import { env } from "../../_generated/server";
5
+
6
+ export async function githubToken(
7
+ installationId: string,
8
+ permissions: string[],
9
+ repository?: string,
10
+ ) {
11
+ if (
12
+ !env.VERCEL_TOKEN ||
13
+ !env.VERCEL_PROJECT_ID ||
14
+ !env.VERCEL_TEAM_ID ||
15
+ !env.GITHUB_CONNECTOR
16
+ )
17
+ throw new Error("GitHub App connection is not configured.");
18
+ const response = await fetch(
19
+ `https://api.vercel.com/v1/projects/${encodeURIComponent(env.VERCEL_PROJECT_ID)}/token?teamId=${encodeURIComponent(env.VERCEL_TEAM_ID)}`,
20
+ {
21
+ method: "POST",
22
+ redirect: "error",
23
+ headers: { Authorization: `Bearer ${env.VERCEL_TOKEN}` },
24
+ signal: AbortSignal.timeout(30_000),
25
+ },
26
+ );
27
+ if (!response.ok)
28
+ throw new Error(`GitHub connection failed (${response.status}).`);
29
+ const { token } = (await response.json()) as { token: string };
30
+ return getToken(
31
+ env.GITHUB_CONNECTOR,
32
+ {
33
+ subject: { type: "app" },
34
+ installationId,
35
+ authorizationDetails: [
36
+ {
37
+ type: "github_app_installation",
38
+ permissions,
39
+ ...(repository ? { repositories: [repository] } : {}),
40
+ },
41
+ ],
42
+ },
43
+ { vercelToken: token },
44
+ );
45
+ }
46
+ export async function githubRequest<T>(
47
+ token: string,
48
+ path: string,
49
+ body?: unknown,
50
+ ): Promise<T> {
51
+ const response = await fetch(`https://api.github.com${path}`, {
52
+ method: body === undefined ? "GET" : "POST",
53
+ redirect: "error",
54
+ signal: AbortSignal.timeout(30_000),
55
+ headers: {
56
+ Authorization: `Bearer ${token}`,
57
+ Accept: "application/vnd.github+json",
58
+ "Content-Type": "application/json",
59
+ "X-GitHub-Api-Version": "2022-11-28",
60
+ },
61
+ ...(body === undefined ? {} : { body: JSON.stringify(body) }),
62
+ });
63
+ if (!response.ok)
64
+ throw new Error(`GitHub request failed (${response.status}).`);
65
+ return response.json() as Promise<T>;
66
+ }
@@ -0,0 +1,34 @@
1
+ import { internalMutation } from "@disposabl/disposabl-kit/server/lib/functions";
2
+ import { ConvexError, v } from "convex/values";
3
+
4
+ /** A trusted installation callback supplies this verified binding, never a client API. */
5
+ export const connect = internalMutation({
6
+ args: {
7
+ userId: v.id("users"),
8
+ owner: v.string(),
9
+ installationId: v.string(),
10
+ },
11
+ returns: v.null(),
12
+ handler: async (ctx, { userId, owner, installationId }) => {
13
+ if (!(await ctx.db.get("users", userId)))
14
+ throw new ConvexError("User not found.");
15
+ if (!/^[a-zA-Z0-9-]+$/.test(owner) || !/^\d+$/.test(installationId))
16
+ throw new ConvexError("Invalid GitHub installation.");
17
+ owner = owner.toLowerCase();
18
+ const existing = await ctx.db
19
+ .query("githubConnections")
20
+ .withIndex("by_userId_owner", (q) =>
21
+ q.eq("userId", userId).eq("owner", owner),
22
+ )
23
+ .unique();
24
+ if (existing)
25
+ await ctx.db.patch("githubConnections", existing._id, { installationId });
26
+ else
27
+ await ctx.db.insert("githubConnections", {
28
+ userId,
29
+ owner,
30
+ installationId,
31
+ });
32
+ return null;
33
+ },
34
+ });
@@ -1,5 +1,8 @@
1
+ import { token, report } from "./github/actions/http";
1
2
  import createHttpRouter from "@disposabl/disposabl-kit/server/http";
2
3
 
3
4
  const http = createHttpRouter();
5
+ http.route({ path: "/github/token", method: "POST", handler: token });
6
+ http.route({ path: "/github/report", method: "POST", handler: report });
4
7
 
5
8
  export default http;