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 { AgenticApiClient } from '@agentic/platform-api-client'
|
||||||
|
|
||||||
import { deployFixtures } from '../src/deploy-fixtures'
|
import { deployFixtures } from '../src/deploy-fixtures'
|
||||||
import { env } from '../src/env'
|
import { env, isProd } from '../src/env'
|
||||||
|
|
||||||
export const client = new AgenticApiClient({
|
export const client = new AgenticApiClient({
|
||||||
apiBaseUrl: env.AGENTIC_API_BASE_URL
|
apiBaseUrl: env.AGENTIC_API_BASE_URL
|
||||||
})
|
})
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
// TODO: clear existing tables? and include prompt to double check if so...
|
||||||
|
|
||||||
const devAuthSession = await client.signUpWithPassword({
|
const devAuthSession = await client.signUpWithPassword({
|
||||||
username: 'dev',
|
username: 'dev',
|
||||||
email: env.AGENTIC_DEV_EMAIL,
|
email: env.AGENTIC_DEV_EMAIL,
|
||||||
password: env.AGENTIC_DEV_PASSWORD
|
password: env.AGENTIC_DEV_PASSWORD
|
||||||
})
|
})
|
||||||
|
|
||||||
console.log(JSON.stringify(devAuthSession, null, 2))
|
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()
|
const deployments = await deployFixtures()
|
||||||
console.log(JSON.stringify(deployments, null, 2))
|
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
|
// TODO: use `@agentic/platform-hono` base env like other services
|
||||||
|
|
||||||
export const envSchema = z.object({
|
export const envSchema = z.object({
|
||||||
|
ENVIRONMENT: z
|
||||||
|
.enum(['development', 'test', 'production'])
|
||||||
|
.default('development'),
|
||||||
|
|
||||||
AGENTIC_API_BASE_URL: z.string().url().optional(),
|
AGENTIC_API_BASE_URL: z.string().url().optional(),
|
||||||
|
|
||||||
AGENTIC_DEV_ACCESS_TOKEN: z.string().nonempty(),
|
AGENTIC_DEV_ACCESS_TOKEN: z.string().nonempty(),
|
||||||
|
@ -25,3 +29,5 @@ export const envSchema = z.object({
|
||||||
export const env = parseZodSchema(envSchema, process.env, {
|
export const env = parseZodSchema(envSchema, process.env, {
|
||||||
error: 'Invalid environment variables'
|
error: 'Invalid environment variables'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const isProd = env.ENVIRONMENT === 'production'
|
||||||
|
|
|
@ -21,7 +21,7 @@ export function Header() {
|
||||||
About
|
About
|
||||||
</ActiveLink>
|
</ActiveLink>
|
||||||
|
|
||||||
{ctx?.api.isAuthenticated ? (
|
{ctx?.isAuthenticated ? (
|
||||||
<>
|
<>
|
||||||
<ActiveLink href='/app' className='link'>
|
<ActiveLink href='/app' className='link'>
|
||||||
Dashboard
|
Dashboard
|
||||||
|
|
Ładowanie…
Reference in New Issue