Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

experimental: Enhance Performance by Using Postgrest to Fetch Data from Build Table (#3758)

Ivan Starkov231c792ebfbe
diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json
index c0d5d7cbad..e3b6e632b4 100644
--- a/.devcontainer/devcontainer.json
+++ b/.devcontainer/devcontainer.json
@@ -18,7 +18,7 @@
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// This can be used to network with other containers or with the host.
// "forwardPorts": [3000, 5432],
- "forwardPorts": [5173, "db:5432"],
+ "forwardPorts": [5173],
// Use 'postCreateCommand' to run commands after the container is created.
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
index 0b4adf5d59..9664ac0b81 100644
--- a/.devcontainer/docker-compose.yml
+++ b/.devcontainer/docker-compose.yml
@@ -13,7 +13,6 @@ services:
# Overrides default command so things don't shut down after the process ends.
command: sleep infinity
-
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
network_mode: service:db
@@ -24,7 +23,7 @@ services:
db:
image: ghcr.io/supabase/postgres:15.1.1.55
# Uncomment to log all queries
- # command: ["postgres", "-c", "log_statement=all"]
+ command: ["postgres", "-c", "log_statement=all", "-c", "listen_addresses=*"]
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
@@ -34,6 +33,7 @@ services:
ports:
- ${PGPORT:-5432}:5432
+ - 3000:3000
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d webstudio"]
@@ -41,8 +41,26 @@ services:
timeout: 5s
retries: 25
- # Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
- # (Adding the "ports" property to this file will not forward from a Codespace.)
+ rest:
+ container_name: supabase-rest
+ image: postgrest/postgrest:v12.2.0
+ depends_on:
+ db:
+ # Disable this if you are using an external Postgres database
+ condition: service_healthy
+ restart: unless-stopped
+ environment:
+ PGRST_DB_URI: postgresql://postgres:pass@localhost/webstudio
+ PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS:-public}
+ PGRST_DB_ANON_ROLE: anon
+ PGRST_JWT_SECRET: ${JWT_SECRET:-jwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecret}
+ PGRST_DB_USE_LEGACY_GUCS: "false"
+ PGRST_APP_SETTINGS_JWT_SECRET: ${JWT_SECRET:-jwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecretjwtsecret}
+ PGRST_APP_SETTINGS_JWT_EXP: ${JWT_EXPIRY}
+ command: "postgrest"
+
+ # Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
+ network_mode: service:db
volumes:
postgres-data:
diff --git a/apps/builder/.env b/apps/builder/.env
index 9918251a42..553f13a414 100644
--- a/apps/builder/.env
+++ b/apps/builder/.env
@@ -15,6 +15,10 @@ MAX_ASSETS_PER_PROJECT=50
FILE_UPLOAD_PATH="public/s/uploads"
ASSET_BASE_URL=/s/uploads/
+POSTGREST_URL=http://localhost:3000
+# JWT token, decode using jwt.io. Encoded with PGRST_JWT_SECRET from docker-compose.yml
+POSTGREST_API_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImttZHBpeHpvcWlpcmJtcGRpcHB5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE2NjYzMzY0MjgsImV4cCI6MTk4MTkxMjQyOH0.jjeYvTDrWP9pV7dfZr6fptualNQ3aR13kuPhvT25Sso"
+
# Optional max upload size in Mb
# MAX_UPLOAD_SIZE=10
diff --git a/apps/builder/app/env/env.server.ts b/apps/builder/app/env/env.server.ts
index cf1c8ac7f7..9038b2aaf6 100644
--- a/apps/builder/app/env/env.server.ts
+++ b/apps/builder/app/env/env.server.ts
@@ -97,6 +97,9 @@ const env = {
// current user plan features (default)
USER_PLAN: process.env.USER_PLAN ?? "",
+
+ POSTGREST_URL: process.env.POSTGREST_URL ?? "http://localhost:3000",
+ POSTGREST_API_KEY: process.env.POSTGREST_API_KEY ?? "",
};
export type ServerEnv = typeof env;
diff --git a/apps/builder/app/routes/builder.$projectId.tsx b/apps/builder/app/routes/builder.$projectId.tsx
index cf8b9098ea..5ddaf8c7df 100644
--- a/apps/builder/app/routes/builder.$projectId.tsx
+++ b/apps/builder/app/routes/builder.$projectId.tsx
@@ -68,7 +68,10 @@ export const loader = async ({
throw new Error(`Project "${params.projectId}" not found`);
}
- const devBuild = await loadBuildIdAndVersionByProjectId(project.id);
+ const devBuild = await loadBuildIdAndVersionByProjectId(
+ context,
+ project.id
+ );
const end = Date.now();
diff --git a/apps/builder/app/routes/rest.ai._index.ts b/apps/builder/app/routes/rest.ai._index.ts
index a018db5c5b..6cff20dcc5 100644
--- a/apps/builder/app/routes/rest.ai._index.ts
+++ b/apps/builder/app/routes/rest.ai._index.ts
@@ -41,6 +41,7 @@ export const config = {
};
export const action = async ({ request }: ActionFunctionArgs) => {
+ const context = await createContext(request);
// @todo Reinstate isFeatureEnabled('ai')
if (env.OPENAI_KEY === undefined) {
@@ -138,7 +139,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
};
}
- const { instances } = await loadBuildByProjectId(projectId);
+ const { instances } = await loadBuildByProjectId(context, projectId);
const model = createGptModel({
apiKey: env.OPENAI_KEY,
diff --git a/apps/builder/app/routes/rest.data.$projectId.ts b/apps/builder/app/routes/rest.data.$projectId.ts
index 0d707f83ab..fd3c5c6ba5 100644
--- a/apps/builder/app/routes/rest.data.$projectId.ts
+++ b/apps/builder/app/routes/rest.data.$projectId.ts
@@ -16,7 +16,7 @@ export const loader = async ({ params, request }: LoaderFunctionArgs) => {
if (project.userId === null) {
throw new Error("Project must have project userId defined");
}
- const devBuild = await loadBuildByProjectId(project.id);
+ const devBuild = await loadBuildByProjectId(context, project.id);
const assets = await loadAssetsByProject(project.id, context);
return {
build: devBuild,
diff --git a/apps/builder/app/routes/rest.patch.ts b/apps/builder/app/routes/rest.patch.ts
index 9a75a62b8b..d0244520de 100644
--- a/apps/builder/app/routes/rest.patch.ts
+++ b/apps/builder/app/routes/rest.patch.ts
@@ -1,7 +1,6 @@
import { applyPatches, enableMapSet, enablePatches } from "immer";
import type { ActionFunctionArgs } from "@remix-run/server-runtime";
import type { SyncItem } from "immerhin";
-import { prisma } from "@webstudio-is/prisma-client";
import {
Breakpoints,
Breakpoint,
@@ -31,12 +30,14 @@ import {
serializeData,
parseConfig,
serializeConfig,
+ loadRawBuildById,
} from "@webstudio-is/project-build/index.server";
import { patchAssets } from "@webstudio-is/asset-uploader/index.server";
import type { Project } from "@webstudio-is/project";
import { authorizeProject } from "@webstudio-is/trpc-interface/index.server";
import { createContext } from "~/shared/context.server";
import { db } from "@webstudio-is/project/index.server";
+import type { Database } from "@webstudio-is/postrest/index.server";
type PatchData = {
transactions: Array<SyncItem>;
@@ -78,14 +79,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
throw Error("You don't have edit access to this project");
}
- // await new Promise((r) => setTimeout(r, 10000));
-
- const build = await prisma.build.findUnique({
- where: { id_projectId: { projectId, id: buildId } },
- });
- if (build === null) {
- throw Error(`Build ${buildId} not found`);
- }
+ const build = await loadRawBuildById(context, buildId);
const serverVersion = build.version;
if (clientVersion !== serverVersion) {
@@ -231,7 +225,7 @@ export const action = async ({ request }: ActionFunctionArgs) => {
}
// save build data when all patches applied
- const dbBuildData: Parameters<typeof prisma.build.update>[0]["data"] = {
+ const dbBuildData: Database["public"]["Tables"]["Build"]["Update"] = {
version: clientVersion + 1,
lastTransactionId,
};
@@ -304,18 +298,27 @@ export const action = async ({ request }: ActionFunctionArgs) => {
);
}
- const { count } = await prisma.build.updateMany({
- data: dbBuildData,
- where: {
- projectId,
+ const update = await context.postgrest.client
+ .from("Build")
+ .update(dbBuildData, { count: "exact" })
+ .match({
id: buildId,
+ projectId,
version: clientVersion,
- },
- });
+ });
+
+ if (update.error) {
+ console.error(update.error);
+ throw update.error;
+ }
+ if (update.count == null) {
+ console.error("Update count is null");
+ throw new Error("Update count is null");
+ }
// ensure only build with client version is updated
// to avoid race conditions
- if (count === 0) {
+ if (update.count === 0) {
// We don't validate if lastTransactionId matches the user's transaction ID here, as we've already done so earlier.
// Given the sequential nature of messages from a single client, this situation is deemed improbable.
return {
diff --git a/apps/builder/app/shared/context.server.ts b/apps/builder/app/shared/context.server.ts
index 44312db8d7..465efd55ea 100644
--- a/apps/builder/app/shared/context.server.ts
+++ b/apps/builder/app/shared/context.server.ts
@@ -9,6 +9,7 @@ import {
getUserPlanFeatures,
} from "./db/user-plan-features.server";
import { staticEnv } from "~/env/env.static.server";
+import { createClient } from "@webstudio-is/postrest/index.server";
const createAuthorizationContext = async (
request: Request
@@ -107,6 +108,10 @@ const createTrpcCache = () => {
};
};
+const createPostrestContext = () => {
+ return { client: createClient(env.POSTGREST_URL, env.POSTGREST_API_KEY) };
+};
+
/**
* argument buildEnv==="prod" only if we are loading project with production build
*/
@@ -117,6 +122,7 @@ export const createContext = async (request: Request): Promise<AppContext> => {
const entri = createEntriContext();
const userPlanFeatures = await createUserPlanContext(request);
const trpcCache = createTrpcCache();
+ const postgrest = createPostrestContext();
return {
authorization,
@@ -125,5 +131,6 @@ export const createContext = async (request: Request): Promise<AppContext> => {
entri,
userPlanFeatures,
trpcCache,
+ postgrest,
};
};
diff --git a/apps/builder/app/shared/db/canvas.server.ts b/apps/builder/app/shared/db/canvas.server.ts
index 299de01c64..31bc5faf1c 100644
--- a/apps/builder/app/shared/db/canvas.server.ts
+++ b/apps/builder/app/shared/db/canvas.server.ts
@@ -10,7 +10,7 @@ export const loadProductionCanvasData = async (
buildId: Build["id"],
context: AppContext
): Promise<Data> => {
- const build = await loadBuildById(buildId);
+ const build = await loadBuildById(context, buildId);
if (build === undefined) {
throw new Error("The project is not published");
diff --git a/apps/builder/app/shared/marketplace/db.server.ts b/apps/builder/app/shared/marketplace/db.server.ts
index 4c63a0809e..4d90a588a4 100644
--- a/apps/builder/app/shared/marketplace/db.server.ts
+++ b/apps/builder/app/shared/marketplace/db.server.ts
@@ -2,7 +2,7 @@ import { prisma } from "@webstudio-is/prisma-client";
import { MarketplaceProduct } from "@webstudio-is/project-build";
import type { BuildData, MarketplaceOverviewItem } from "./types";
import {
- loadProdBuildByProjectId,
+ loadApprovedProdBuildByProjectId,
parseConfig,
} from "@webstudio-is/project-build/index.server";
import type { AppContext } from "@webstudio-is/trpc-interface/index.server";
@@ -13,9 +13,7 @@ export const getBuildProdData = async (
{ projectId }: { projectId: Project["id"] },
context: AppContext
): Promise<BuildData> => {
- const build = await loadProdBuildByProjectId(projectId, {
- marketplaceApprovalStatus: "APPROVED",
- });
+ const build = await loadApprovedProdBuildByProjectId(projectId);
const assets = await loadAssetsByProject(projectId, context, {
skipPermissionsCheck: true,
diff --git a/apps/builder/package.json b/apps/builder/package.json
index 33920506b0..5f84b3d3c2 100644
--- a/apps/builder/package.json
+++ b/apps/builder/package.json
@@ -62,6 +62,7 @@
"@webstudio-is/http-client": "workspace:*",
"@webstudio-is/icons": "workspace:*",
"@webstudio-is/image": "workspace:*",
+ "@webstudio-is/postrest": "workspace:*",
"@webstudio-is/prisma-client": "workspace:*",
"@webstudio-is/project": "workspace:*",
"@webstudio-is/project-build": "workspace:*",
diff --git a/packages/postgrest/README.md b/packages/postgrest/README.md
new file mode 100644
index 0000000000..4eeff423b4
--- /dev/null
+++ b/packages/postgrest/README.md
@@ -0,0 +1,17 @@
+# Postgrest
+
+## Postgrest-js
+
+[postgrest-js best doc](https://supabase.com/docs/reference/javascript/select)
+
+## Generated Types
+
+```bash
+pnpm generate-types
+```
+
+## Next steps.
+
+Use https://supabase.com/docs/reference/cli/supabase-db-start or directly https://github.com/djrobstep/migra for migrations.
+
+Supabase can be used with `--db-url` flag to not reproduce "local" env
diff --git a/packages/postgrest/jest.config.js b/packages/postgrest/jest.config.js
new file mode 100644
index 0000000000..e7fc137533
--- /dev/null
+++ b/packages/postgrest/jest.config.js
@@ -0,0 +1 @@
+export { default } from "@webstudio-is/jest-config";
diff --git a/packages/postgrest/package.json b/packages/postgrest/package.json
new file mode 100644
index 0000000000..ee12fc8d6b
--- /dev/null
+++ b/packages/postgrest/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "@webstudio-is/postrest",
+ "version": "0.0.0",
+ "description": "Webstudio Project Build",
+ "author": "Webstudio <[email protected]>",
+ "homepage": "https://webstudio.is",
+ "license": "AGPL-3.0-or-later",
+ "private": true,
+ "type": "module",
+ "exports": {
+ "./index.server": {
+ "webstudio": "./src/index.server.ts",
+ "import": "./src/index.server.ts"
+ }
+ },
+ "sideEffects": false,
+ "scripts": {
+ "typecheck": "tsc",
+ "generate-types": "pnpx supabase gen types --lang=typescript --db-url postgresql://postgres:pass@localhost/webstudio > ./src/__generated__/db-types.ts"
+ },
+ "dependencies": {
+ "@supabase/postgrest-js": "^1.15.8"
+ },
+ "devDependencies": {
+ "@webstudio-is/tsconfig": "workspace:*",
+ "type-fest": "^4.3.1",
+ "typescript": "5.5.2"
+ }
+}
diff --git a/packages/postgrest/src/__generated__/db-types.ts b/packages/postgrest/src/__generated__/db-types.ts
new file mode 100644
index 0000000000..ca1aede032
--- /dev/null
+++ b/packages/postgrest/src/__generated__/db-types.ts
@@ -0,0 +1,852 @@
+export type Json =
+ | string
+ | number
+ | boolean
+ | null
+ | { [key: string]: Json | undefined }
+ | Json[];
+
+export type Database = {
+ public: {
+ Tables: {
+ _prisma_migrations: {
+ Row: {
+ applied_steps_count: number;
+ checksum: string;
+ finished_at: string | null;
+ id: string;
+ logs: string | null;
+ migration_name: string;
+ rolled_back_at: string | null;
+ started_at: string;
+ };
+ Insert: {
+ applied_steps_count?: number;
+ checksum: string;
+ finished_at?: string | null;
+ id: string;
+ logs?: string | null;
+ migration_name: string;
+ rolled_back_at?: string | null;
+ started_at?: string;
+ };
+ Update: {
+ applied_steps_count?: number;
+ checksum?: string;
+ finished_at?: string | null;
+ id?: string;
+ logs?: string | null;
+ migration_name?: string;
+ rolled_back_at?: string | null;
+ started_at?: string;
+ };
+ Relationships: [];
+ };
+ Asset: {
+ Row: {
+ id: string;
+ name: string;
+ projectId: string;
+ };
+ Insert: {
+ id: string;
+ name: string;
+ projectId: string;
+ };
+ Update: {
+ id?: string;
+ name?: string;
+ projectId?: string;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "Asset_name_fkey";
+ columns: ["name"];
+ isOneToOne: false;
+ referencedRelation: "File";
+ referencedColumns: ["name"];
+ },
+ ];
+ };
+ AuthorizationToken: {
+ Row: {
+ canClone: boolean;
+ canCopy: boolean;
+ createdAt: string;
+ name: string;
+ projectId: string;
+ relation: Database["public"]["Enums"]["AuthorizationRelation"];
+ token: string;
+ };
+ Insert: {
+ canClone?: boolean;
+ canCopy?: boolean;
+ createdAt?: string;
+ name?: string;
+ projectId: string;
+ relation?: Database["public"]["Enums"]["AuthorizationRelation"];
+ token: string;
+ };
+ Update: {
+ canClone?: boolean;
+ canCopy?: boolean;
+ createdAt?: string;
+ name?: string;
+ projectId?: string;
+ relation?: Database["public"]["Enums"]["AuthorizationRelation"];
+ token?: string;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "AuthorizationToken_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "DashboardProject";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "AuthorizationToken_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "Project";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ Build: {
+ Row: {
+ breakpoints: string;
+ createdAt: string;
+ dataSources: string;
+ deployment: string | null;
+ id: string;
+ instances: string;
+ lastTransactionId: string | null;
+ marketplaceProduct: string;
+ pages: string;
+ projectId: string;
+ props: string;
+ publishStatus: Database["public"]["Enums"]["PublishStatus"];
+ resources: string;
+ styles: string;
+ styleSources: string;
+ styleSourceSelections: string;
+ updatedAt: string;
+ version: number;
+ };
+ Insert: {
+ breakpoints?: string;
+ createdAt?: string;
+ dataSources?: string;
+ deployment?: string | null;
+ id: string;
+ instances?: string;
+ lastTransactionId?: string | null;
+ marketplaceProduct?: string;
+ pages: string;
+ projectId: string;
+ props?: string;
+ publishStatus?: Database["public"]["Enums"]["PublishStatus"];
+ resources?: string;
+ styles?: string;
+ styleSources?: string;
+ styleSourceSelections?: string;
+ updatedAt?: string;
+ version?: number;
+ };
+ Update: {
+ breakpoints?: string;
+ createdAt?: string;
+ dataSources?: string;
+ deployment?: string | null;
+ id?: string;
+ instances?: string;
+ lastTransactionId?: string | null;
+ marketplaceProduct?: string;
+ pages?: string;
+ projectId?: string;
+ props?: string;
+ publishStatus?: Database["public"]["Enums"]["PublishStatus"];
+ resources?: string;
+ styles?: string;
+ styleSources?: string;
+ styleSourceSelections?: string;
+ updatedAt?: string;
+ version?: number;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "Build_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "DashboardProject";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "Build_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "Project";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ ClientReferences: {
+ Row: {
+ createdAt: string;
+ reference: string;
+ service: string;
+ userId: string;
+ };
+ Insert: {
+ createdAt?: string;
+ reference?: string;
+ service: string;
+ userId: string;
+ };
+ Update: {
+ createdAt?: string;
+ reference?: string;
+ service?: string;
+ userId?: string;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "ClientReferences_userId_fkey";
+ columns: ["userId"];
+ isOneToOne: false;
+ referencedRelation: "User";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ Domain: {
+ Row: {
+ createdAt: string;
+ domain: string;
+ error: string | null;
+ id: string;
+ status: Database["public"]["Enums"]["DomainStatus"];
+ txtRecord: string | null;
+ updatedAt: string;
+ };
+ Insert: {
+ createdAt?: string;
+ domain: string;
+ error?: string | null;
+ id: string;
+ status?: Database["public"]["Enums"]["DomainStatus"];
+ txtRecord?: string | null;
+ updatedAt?: string;
+ };
+ Update: {
+ createdAt?: string;
+ domain?: string;
+ error?: string | null;
+ id?: string;
+ status?: Database["public"]["Enums"]["DomainStatus"];
+ txtRecord?: string | null;
+ updatedAt?: string;
+ };
+ Relationships: [];
+ };
+ File: {
+ Row: {
+ createdAt: string;
+ description: string | null;
+ format: string;
+ isDeleted: boolean;
+ meta: string;
+ name: string;
+ size: number;
+ status: Database["public"]["Enums"]["UploadStatus"];
+ updatedAt: string;
+ uploaderProjectId: string | null;
+ };
+ Insert: {
+ createdAt?: string;
+ description?: string | null;
+ format: string;
+ isDeleted?: boolean;
+ meta?: string;
+ name: string;
+ size: number;
+ status?: Database["public"]["Enums"]["UploadStatus"];
+ updatedAt?: string;
+ uploaderProjectId?: string | null;
+ };
+ Update: {
+ createdAt?: string;
+ description?: string | null;
+ format?: string;
+ isDeleted?: boolean;
+ meta?: string;
+ name?: string;
+ size?: number;
+ status?: Database["public"]["Enums"]["UploadStatus"];
+ updatedAt?: string;
+ uploaderProjectId?: string | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "File_uploaderProjectId_fkey";
+ columns: ["uploaderProjectId"];
+ isOneToOne: false;
+ referencedRelation: "DashboardProject";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "File_uploaderProjectId_fkey";
+ columns: ["uploaderProjectId"];
+ isOneToOne: false;
+ referencedRelation: "Project";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ Product: {
+ Row: {
+ createdAt: string;
+ description: string | null;
+ features: string[] | null;
+ id: string;
+ images: string[] | null;
+ meta: Json;
+ name: string;
+ };
+ Insert: {
+ createdAt?: string;
+ description?: string | null;
+ features?: string[] | null;
+ id: string;
+ images?: string[] | null;
+ meta: Json;
+ name: string;
+ };
+ Update: {
+ createdAt?: string;
+ description?: string | null;
+ features?: string[] | null;
+ id?: string;
+ images?: string[] | null;
+ meta?: Json;
+ name?: string;
+ };
+ Relationships: [];
+ };
+ Project: {
+ Row: {
+ createdAt: string;
+ domain: string;
+ id: string;
+ isDeleted: boolean;
+ marketplaceApprovalStatus: Database["public"]["Enums"]["MarketplaceApprovalStatus"];
+ previewImageAssetId: string | null;
+ title: string;
+ userId: string | null;
+ };
+ Insert: {
+ createdAt?: string;
+ domain: string;
+ id: string;
+ isDeleted?: boolean;
+ marketplaceApprovalStatus?: Database["public"]["Enums"]["MarketplaceApprovalStatus"];
+ previewImageAssetId?: string | null;
+ title: string;
+ userId?: string | null;
+ };
+ Update: {
+ createdAt?: string;
+ domain?: string;
+ id?: string;
+ isDeleted?: boolean;
+ marketplaceApprovalStatus?: Database["public"]["Enums"]["MarketplaceApprovalStatus"];
+ previewImageAssetId?: string | null;
+ title?: string;
+ userId?: string | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "Project_previewImageAssetId_id_fkey";
+ columns: ["previewImageAssetId", "id"];
+ isOneToOne: false;
+ referencedRelation: "Asset";
+ referencedColumns: ["id", "projectId"];
+ },
+ {
+ foreignKeyName: "Project_userId_fkey";
+ columns: ["userId"];
+ isOneToOne: false;
+ referencedRelation: "User";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ ProjectDomain: {
+ Row: {
+ cname: string;
+ createdAt: string;
+ domainId: string;
+ projectId: string;
+ txtRecord: string;
+ };
+ Insert: {
+ cname: string;
+ createdAt?: string;
+ domainId: string;
+ projectId: string;
+ txtRecord: string;
+ };
+ Update: {
+ cname?: string;
+ createdAt?: string;
+ domainId?: string;
+ projectId?: string;
+ txtRecord?: string;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "ProjectDomain_domainId_fkey";
+ columns: ["domainId"];
+ isOneToOne: false;
+ referencedRelation: "Domain";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "ProjectDomain_domainId_fkey";
+ columns: ["domainId"];
+ isOneToOne: false;
+ referencedRelation: "LatestBuildPerProjectDomain";
+ referencedColumns: ["domainId"];
+ },
+ {
+ foreignKeyName: "ProjectDomain_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "DashboardProject";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "ProjectDomain_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "Project";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ Team: {
+ Row: {
+ id: string;
+ };
+ Insert: {
+ id: string;
+ };
+ Update: {
+ id?: string;
+ };
+ Relationships: [];
+ };
+ TransactionLog: {
+ Row: {
+ createdAt: string;
+ customerEmail: string | null;
+ customerId: string | null;
+ eventCreated: number | null;
+ eventData: Json | null;
+ eventId: string;
+ eventType: string | null;
+ paymentIntent: string | null;
+ productId: string | null;
+ status: string | null;
+ subscriptionId: string | null;
+ userId: string | null;
+ };
+ Insert: {
+ createdAt?: string;
+ customerEmail?: string | null;
+ customerId?: string | null;
+ eventCreated?: number | null;
+ eventData?: Json | null;
+ eventId: string;
+ eventType?: string | null;
+ paymentIntent?: string | null;
+ productId?: string | null;
+ status?: string | null;
+ subscriptionId?: string | null;
+ userId?: string | null;
+ };
+ Update: {
+ createdAt?: string;
+ customerEmail?: string | null;
+ customerId?: string | null;
+ eventCreated?: number | null;
+ eventData?: Json | null;
+ eventId?: string;
+ eventType?: string | null;
+ paymentIntent?: string | null;
+ productId?: string | null;
+ status?: string | null;
+ subscriptionId?: string | null;
+ userId?: string | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "TransactionLog_productId_fkey";
+ columns: ["productId"];
+ isOneToOne: false;
+ referencedRelation: "Product";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "TransactionLog_userId_fkey";
+ columns: ["userId"];
+ isOneToOne: false;
+ referencedRelation: "User";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ User: {
+ Row: {
+ createdAt: string;
+ email: string | null;
+ id: string;
+ image: string | null;
+ provider: string | null;
+ teamId: string | null;
+ username: string | null;
+ };
+ Insert: {
+ createdAt?: string;
+ email?: string | null;
+ id: string;
+ image?: string | null;
+ provider?: string | null;
+ teamId?: string | null;
+ username?: string | null;
+ };
+ Update: {
+ createdAt?: string;
+ email?: string | null;
+ id?: string;
+ image?: string | null;
+ provider?: string | null;
+ teamId?: string | null;
+ username?: string | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "User_teamId_fkey";
+ columns: ["teamId"];
+ isOneToOne: false;
+ referencedRelation: "Team";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ };
+ Views: {
+ ApprovedMarketplaceProduct: {
+ Row: {
+ authorizationToken: string | null;
+ marketplaceProduct: string | null;
+ projectId: string | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "Build_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "Project";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "Build_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "DashboardProject";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ DashboardProject: {
+ Row: {
+ createdAt: string | null;
+ domain: string | null;
+ id: string | null;
+ isDeleted: boolean | null;
+ isPublished: boolean | null;
+ marketplaceApprovalStatus:
+ | Database["public"]["Enums"]["MarketplaceApprovalStatus"]
+ | null;
+ previewImageAssetId: string | null;
+ title: string | null;
+ userId: string | null;
+ };
+ Insert: {
+ createdAt?: string | null;
+ domain?: string | null;
+ id?: string | null;
+ isDeleted?: boolean | null;
+ isPublished?: never;
+ marketplaceApprovalStatus?:
+ | Database["public"]["Enums"]["MarketplaceApprovalStatus"]
+ | null;
+ previewImageAssetId?: string | null;
+ title?: string | null;
+ userId?: string | null;
+ };
+ Update: {
+ createdAt?: string | null;
+ domain?: string | null;
+ id?: string | null;
+ isDeleted?: boolean | null;
+ isPublished?: never;
+ marketplaceApprovalStatus?:
+ | Database["public"]["Enums"]["MarketplaceApprovalStatus"]
+ | null;
+ previewImageAssetId?: string | null;
+ title?: string | null;
+ userId?: string | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "Project_previewImageAssetId_id_fkey";
+ columns: ["previewImageAssetId", "id"];
+ isOneToOne: false;
+ referencedRelation: "Asset";
+ referencedColumns: ["id", "projectId"];
+ },
+ {
+ foreignKeyName: "Project_userId_fkey";
+ columns: ["userId"];
+ isOneToOne: false;
+ referencedRelation: "User";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ LatestBuildPerProject: {
+ Row: {
+ buildId: string | null;
+ domain: string | null;
+ isLatestBuild: boolean | null;
+ projectId: string | null;
+ publishStatus: Database["public"]["Enums"]["PublishStatus"] | null;
+ updatedAt: string | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "Build_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "Project";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "Build_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "DashboardProject";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ LatestBuildPerProjectDomain: {
+ Row: {
+ buildId: string | null;
+ domainId: string | null;
+ isLatestBuild: boolean | null;
+ projectId: string | null;
+ publishStatus: Database["public"]["Enums"]["PublishStatus"] | null;
+ updatedAt: string | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "Build_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "Project";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "Build_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "DashboardProject";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ ProjectWithDomain: {
+ Row: {
+ cname: string | null;
+ createdAt: string | null;
+ domainId: string | null;
+ projectId: string | null;
+ txtRecord: string | null;
+ userId: string | null;
+ verified: boolean | null;
+ };
+ Relationships: [
+ {
+ foreignKeyName: "Project_userId_fkey";
+ columns: ["userId"];
+ isOneToOne: false;
+ referencedRelation: "User";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "ProjectDomain_domainId_fkey";
+ columns: ["domainId"];
+ isOneToOne: false;
+ referencedRelation: "Domain";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "ProjectDomain_domainId_fkey";
+ columns: ["domainId"];
+ isOneToOne: false;
+ referencedRelation: "LatestBuildPerProjectDomain";
+ referencedColumns: ["domainId"];
+ },
+ {
+ foreignKeyName: "ProjectDomain_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "Project";
+ referencedColumns: ["id"];
+ },
+ {
+ foreignKeyName: "ProjectDomain_projectId_fkey";
+ columns: ["projectId"];
+ isOneToOne: false;
+ referencedRelation: "DashboardProject";
+ referencedColumns: ["id"];
+ },
+ ];
+ };
+ UserProduct: {
+ Row: {
+ customerEmail: string | null;
+ customerId: string | null;
+ productId: string | null;
+ subscriptionId: string | null;
+ userId: string | null;
+ };
+ Relationships: [];
+ };
+ };
+ Functions: {
+ patch_map: {
+ Args: {
+ data_str: string;
+ input_type: string;
+ patches_str: string;
+ };
+ Returns: string;
+ };
+ };
+ Enums: {
+ AuthorizationRelation:
+ | "viewers"
+ | "editors"
+ | "builders"
+ | "administrators";
+ DomainStatus: "INITIALIZING" | "ACTIVE" | "ERROR" | "PENDING";
+ MarketplaceApprovalStatus:
+ | "UNLISTED"
+ | "PENDING"
+ | "APPROVED"
+ | "REJECTED";
+ PublishStatus: "PENDING" | "PUBLISHED" | "FAILED";
+ UploadStatus: "UPLOADING" | "UPLOADED";
+ };
+ CompositeTypes: {
+ [_ in never]: never;
+ };
+ };
+};
+
+type PublicSchema = Database[Extract<keyof Database, "public">];
+
+export type Tables<
+ PublicTableNameOrOptions extends
+ | keyof (PublicSchema["Tables"] & PublicSchema["Views"])
+ | { schema: keyof Database },
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
+ ? keyof (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
+ Database[PublicTableNameOrOptions["schema"]]["Views"])
+ : never = never,
+> = PublicTableNameOrOptions extends { schema: keyof Database }
+ ? (Database[PublicTableNameOrOptions["schema"]]["Tables"] &
+ Database[PublicTableNameOrOptions["schema"]]["Views"])[TableName] extends {
+ Row: infer R;
+ }
+ ? R
+ : never
+ : PublicTableNameOrOptions extends keyof (PublicSchema["Tables"] &
+ PublicSchema["Views"])
+ ? (PublicSchema["Tables"] &
+ PublicSchema["Views"])[PublicTableNameOrOptions] extends {
+ Row: infer R;
+ }
+ ? R
+ : never
+ : never;
+
+export type TablesInsert<
+ PublicTableNameOrOptions extends
+ | keyof PublicSchema["Tables"]
+ | { schema: keyof Database },
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
+ : never = never,
+> = PublicTableNameOrOptions extends { schema: keyof Database }
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
+ Insert: infer I;
+ }
+ ? I
+ : never
+ : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
+ ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
+ Insert: infer I;
+ }
+ ? I
+ : never
+ : never;
+
+export type TablesUpdate<
+ PublicTableNameOrOptions extends
+ | keyof PublicSchema["Tables"]
+ | { schema: keyof Database },
+ TableName extends PublicTableNameOrOptions extends { schema: keyof Database }
+ ? keyof Database[PublicTableNameOrOptions["schema"]]["Tables"]
+ : never = never,
+> = PublicTableNameOrOptions extends { schema: keyof Database }
+ ? Database[PublicTableNameOrOptions["schema"]]["Tables"][TableName] extends {
+ Update: infer U;
+ }
+ ? U
+ : never
+ : PublicTableNameOrOptions extends keyof PublicSchema["Tables"]
+ ? PublicSchema["Tables"][PublicTableNameOrOptions] extends {
+ Update: infer U;
+ }
+ ? U
+ : never
+ : never;
+
+export type Enums<
+ PublicEnumNameOrOptions extends
+ | keyof PublicSchema["Enums"]
+ | { schema: keyof Database },
+ EnumName extends PublicEnumNameOrOptions extends { schema: keyof Database }
+ ? keyof Database[PublicEnumNameOrOptions["schema"]]["Enums"]
+ : never = never,
+> = PublicEnumNameOrOptions extends { schema: keyof Database }
+ ? Database[PublicEnumNameOrOptions["schema"]]["Enums"][EnumName]
+ : PublicEnumNameOrOptions extends keyof PublicSchema["Enums"]
+ ? PublicSchema["Enums"][PublicEnumNameOrOptions]
+ : never;
diff --git a/packages/postgrest/src/index.server.ts b/packages/postgrest/src/index.server.ts
new file mode 100644
index 0000000000..476d79c1f3
--- /dev/null
+++ b/packages/postgrest/src/index.server.ts
@@ -0,0 +1,16 @@
+import type { Database } from "./__generated__/db-types";
+import { PostgrestClient } from "@supabase/postgrest-js";
+export type { Database } from "./__generated__/db-types";
+
+export type Client = PostgrestClient<Database>;
+
+export const createClient = (url: string, apiKey: string): Client => {
+ const client = new PostgrestClient<Database>(url, {
+ headers: {
+ apikey: apiKey,
+ Authorization: `Bearer ${apiKey}`,
+ },
+ });
+
+ return client;
+};
diff --git a/packages/postgrest/tsconfig.json b/packages/postgrest/tsconfig.json
new file mode 100644
index 0000000000..d2e5040f8f
--- /dev/null
+++ b/packages/postgrest/tsconfig.json
@@ -0,0 +1,3 @@
+{
+ "extends": "@webstudio-is/tsconfig/base.json"
+}
diff --git a/packages/project-build/package.json b/packages/project-build/package.json
index 5299635faa..3ba4feb8cf 100644
--- a/packages/project-build/package.json
+++ b/packages/project-build/package.json
@@ -24,6 +24,7 @@
"@webstudio-is/prisma-client": "workspace:*",
"@webstudio-is/sdk": "workspace:*",
"@webstudio-is/trpc-interface": "workspace:*",
+ "@webstudio-is/postrest": "workspace:*",
"nanoid": "^5.0.1",
"zod": "^3.22.4"
},
diff --git a/packages/project-build/src/db/build.ts b/packages/project-build/src/db/build.ts
index 4ebcbeeadf..7fd9425aea 100644
--- a/packages/project-build/src/db/build.ts
+++ b/packages/project-build/src/db/build.ts
@@ -1,12 +1,7 @@
/* eslint no-console: ["error", { allow: ["time", "timeEnd"] }] */
import { nanoid } from "nanoid";
-import {
- type Build as DbBuild,
- type $Enums,
- prisma,
- Prisma,
-} from "@webstudio-is/prisma-client";
+import { prisma, Prisma } from "@webstudio-is/prisma-client";
import {
AuthorizationError,
authorizeProject,
@@ -32,6 +27,7 @@ import { parsePages, serializePages } from "./pages";
import { createDefaultPages } from "../shared/pages-utils";
import type { MarketplaceProduct } from "..";
import { z } from "zod";
+import type { Database } from "@webstudio-is/postrest/index.server";
export const parseData = <Type extends { id: string }>(
string: string
@@ -55,7 +51,9 @@ export const serializeConfig = <Type>(data: Type) => {
return JSON.stringify(data);
};
-const parseBuild = async (build: DbBuild): Promise<Build> => {
+const parseBuild = async (
+ build: Database["public"]["Tables"]["Build"]["Row"]
+): Promise<Build> => {
console.time("parseBuild");
try {
const pages = parsePages(build.pages);
@@ -69,8 +67,8 @@ const parseBuild = async (build: DbBuild): Promise<Build> => {
id: build.id,
projectId: build.projectId,
version: build.version,
- createdAt: build.createdAt.toISOString(),
- updatedAt: build.updatedAt.toISOString(),
+ createdAt: build.createdAt,
+ updatedAt: build.updatedAt,
pages,
breakpoints: Array.from(parseData<Breakpoint>(build.breakpoints)),
styles,
@@ -91,61 +89,74 @@ const parseBuild = async (build: DbBuild): Promise<Build> => {
}
};
-export const loadBuildById = async (
+export const loadRawBuildById = async (
+ context: AppContext,
id: Build["id"]
-): Promise<Build | undefined> => {
- const build = await prisma.build.findUnique({
- where: { id },
- });
-
- if (build === null) {
- return;
+) => {
+ const build = await context.postgrest.client
+ .from("Build")
+ .select("*")
+ .eq("id", id)
+ .single();
+
+ if (build.error) {
+ throw build.error;
}
+ return build.data;
+};
+
+export const loadBuildById = async (
+ context: AppContext,
+ id: Build["id"]
+): Promise<Build> => {
+ const build = await loadRawBuildById(context, id);
+
return parseBuild(build);
};
export const loadBuildIdAndVersionByProjectId = async (
+ context: AppContext,
projectId: Build["projectId"]
): Promise<{ id: string; version: number }> => {
- const build = await prisma.build.findFirst({
- select: {
- id: true,
- version: true,
- },
- where: { projectId, deployment: null },
- });
-
- if (build === null) {
- throw new Error("Dev build not found");
+ const build = await context.postgrest.client
+ .from("Build")
+ .select("id,version")
+ .eq("projectId", projectId)
+ .is("deployment", null)
+ .single();
+
+ if (build.error) {
+ throw build.error;
}
- return build;
+ return build.data;
};
export const loadBuildByProjectId = async (
+ context: AppContext,
projectId: Build["projectId"]
): Promise<Build> => {
- const build = await prisma.build.findFirst({
- where: { projectId, deployment: null },
- });
-
- if (build === null) {
- throw new Error("Dev build not found");
+ const build = await context.postgrest.client
+ .from("Build")
+ .select("*")
+ .eq("projectId", projectId)
+ .is("deployment", null)
+ .single();
+
+ if (build.error) {
+ throw build.error;
}
- return parseBuild(build);
+ return parseBuild(build.data);
};
-export const loadProdBuildByProjectId = async (
- projectId: Build["projectId"],
- where: {
- marketplaceApprovalStatus?: $Enums.MarketplaceApprovalStatus;
- }
+export const loadApprovedProdBuildByProjectId = async (
+ projectId: Build["projectId"]
): Promise<Build> => {
const projectData = await prisma.project.findUnique({
where: {
- ...where,
+ marketplaceApprovalStatus: "APPROVED",
id_isDeleted: { id: projectId, isDeleted: false },
},
select: {
@@ -162,7 +173,11 @@ export const loadProdBuildByProjectId = async (
throw new Error("Prod build not found");
}
- return parseBuild(build);
+ return parseBuild({
+ ...build,
+ createdAt: build.createdAt.toISOString(),
+ updatedAt: build.updatedAt.toISOString(),
+ });
};
const createNewPageInstances = (): Build["instances"] => {
diff --git a/packages/trpc-interface/package.json b/packages/trpc-interface/package.json
index 47b2186068..72ff5281c1 100644
--- a/packages/trpc-interface/package.json
+++ b/packages/trpc-interface/package.json
@@ -22,6 +22,7 @@
"@types/node": "^20.12.7",
"@webstudio-is/jest-config": "workspace:*",
"@webstudio-is/tsconfig": "workspace:*",
+ "@webstudio-is/postrest": "workspace:*",
"typescript": "5.5.2"
},
"exports": {
diff --git a/packages/trpc-interface/src/context/context.server.ts b/packages/trpc-interface/src/context/context.server.ts
index 3f46ddd665..7e45e8d97e 100644
--- a/packages/trpc-interface/src/context/context.server.ts
+++ b/packages/trpc-interface/src/context/context.server.ts
@@ -1,4 +1,5 @@
import type { TrpcInterfaceClient } from "../shared/shared-router";
+import type { Client } from "@webstudio-is/postrest/index.server";
/**
* All necessary parameters for Authorization
@@ -68,6 +69,10 @@ type TrpcCache = {
getMaxAge: (path: string) => number | undefined;
};
+type PostgrestContext = {
+ client: Client;
+};
+
/**
* AppContext is a global context that is passed to all trpc/api queries/mutations
* "authorization" is made inside the namespace because eventually there will be
@@ -80,4 +85,5 @@ export type AppContext = {
entri: EntriContext;
userPlanFeatures: UserPlanFeatures | undefined;
trpcCache: TrpcCache;
+ postgrest: PostgrestContext;
};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index cb85ee9fef..67e3bd472e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -241,6 +241,9 @@ importers:
'@webstudio-is/image':
specifier: workspace:*
version: link:../../packages/image
+ '@webstudio-is/postrest':
+ specifier: workspace:*
+ version: link:../../packages/postgrest
'@webstudio-is/prisma-client':
specifier: workspace:*
version: link:../../packages/prisma-client
@@ -1572,6 +1575,22 @@ importers:
specifier: 5.5.2
version: 5.5.2
+ packages/postgrest:
+ dependencies:
+ '@supabase/postgrest-js':
+ specifier: ^1.15.8
+ version: 1.15.8
+ devDependencies:
+ '@webstudio-is/tsconfig':
+ specifier: workspace:*
+ version: link:../tsconfig
+ type-fest:
+ specifier: ^4.3.1
+ version: 4.3.1
+ typescript:
+ specifier: 5.5.2
+ version: 5.5.2
+
packages/prisma-client:
dependencies:
execa:
@@ -1639,6 +1658,9 @@ importers:
packages/project-build:
dependencies:
+ '@webstudio-is/postrest':
+ specifier: workspace:*
+ version: link:../postgrest
'@webstudio-is/prisma-client':
specifier: workspace:*
version: link:../prisma-client
@@ -2004,6 +2026,9 @@ importers:
'@webstudio-is/jest-config':
specifier: workspace:*
version: link:../jest-config
+ '@webstudio-is/postrest':
+ specifier: workspace:*
+ version: link:../postgrest
'@webstudio-is/tsconfig':
specifier: workspace:*
version: link:../tsconfig
@@ -4970,6 +4995,13 @@ packages:
peerDependencies:
storybook: ^8.2.4
+ '@supabase/[email protected]':
+ resolution: {integrity: sha512-1ibVeYUacxWYi9i0cf5efil6adJ9WRyZBLivgjs+AUpewx1F3xPi7gLgaASI2SmIQxPoCEjAsLAzKPgMJVgOUQ==}
+ engines: {node: 4.x || >=6.0.0}
+
+ '@supabase/[email protected]':
+ resolution: {integrity: sha512-YunjXpoQjQ0a0/7vGAvGZA2dlMABXFdVI/8TuVKtlePxyT71sl6ERl6ay1fmIeZcqxiuFQuZw/LXUuStUG9bbg==}
+
resolution: {integrity: sha512-0e4B41q+GnS8TI+SWHQw78ziW6V07Li2TMLS8FwbvKOTIJL0ua1Sat1AI0AFAjHlAePz9b+1VtyJzv1516edJw==}
hasBin: true
@@ -13094,6 +13126,14 @@ snapshots:
dependencies:
storybook: 8.2.4(@babel/[email protected](@babel/[email protected]))
+ '@supabase/[email protected]':
+ dependencies:
+ whatwg-url: 5.0.0
+
+ '@supabase/[email protected]':
+ dependencies:
+ '@supabase/node-fetch': 2.6.15
+
dependencies:
css-tree: 2.3.1(patch_hash=epgcmebti7rfrc2ej4odb3t4jy)