-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c1c053b
commit 2b2e7c7
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import { PrismaClient } from '@typebot.io/prisma' | ||
import { promptAndSetEnvironment } from './utils' | ||
import * as p from '@clack/prompts' | ||
|
||
const inspectWorkspace = async () => { | ||
await promptAndSetEnvironment('production') | ||
|
||
const id = await p.text({ | ||
message: 'Workspace ID?', | ||
}) | ||
|
||
if (!id || typeof id !== 'string') { | ||
console.log('No ID provided') | ||
return | ||
} | ||
|
||
const prisma = new PrismaClient({ | ||
log: [{ emit: 'event', level: 'query' }, 'info', 'warn', 'error'], | ||
}) | ||
|
||
const workspace = await prisma.workspace.findFirst({ | ||
where: { | ||
id, | ||
}, | ||
include: { | ||
typebots: { | ||
select: { | ||
id: true, | ||
name: true, | ||
}, | ||
}, | ||
members: { | ||
select: { | ||
user: { select: { email: true } }, | ||
role: true, | ||
}, | ||
}, | ||
}, | ||
}) | ||
|
||
if (!workspace) { | ||
console.log('Workspace not found') | ||
return | ||
} | ||
|
||
console.log(JSON.stringify(workspace, null, 2)) | ||
} | ||
|
||
inspectWorkspace() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters