This commit is contained in:
Frank
2025-09-29 14:17:53 -04:00
parent 5345c828ca
commit 7447460b5a
24 changed files with 995 additions and 242 deletions

View File

@@ -2,6 +2,7 @@ import { domain } from "./stage"
const GITHUB_APP_ID = new sst.Secret("GITHUB_APP_ID") const GITHUB_APP_ID = new sst.Secret("GITHUB_APP_ID")
const GITHUB_APP_PRIVATE_KEY = new sst.Secret("GITHUB_APP_PRIVATE_KEY") const GITHUB_APP_PRIVATE_KEY = new sst.Secret("GITHUB_APP_PRIVATE_KEY")
export const EMAILOCTOPUS_API_KEY = new sst.Secret("EMAILOCTOPUS_API_KEY")
const bucket = new sst.cloudflare.Bucket("Bucket") const bucket = new sst.cloudflare.Bucket("Bucket")
export const api = new sst.cloudflare.Worker("Api", { export const api = new sst.cloudflare.Worker("Api", {

View File

@@ -1,4 +1,5 @@
import { domain } from "./stage" import { domain } from "./stage"
import { EMAILOCTOPUS_API_KEY } from "./app"
//////////////// ////////////////
// DATABASE // DATABASE
@@ -121,7 +122,7 @@ if ($app.stage === "production" || $app.stage === "frank") {
new sst.cloudflare.x.SolidStart("Console", { new sst.cloudflare.x.SolidStart("Console", {
domain, domain,
path: "packages/console/app", path: "packages/console/app",
link: [database, AUTH_API_URL, STRIPE_WEBHOOK_SECRET, STRIPE_SECRET_KEY, ZEN_MODELS], link: [database, AUTH_API_URL, STRIPE_WEBHOOK_SECRET, STRIPE_SECRET_KEY, ZEN_MODELS, EMAILOCTOPUS_API_KEY],
environment: { environment: {
//VITE_DOCS_URL: web.url.apply((url) => url!), //VITE_DOCS_URL: web.url.apply((url) => url!),
//VITE_API_URL: gateway.url.apply((url) => url!), //VITE_API_URL: gateway.url.apply((url) => url!),

View File

@@ -2,7 +2,9 @@
/* tslint:disable */ /* tslint:disable */
/* eslint-disable */ /* eslint-disable */
/// <reference types="vite/client" /> /// <reference types="vite/client" />
interface ImportMetaEnv {} interface ImportMetaEnv {
}
interface ImportMeta { interface ImportMeta {
readonly env: ImportMetaEnv readonly env: ImportMetaEnv
} }

View File

@@ -5,7 +5,7 @@ import { createStore } from "solid-js/store"
import { formatDateUTC, formatDateForTable } from "./common" import { formatDateUTC, formatDateForTable } from "./common"
import styles from "./member-section.module.css" import styles from "./member-section.module.css"
import { and, Database, eq, sql } from "@opencode/console-core/drizzle/index.js" import { and, Database, eq, sql } from "@opencode/console-core/drizzle/index.js"
import { UserTable } from "@opencode/console-core/schema/user.sql.js" import { UserTable, UserRole } from "@opencode/console-core/schema/user.sql.js"
import { Identifier } from "@opencode/console-core/identifier.js" import { Identifier } from "@opencode/console-core/identifier.js"
const removeMember = action(async (form: FormData) => { const removeMember = action(async (form: FormData) => {
@@ -31,10 +31,12 @@ const removeMember = action(async (form: FormData) => {
const inviteMember = action(async (form: FormData) => { const inviteMember = action(async (form: FormData) => {
"use server" "use server"
const name = form.get("name")?.toString().trim() const email = form.get("email")?.toString().trim()
if (!name) return { error: "Name is required" } if (!email) return { error: "Email is required" }
const workspaceID = form.get("workspaceID")?.toString() const workspaceID = form.get("workspaceID")?.toString()
if (!workspaceID) return { error: "Workspace ID is required" } if (!workspaceID) return { error: "Workspace ID is required" }
const role = form.get("role")?.toString() as (typeof UserRole)[number]
if (!role) return { error: "Role is required" }
return json( return json(
await withActor( await withActor(
() => () =>
@@ -44,12 +46,10 @@ const inviteMember = action(async (form: FormData) => {
.values({ .values({
id: Identifier.create("user"), id: Identifier.create("user"),
name: "", name: "",
email: name, email,
workspaceID, workspaceID,
role: "member", role,
timeJoined: sql`now()`,
}) })
.onDuplicateKeyUpdate({ set: { timeJoined: sql`now()` } })
.then((data) => ({ error: undefined, data })) .then((data) => ({ error: undefined, data }))
.catch((e) => ({ error: e.message as string })), .catch((e) => ({ error: e.message as string })),
), ),
@@ -109,7 +109,23 @@ export function MemberCreateForm() {
> >
<form action={inviteMember} method="post" data-slot="create-form"> <form action={inviteMember} method="post" data-slot="create-form">
<div data-slot="input-container"> <div data-slot="input-container">
<input ref={(r) => (input = r)} data-component="input" name="name" type="text" placeholder="Enter email" /> <input ref={(r) => (input = r)} data-component="input" name="email" type="text" placeholder="Enter email" />
<div data-slot="role-selector">
<label>
<input type="radio" name="role" value="admin" checked />
<div>
<strong>Admin</strong>
<p>Can manage models, members, and billing</p>
</div>
</label>
<label>
<input type="radio" name="role" value="member" />
<div>
<strong>Member</strong>
<p>Can only generate API keys for themselves</p>
</div>
</label>
</div>
<Show when={submission.result && submission.result.error}> <Show when={submission.result && submission.result.error}>
{(err) => <div data-slot="form-error">{err()}</div>} {(err) => <div data-slot="form-error">{err()}</div>}
</Show> </Show>
@@ -160,15 +176,15 @@ export function MemberSection() {
<tbody> <tbody>
<For each={members()!}> <For each={members()!}>
{(member) => { {(member) => {
const [copied, setCopied] = createSignal(false)
// const submission = useSubmission(removeKey, ([fd]) => fd.get("id")?.toString() === key.id)
return ( return (
<tr> <tr>
<td data-slot="member-email">{member.email}</td> <td data-slot="member-email">{member.email}</td>
<td data-slot="member-role">{member.role}</td> <td data-slot="member-role">{member.role}</td>
<td data-slot="member-joined" title={formatDateUTC(member.timeJoined!)}> <Show when={member.timeSeen} fallback={<td data-slot="member-joined">invited</td>}>
{formatDateForTable(member.timeJoined!)} <td data-slot="member-joined" title={formatDateUTC(member.timeSeen!)}>
{formatDateForTable(member.timeSeen!)}
</td> </td>
</Show>
<td data-slot="member-actions"> <td data-slot="member-actions">
<form action={removeMember} method="post"> <form action={removeMember} method="post">
<input type="hidden" name="id" value={member.id} /> <input type="hidden" name="id" value={member.id} />

View File

@@ -0,0 +1 @@
ALTER TABLE `user` DROP COLUMN `time_joined`;

View File

@@ -0,0 +1,695 @@
{
"version": "5",
"dialect": "mysql",
"id": "908437f9-54ed-4c83-b555-614926e326f8",
"prevId": "a2bb7222-561c-45f0-8939-8ef9b8e57bb3",
"tables": {
"account": {
"name": "account",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_created": {
"name": "time_created",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(now())"
},
"time_updated": {
"name": "time_updated",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)"
},
"time_deleted": {
"name": "time_deleted",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"email": {
"name": "email",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"email": {
"name": "email",
"columns": [
"email"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {},
"uniqueConstraints": {},
"checkConstraint": {}
},
"billing": {
"name": "billing",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"workspace_id": {
"name": "workspace_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_created": {
"name": "time_created",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(now())"
},
"time_updated": {
"name": "time_updated",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)"
},
"time_deleted": {
"name": "time_deleted",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"customer_id": {
"name": "customer_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"payment_method_id": {
"name": "payment_method_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"payment_method_last4": {
"name": "payment_method_last4",
"type": "varchar(4)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"balance": {
"name": "balance",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"monthly_limit": {
"name": "monthly_limit",
"type": "int",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"monthly_usage": {
"name": "monthly_usage",
"type": "bigint",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"time_monthly_usage_updated": {
"name": "time_monthly_usage_updated",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"reload": {
"name": "reload",
"type": "boolean",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"reload_error": {
"name": "reload_error",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"time_reload_error": {
"name": "time_reload_error",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"time_reload_locked_till": {
"name": "time_reload_locked_till",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"global_customer_id": {
"name": "global_customer_id",
"columns": [
"customer_id"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {
"billing_workspace_id_id_pk": {
"name": "billing_workspace_id_id_pk",
"columns": [
"workspace_id",
"id"
]
}
},
"uniqueConstraints": {},
"checkConstraint": {}
},
"payment": {
"name": "payment",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"workspace_id": {
"name": "workspace_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_created": {
"name": "time_created",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(now())"
},
"time_updated": {
"name": "time_updated",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)"
},
"time_deleted": {
"name": "time_deleted",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"customer_id": {
"name": "customer_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"invoice_id": {
"name": "invoice_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"payment_id": {
"name": "payment_id",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"amount": {
"name": "amount",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_refunded": {
"name": "time_refunded",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"payment_workspace_id_id_pk": {
"name": "payment_workspace_id_id_pk",
"columns": [
"workspace_id",
"id"
]
}
},
"uniqueConstraints": {},
"checkConstraint": {}
},
"usage": {
"name": "usage",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"workspace_id": {
"name": "workspace_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_created": {
"name": "time_created",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(now())"
},
"time_updated": {
"name": "time_updated",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)"
},
"time_deleted": {
"name": "time_deleted",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"model": {
"name": "model",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"provider": {
"name": "provider",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"input_tokens": {
"name": "input_tokens",
"type": "int",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"output_tokens": {
"name": "output_tokens",
"type": "int",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"reasoning_tokens": {
"name": "reasoning_tokens",
"type": "int",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cache_read_tokens": {
"name": "cache_read_tokens",
"type": "int",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cache_write_5m_tokens": {
"name": "cache_write_5m_tokens",
"type": "int",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cache_write_1h_tokens": {
"name": "cache_write_1h_tokens",
"type": "int",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"cost": {
"name": "cost",
"type": "bigint",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {},
"foreignKeys": {},
"compositePrimaryKeys": {
"usage_workspace_id_id_pk": {
"name": "usage_workspace_id_id_pk",
"columns": [
"workspace_id",
"id"
]
}
},
"uniqueConstraints": {},
"checkConstraint": {}
},
"key": {
"name": "key",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"workspace_id": {
"name": "workspace_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_created": {
"name": "time_created",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(now())"
},
"time_updated": {
"name": "time_updated",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)"
},
"time_deleted": {
"name": "time_deleted",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"actor": {
"name": "actor",
"type": "json",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"old_name": {
"name": "old_name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"key": {
"name": "key",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_used": {
"name": "time_used",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"global_key": {
"name": "global_key",
"columns": [
"key"
],
"isUnique": true
},
"name": {
"name": "name",
"columns": [
"workspace_id",
"name"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {
"key_workspace_id_id_pk": {
"name": "key_workspace_id_id_pk",
"columns": [
"workspace_id",
"id"
]
}
},
"uniqueConstraints": {},
"checkConstraint": {}
},
"user": {
"name": "user",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"workspace_id": {
"name": "workspace_id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_created": {
"name": "time_created",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(now())"
},
"time_updated": {
"name": "time_updated",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)"
},
"time_deleted": {
"name": "time_deleted",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"email": {
"name": "email",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"time_seen": {
"name": "time_seen",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"color": {
"name": "color",
"type": "int",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"role": {
"name": "role",
"type": "enum('admin','member')",
"primaryKey": false,
"notNull": true,
"autoincrement": false
}
},
"indexes": {
"user_email": {
"name": "user_email",
"columns": [
"workspace_id",
"email"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {
"user_workspace_id_id_pk": {
"name": "user_workspace_id_id_pk",
"columns": [
"workspace_id",
"id"
]
}
},
"uniqueConstraints": {},
"checkConstraint": {}
},
"workspace": {
"name": "workspace",
"columns": {
"id": {
"name": "id",
"type": "varchar(30)",
"primaryKey": false,
"notNull": true,
"autoincrement": false
},
"slug": {
"name": "slug",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"name": {
"name": "name",
"type": "varchar(255)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
},
"time_created": {
"name": "time_created",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "(now())"
},
"time_updated": {
"name": "time_updated",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": true,
"autoincrement": false,
"default": "CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)"
},
"time_deleted": {
"name": "time_deleted",
"type": "timestamp(3)",
"primaryKey": false,
"notNull": false,
"autoincrement": false
}
},
"indexes": {
"slug": {
"name": "slug",
"columns": [
"slug"
],
"isUnique": true
}
},
"foreignKeys": {},
"compositePrimaryKeys": {
"workspace_id": {
"name": "workspace_id",
"columns": [
"id"
]
}
},
"uniqueConstraints": {},
"checkConstraint": {}
}
},
"views": {},
"_meta": {
"schemas": {},
"tables": {},
"columns": {}
},
"internal": {
"tables": {},
"indexes": {}
}
}

View File

@@ -141,6 +141,13 @@
"when": 1759103696975, "when": 1759103696975,
"tag": "0019_dazzling_cable", "tag": "0019_dazzling_cable",
"breakpoints": true "breakpoints": true
},
{
"idx": 20,
"version": "5",
"when": 1759169697658,
"tag": "0020_supreme_jack_power",
"breakpoints": true
} }
] ]
} }

View File

@@ -21,7 +21,7 @@ export namespace Actor {
properties: { properties: {
userID: string userID: string
workspaceID: string workspaceID: string
role: UserRole role: (typeof UserRole)[number]
} }
} }

View File

@@ -2,8 +2,7 @@ import { mysqlTable, uniqueIndex, varchar, int, mysqlEnum } from "drizzle-orm/my
import { timestamps, utc, workspaceColumns } from "../drizzle/types" import { timestamps, utc, workspaceColumns } from "../drizzle/types"
import { workspaceIndexes } from "./workspace.sql" import { workspaceIndexes } from "./workspace.sql"
const UserRole = ["admin", "member"] as const export const UserRole = ["admin", "member"] as const
export type UserRole = (typeof UserRole)[number]
export const UserTable = mysqlTable( export const UserTable = mysqlTable(
"user", "user",
@@ -13,9 +12,8 @@ export const UserTable = mysqlTable(
email: varchar("email", { length: 255 }).notNull(), email: varchar("email", { length: 255 }).notNull(),
name: varchar("name", { length: 255 }).notNull(), name: varchar("name", { length: 255 }).notNull(),
timeSeen: utc("time_seen"), timeSeen: utc("time_seen"),
timeJoined: utc("time_joined"),
color: int("color"), color: int("color"),
role: mysqlEnum("role", ["admin", "member"]).notNull(), role: mysqlEnum("role", UserRole).notNull(),
}, },
(table) => [...workspaceIndexes(table), uniqueIndex("user_email").on(table.workspaceID, table.email)], (table) => [...workspaceIndexes(table), uniqueIndex("user_email").on(table.workspaceID, table.email)],
) )

View File

@@ -21,8 +21,8 @@ export namespace Workspace {
id: Identifier.create("user"), id: Identifier.create("user"),
email: account.properties.email, email: account.properties.email,
name: "", name: "",
timeSeen: sql`now()`,
role: "admin", role: "admin",
timeJoined: sql`now()`,
}) })
await tx.insert(BillingTable).values({ await tx.insert(BillingTable).values({
workspaceID, workspaceID,

View File

@@ -6,73 +6,81 @@
import "sst" import "sst"
declare module "sst" { declare module "sst" {
export interface Resource { export interface Resource {
AUTH_API_URL: { "AUTH_API_URL": {
type: "sst.sst.Linkable" "type": "sst.sst.Linkable"
value: string "value": string
} }
Console: { "Console": {
type: "sst.cloudflare.SolidStart" "type": "sst.cloudflare.SolidStart"
url: string "url": string
} }
Database: { "Database": {
database: string "database": string
host: string "host": string
password: string "password": string
port: number "port": number
type: "sst.sst.Linkable" "type": "sst.sst.Linkable"
username: string "username": string
} }
GITHUB_APP_ID: { "Desktop": {
type: "sst.sst.Secret" "type": "sst.cloudflare.StaticSite"
value: string "url": string
} }
GITHUB_APP_PRIVATE_KEY: { "EMAILOCTOPUS_API_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GITHUB_CLIENT_ID_CONSOLE: { "GITHUB_APP_ID": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GITHUB_CLIENT_SECRET_CONSOLE: { "GITHUB_APP_PRIVATE_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GOOGLE_CLIENT_ID: { "GITHUB_CLIENT_ID_CONSOLE": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
HONEYCOMB_API_KEY: { "GITHUB_CLIENT_SECRET_CONSOLE": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
STRIPE_SECRET_KEY: { "GOOGLE_CLIENT_ID": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
STRIPE_WEBHOOK_SECRET: { "HONEYCOMB_API_KEY": {
type: "sst.sst.Linkable" "type": "sst.sst.Secret"
value: string "value": string
} }
Web: { "STRIPE_SECRET_KEY": {
type: "sst.cloudflare.Astro" "type": "sst.sst.Secret"
url: string "value": string
} }
ZEN_MODELS: { "STRIPE_WEBHOOK_SECRET": {
type: "sst.sst.Secret" "type": "sst.sst.Linkable"
value: string "value": string
}
"Web": {
"type": "sst.cloudflare.Astro"
"url": string
}
"ZEN_MODELS": {
"type": "sst.sst.Secret"
"value": string
} }
} }
} }
// cloudflare // cloudflare
import * as cloudflare from "@cloudflare/workers-types" import * as cloudflare from "@cloudflare/workers-types";
declare module "sst" { declare module "sst" {
export interface Resource { export interface Resource {
Api: cloudflare.Service "Api": cloudflare.Service
AuthApi: cloudflare.Service "AuthApi": cloudflare.Service
AuthStorage: cloudflare.KVNamespace "AuthStorage": cloudflare.KVNamespace
Bucket: cloudflare.R2Bucket "Bucket": cloudflare.R2Bucket
LogProcessor: cloudflare.Service "LogProcessor": cloudflare.Service
} }
} }

View File

@@ -6,73 +6,81 @@
import "sst" import "sst"
declare module "sst" { declare module "sst" {
export interface Resource { export interface Resource {
AUTH_API_URL: { "AUTH_API_URL": {
type: "sst.sst.Linkable" "type": "sst.sst.Linkable"
value: string "value": string
} }
Console: { "Console": {
type: "sst.cloudflare.SolidStart" "type": "sst.cloudflare.SolidStart"
url: string "url": string
} }
Database: { "Database": {
database: string "database": string
host: string "host": string
password: string "password": string
port: number "port": number
type: "sst.sst.Linkable" "type": "sst.sst.Linkable"
username: string "username": string
} }
GITHUB_APP_ID: { "Desktop": {
type: "sst.sst.Secret" "type": "sst.cloudflare.StaticSite"
value: string "url": string
} }
GITHUB_APP_PRIVATE_KEY: { "EMAILOCTOPUS_API_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GITHUB_CLIENT_ID_CONSOLE: { "GITHUB_APP_ID": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GITHUB_CLIENT_SECRET_CONSOLE: { "GITHUB_APP_PRIVATE_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GOOGLE_CLIENT_ID: { "GITHUB_CLIENT_ID_CONSOLE": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
HONEYCOMB_API_KEY: { "GITHUB_CLIENT_SECRET_CONSOLE": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
STRIPE_SECRET_KEY: { "GOOGLE_CLIENT_ID": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
STRIPE_WEBHOOK_SECRET: { "HONEYCOMB_API_KEY": {
type: "sst.sst.Linkable" "type": "sst.sst.Secret"
value: string "value": string
} }
Web: { "STRIPE_SECRET_KEY": {
type: "sst.cloudflare.Astro" "type": "sst.sst.Secret"
url: string "value": string
} }
ZEN_MODELS: { "STRIPE_WEBHOOK_SECRET": {
type: "sst.sst.Secret" "type": "sst.sst.Linkable"
value: string "value": string
}
"Web": {
"type": "sst.cloudflare.Astro"
"url": string
}
"ZEN_MODELS": {
"type": "sst.sst.Secret"
"value": string
} }
} }
} }
// cloudflare // cloudflare
import * as cloudflare from "@cloudflare/workers-types" import * as cloudflare from "@cloudflare/workers-types";
declare module "sst" { declare module "sst" {
export interface Resource { export interface Resource {
Api: cloudflare.Service "Api": cloudflare.Service
AuthApi: cloudflare.Service "AuthApi": cloudflare.Service
AuthStorage: cloudflare.KVNamespace "AuthStorage": cloudflare.KVNamespace
Bucket: cloudflare.R2Bucket "Bucket": cloudflare.R2Bucket
LogProcessor: cloudflare.Service "LogProcessor": cloudflare.Service
} }
} }

View File

@@ -6,73 +6,81 @@
import "sst" import "sst"
declare module "sst" { declare module "sst" {
export interface Resource { export interface Resource {
AUTH_API_URL: { "AUTH_API_URL": {
type: "sst.sst.Linkable" "type": "sst.sst.Linkable"
value: string "value": string
} }
Console: { "Console": {
type: "sst.cloudflare.SolidStart" "type": "sst.cloudflare.SolidStart"
url: string "url": string
} }
Database: { "Database": {
database: string "database": string
host: string "host": string
password: string "password": string
port: number "port": number
type: "sst.sst.Linkable" "type": "sst.sst.Linkable"
username: string "username": string
} }
GITHUB_APP_ID: { "Desktop": {
type: "sst.sst.Secret" "type": "sst.cloudflare.StaticSite"
value: string "url": string
} }
GITHUB_APP_PRIVATE_KEY: { "EMAILOCTOPUS_API_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GITHUB_CLIENT_ID_CONSOLE: { "GITHUB_APP_ID": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GITHUB_CLIENT_SECRET_CONSOLE: { "GITHUB_APP_PRIVATE_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GOOGLE_CLIENT_ID: { "GITHUB_CLIENT_ID_CONSOLE": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
HONEYCOMB_API_KEY: { "GITHUB_CLIENT_SECRET_CONSOLE": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
STRIPE_SECRET_KEY: { "GOOGLE_CLIENT_ID": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
STRIPE_WEBHOOK_SECRET: { "HONEYCOMB_API_KEY": {
type: "sst.sst.Linkable" "type": "sst.sst.Secret"
value: string "value": string
} }
Web: { "STRIPE_SECRET_KEY": {
type: "sst.cloudflare.Astro" "type": "sst.sst.Secret"
url: string "value": string
} }
ZEN_MODELS: { "STRIPE_WEBHOOK_SECRET": {
type: "sst.sst.Secret" "type": "sst.sst.Linkable"
value: string "value": string
}
"Web": {
"type": "sst.cloudflare.Astro"
"url": string
}
"ZEN_MODELS": {
"type": "sst.sst.Secret"
"value": string
} }
} }
} }
// cloudflare // cloudflare
import * as cloudflare from "@cloudflare/workers-types" import * as cloudflare from "@cloudflare/workers-types";
declare module "sst" { declare module "sst" {
export interface Resource { export interface Resource {
Api: cloudflare.Service "Api": cloudflare.Service
AuthApi: cloudflare.Service "AuthApi": cloudflare.Service
AuthStorage: cloudflare.KVNamespace "AuthStorage": cloudflare.KVNamespace
Bucket: cloudflare.R2Bucket "Bucket": cloudflare.R2Bucket
LogProcessor: cloudflare.Service "LogProcessor": cloudflare.Service
} }
} }

120
sst-env.d.ts vendored
View File

@@ -5,79 +5,87 @@
declare module "sst" { declare module "sst" {
export interface Resource { export interface Resource {
AUTH_API_URL: { "AUTH_API_URL": {
type: "sst.sst.Linkable" "type": "sst.sst.Linkable"
value: string "value": string
} }
Api: { "Api": {
type: "sst.cloudflare.Worker" "type": "sst.cloudflare.Worker"
url: string "url": string
} }
AuthApi: { "AuthApi": {
type: "sst.cloudflare.Worker" "type": "sst.cloudflare.Worker"
url: string "url": string
} }
AuthStorage: { "AuthStorage": {
type: "sst.cloudflare.Kv" "type": "sst.cloudflare.Kv"
} }
Bucket: { "Bucket": {
name: string "name": string
type: "sst.cloudflare.Bucket" "type": "sst.cloudflare.Bucket"
} }
Console: { "Console": {
type: "sst.cloudflare.SolidStart" "type": "sst.cloudflare.SolidStart"
url: string "url": string
} }
Database: { "Database": {
database: string "database": string
host: string "host": string
password: string "password": string
port: number "port": number
type: "sst.sst.Linkable" "type": "sst.sst.Linkable"
username: string "username": string
} }
GITHUB_APP_ID: { "Desktop": {
type: "sst.sst.Secret" "type": "sst.cloudflare.StaticSite"
value: string "url": string
} }
GITHUB_APP_PRIVATE_KEY: { "EMAILOCTOPUS_API_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GITHUB_CLIENT_ID_CONSOLE: { "GITHUB_APP_ID": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GITHUB_CLIENT_SECRET_CONSOLE: { "GITHUB_APP_PRIVATE_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
GOOGLE_CLIENT_ID: { "GITHUB_CLIENT_ID_CONSOLE": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
HONEYCOMB_API_KEY: { "GITHUB_CLIENT_SECRET_CONSOLE": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
LogProcessor: { "GOOGLE_CLIENT_ID": {
type: "sst.cloudflare.Worker" "type": "sst.sst.Secret"
"value": string
} }
STRIPE_SECRET_KEY: { "HONEYCOMB_API_KEY": {
type: "sst.sst.Secret" "type": "sst.sst.Secret"
value: string "value": string
} }
STRIPE_WEBHOOK_SECRET: { "LogProcessor": {
type: "sst.sst.Linkable" "type": "sst.cloudflare.Worker"
value: string
} }
Web: { "STRIPE_SECRET_KEY": {
type: "sst.cloudflare.Astro" "type": "sst.sst.Secret"
url: string "value": string
} }
ZEN_MODELS: { "STRIPE_WEBHOOK_SECRET": {
type: "sst.sst.Secret" "type": "sst.sst.Linkable"
value: string "value": string
}
"Web": {
"type": "sst.cloudflare.Astro"
"url": string
}
"ZEN_MODELS": {
"type": "sst.sst.Secret"
"value": string
} }
} }
} }