@vibecodeapp/cloud-studio 0.1.5 → 0.2.0

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.
@@ -15,7 +15,7 @@
15
15
  mq.addEventListener('change', update);
16
16
  })();
17
17
  </script>
18
- <script type="module" crossorigin src="/assets/index-uiOGXfRY.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-C7SVavLV.js"></script>
19
19
  <link rel="stylesheet" crossorigin href="/assets/index-Dm0NurdA.css">
20
20
  </head>
21
21
  <body>
@@ -2360,23 +2360,39 @@ import { pathToFileURL } from "url";
2360
2360
  import { join as join2 } from "path";
2361
2361
  var cachedSchema = null;
2362
2362
  var PrismaClientConstructor = null;
2363
+ var PRISMA_CLIENT_PATHS = [
2364
+ // Custom output locations (relative to CWD)
2365
+ ["generated", "prisma", "index.js"],
2366
+ ["generated", "client", "index.js"],
2367
+ ["src", "generated", "prisma", "index.js"],
2368
+ ["src", "generated", "client", "index.js"],
2369
+ ["prisma", "generated", "index.js"],
2370
+ // Default node_modules locations
2371
+ ["node_modules", ".prisma", "client", "index.js"],
2372
+ ["node_modules", "@prisma", "client", "index.js"]
2373
+ ];
2363
2374
  async function loadPrismaClient() {
2364
2375
  if (PrismaClientConstructor) {
2365
2376
  return PrismaClientConstructor;
2366
2377
  }
2367
- try {
2368
- const prismaPath = join2(process.cwd(), "generated", "prisma", "index.js");
2369
- const prismaModule = await import(pathToFileURL(prismaPath).href);
2370
- PrismaClientConstructor = prismaModule.PrismaClient;
2371
- if (prismaModule.Prisma?.dmmf?.datamodel) {
2372
- cachedSchema = prismaModule.Prisma.dmmf.datamodel;
2378
+ const errors = [];
2379
+ for (const pathSegments of PRISMA_CLIENT_PATHS) {
2380
+ const prismaPath = join2(process.cwd(), ...pathSegments);
2381
+ try {
2382
+ const prismaModule = await import(pathToFileURL(prismaPath).href);
2383
+ PrismaClientConstructor = prismaModule.PrismaClient;
2384
+ if (prismaModule.Prisma?.dmmf?.datamodel) {
2385
+ cachedSchema = prismaModule.Prisma.dmmf.datamodel;
2386
+ }
2387
+ return PrismaClientConstructor;
2388
+ } catch (error) {
2389
+ errors.push(`${prismaPath}: ${error instanceof Error ? error.message : String(error)}`);
2373
2390
  }
2374
- return PrismaClientConstructor;
2375
- } catch (error) {
2376
- throw new Error(
2377
- `Failed to load Prisma Client from ${join2(process.cwd(), "generated", "prisma", "index.js")}: ${error instanceof Error ? error.message : String(error)}`
2378
- );
2379
2391
  }
2392
+ throw new Error(
2393
+ `Failed to load Prisma Client. Searched locations:
2394
+ ${errors.join("\n")}`
2395
+ );
2380
2396
  }
2381
2397
  async function withPrisma(fn) {
2382
2398
  const ClientConstructor = await loadPrismaClient();
@@ -6729,6 +6745,30 @@ tableRoutes.delete("/:tableName/:id", async (c) => {
6729
6745
  return handlePrismaError(error, c);
6730
6746
  }
6731
6747
  });
6748
+ tableRoutes.delete("/:tableName", async (c) => {
6749
+ const tableName = c.req.param("tableName");
6750
+ try {
6751
+ const { ids } = await c.req.json();
6752
+ if (!Array.isArray(ids) || ids.length === 0) {
6753
+ return c.json({ success: false, error: "ids array is required" }, 400);
6754
+ }
6755
+ const convertedIds = await Promise.all(
6756
+ ids.map((id) => convertIdParameter(tableName, id))
6757
+ );
6758
+ return await withModel(tableName, async (model) => {
6759
+ const result = await model.deleteMany({
6760
+ where: { id: { in: convertedIds } }
6761
+ });
6762
+ const response = {
6763
+ success: true,
6764
+ data: { deleted: result.count }
6765
+ };
6766
+ return c.json(response);
6767
+ });
6768
+ } catch (error) {
6769
+ return handlePrismaError(error, c);
6770
+ }
6771
+ });
6732
6772
 
6733
6773
  // server/index.ts
6734
6774
  var __filename = fileURLToPath(import.meta.url);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibecodeapp/cloud-studio",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "description": "Lightweight database UI for SQLite with Prisma",
5
5
  "type": "module",
6
6
  "main": "dist/server/index.js",