kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
ee5783e780
commit
a19a084310
|
@ -1,21 +1,26 @@
|
|||
import { AgenticApiClient } from '@agentic/platform-api-client'
|
||||
|
||||
import { deployFixtures } from '../src/deploy-fixtures'
|
||||
import { env } from '../src/env'
|
||||
import { env, isProd } from '../src/env'
|
||||
|
||||
export const client = new AgenticApiClient({
|
||||
apiBaseUrl: env.AGENTIC_API_BASE_URL
|
||||
})
|
||||
|
||||
async function main() {
|
||||
// TODO: clear existing tables? and include prompt to double check if so...
|
||||
|
||||
const devAuthSession = await client.signUpWithPassword({
|
||||
username: 'dev',
|
||||
email: env.AGENTIC_DEV_EMAIL,
|
||||
password: env.AGENTIC_DEV_PASSWORD
|
||||
})
|
||||
|
||||
console.log(JSON.stringify(devAuthSession, null, 2))
|
||||
|
||||
console.warn(
|
||||
`\n\nREMEMBER TO UPDATE "AGENTIC_DEV_ACCESS_TOKEN" in e2e/.env${isProd ? '.production' : ''}\n\n`
|
||||
)
|
||||
|
||||
const deployments = await deployFixtures()
|
||||
console.log(JSON.stringify(deployments, null, 2))
|
||||
}
|
||||
|
|
|
@ -8,6 +8,10 @@ import { z } from 'zod'
|
|||
// TODO: use `@agentic/platform-hono` base env like other services
|
||||
|
||||
export const envSchema = z.object({
|
||||
ENVIRONMENT: z
|
||||
.enum(['development', 'test', 'production'])
|
||||
.default('development'),
|
||||
|
||||
AGENTIC_API_BASE_URL: z.string().url().optional(),
|
||||
|
||||
AGENTIC_DEV_ACCESS_TOKEN: z.string().nonempty(),
|
||||
|
@ -25,3 +29,5 @@ export const envSchema = z.object({
|
|||
export const env = parseZodSchema(envSchema, process.env, {
|
||||
error: 'Invalid environment variables'
|
||||
})
|
||||
|
||||
export const isProd = env.ENVIRONMENT === 'production'
|
||||
|
|
|
@ -21,7 +21,7 @@ export function Header() {
|
|||
About
|
||||
</ActiveLink>
|
||||
|
||||
{ctx?.api.isAuthenticated ? (
|
||||
{ctx?.isAuthenticated ? (
|
||||
<>
|
||||
<ActiveLink href='/app' className='link'>
|
||||
Dashboard
|
||||
|
|
Ładowanie…
Reference in New Issue