Skip to content

Commit 9a5305e

Browse files
committed
fix: rename postrest package to postgrest and enable publishing
1 parent 5318d4f commit 9a5305e

17 files changed

Lines changed: 26 additions & 26 deletions

File tree

apps/builder/app/routes/rest.patch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import {
4444
} from "@webstudio-is/trpc-interface/index.server";
4545
import { createContext } from "~/shared/context.server";
4646
import * as projectApi from "@webstudio-is/project/index.server";
47-
import type { Database } from "@webstudio-is/postrest/index.server";
47+
import type { Database } from "@webstudio-is/postgrest/index.server";
4848
import { publicStaticEnv } from "~/env/env.static";
4949
import { preventCrossOriginCookie } from "~/services/no-cross-origin-cookie";
5050
import { checkCsrf } from "~/services/csrf-session.server";

apps/builder/app/services/builder-access.server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { authorizeProject } from "@webstudio-is/trpc-interface/index.server";
2-
import { createPostrestContext } from "~/shared/context.server";
2+
import { createPostgrestContext } from "~/shared/context.server";
33

44
/**
55
* Check if a user is authorized to access a project during the Builder authentication process.
@@ -8,7 +8,7 @@ export const isUserAuthorizedForProject = async (
88
userId: string,
99
projectId: string
1010
) => {
11-
const postgrestContext = createPostrestContext();
11+
const postgrestContext = createPostgrestContext();
1212

1313
// Only the project owner can access the Builder URL with authentication credentials (session).
1414
const isProjectOwner = await authorizeProject.checkProjectPermit(

apps/builder/app/shared/context.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { entryApi } from "./entri/entri-api.server";
66

77
import { getUserPlanFeatures } from "./db/user-plan-features.server";
88
import { staticEnv } from "~/env/env.static.server";
9-
import { createClient } from "@webstudio-is/postrest/index.server";
9+
import { createClient } from "@webstudio-is/postgrest/index.server";
1010
import { builderAuthenticator } from "~/services/builder-auth.server";
1111
import { readLoginSessionBloomFilter } from "~/services/session.server";
1212
import type { BloomFilter } from "~/services/bloom-filter.server";
@@ -184,15 +184,15 @@ const createTrpcCache = () => {
184184
};
185185
};
186186

187-
export const createPostrestContext = () => {
187+
export const createPostgrestContext = () => {
188188
return { client: createClient(env.POSTGREST_URL, env.POSTGREST_API_KEY) };
189189
};
190190

191191
/**
192192
* argument buildEnv==="prod" only if we are loading project with production build
193193
*/
194194
export const createContext = async (request: Request): Promise<AppContext> => {
195-
const postgrest = createPostrestContext();
195+
const postgrest = createPostgrestContext();
196196
const authorization = await createAuthorizationContext(request, postgrest);
197197

198198
const domain = createDomainContext();

apps/builder/app/shared/db/user.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Database } from "@webstudio-is/postrest/index.server";
1+
import type { Database } from "@webstudio-is/postgrest/index.server";
22
import {
33
AuthorizationError,
44
type AppContext,

apps/builder/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"@webstudio-is/http-client": "workspace:*",
7474
"@webstudio-is/icons": "workspace:*",
7575
"@webstudio-is/image": "workspace:*",
76-
"@webstudio-is/postrest": "workspace:*",
76+
"@webstudio-is/postgrest": "workspace:*",
7777
"@webstudio-is/project": "workspace:*",
7878
"@webstudio-is/project-build": "workspace:*",
7979
"@webstudio-is/react-sdk": "workspace:*",

packages/authorization-token/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"typecheck": "tsgo --noEmit"
1010
},
1111
"dependencies": {
12-
"@webstudio-is/postrest": "workspace:*",
12+
"@webstudio-is/postgrest": "workspace:*",
1313
"@webstudio-is/trpc-interface": "workspace:*",
1414
"zod": "^3.24.2"
1515
},

packages/authorization-token/src/db/authorization-token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Database } from "@webstudio-is/postrest/index.server";
1+
import type { Database } from "@webstudio-is/postgrest/index.server";
22
import {
33
type AppContext,
44
authorizeProject,

packages/authorization-token/src/trpc/authorization-tokens-router.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { z } from "zod";
22
import { router, procedure } from "@webstudio-is/trpc-interface/index.server";
33
import { db } from "../db";
44
import type { IsEqual } from "type-fest";
5-
import type { Database } from "@webstudio-is/postrest/index.server";
5+
import type { Database } from "@webstudio-is/postgrest/index.server";
66

77
type Relation =
88
Database["public"]["Tables"]["AuthorizationToken"]["Row"]["relation"];

packages/domain/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"typecheck": "tsgo --noEmit"
1010
},
1111
"dependencies": {
12-
"@webstudio-is/postrest": "workspace:*",
12+
"@webstudio-is/postgrest": "workspace:*",
1313
"@webstudio-is/project": "workspace:*",
1414
"@webstudio-is/project-build": "workspace:*",
1515
"@webstudio-is/sdk": "workspace:*",

packages/domain/src/db/domain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as projectApi from "@webstudio-is/project/index.server";
88
import { validateDomain } from "./validate";
99
import { cnameFromUserId } from "./cname-from-user-id";
1010
import type { Project } from "@webstudio-is/project";
11-
import type { Database } from "@webstudio-is/postrest/index.server";
11+
import type { Database } from "@webstudio-is/postgrest/index.server";
1212

1313
type Result = { success: false; error: string } | { success: true };
1414

0 commit comments

Comments
 (0)