Skip to content

Commit 6c66b05

Browse files
authored
ENG-1688 Monthly upgrades of supabase, vercel, posthog for May 2026 (#998)
1 parent a301ba7 commit 6c66b05

12 files changed

Lines changed: 767 additions & 552 deletions

File tree

.github/workflows/test-database.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup node
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: "20"
24+
node-version: "22"
2525
cache: "pnpm"
2626
- name: Install Dependencies
2727
run: pnpm install --frozen-lockfile

apps/website/app/api/supabase/content-embedding/batch/route.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import {
1313
KNOWN_EMBEDDING_TABLES,
1414
} from "~/utils/supabase/dbUtils";
1515
import {
16-
ApiInputEmbeddingItem,
17-
ApiOutputEmbeddingRecord,
16+
type ApiInputEmbeddingItem,
17+
type ApiOutputEmbeddingRecord,
1818
embeddingInputProcessing,
1919
embeddingOutputProcessing,
2020
} from "~/utils/supabase/validators";
@@ -35,7 +35,7 @@ const batchInsertEmbeddingsProcess = async (
3535
if (acc[model] === undefined) {
3636
acc[model] = [];
3737
}
38-
acc[model]!.push(item);
38+
acc[model].push(item);
3939
return acc;
4040
}, byModel);
4141
} catch (error) {
@@ -81,6 +81,7 @@ const batchInsertEmbeddingsProcess = async (
8181
return {
8282
data: globalResults,
8383
error: null,
84+
success: true,
8485
status: has_400 ? 400 : 500,
8586
count,
8687
statusText: partialErrors.join("; "),
@@ -89,6 +90,7 @@ const batchInsertEmbeddingsProcess = async (
8990
return {
9091
data: globalResults,
9192
error: null,
93+
success: true,
9294
status: created ? 201 : 200,
9395
count,
9496
statusText: created ? "created" : "success",

apps/website/app/api/supabase/content-embedding/route.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,11 @@ const processAndCreateEmbedding = async (
4141
const { tableName } = tableData;
4242
// Using getOrCreateEntity, forcing create path by providing non-matching criteria
4343
// This standardizes return type and error handling (e.g., FK violations from dbUtils)
44-
const result =
45-
await getOrCreateEntity<"ContentEmbedding_openai_text_embedding_3_small_1536">(
46-
{
47-
supabase,
48-
tableName,
49-
insertData: processedItem,
50-
},
51-
);
44+
const result = await getOrCreateEntity({
45+
supabase,
46+
tableName,
47+
insertData: processedItem,
48+
});
5249

5350
if (result.error) {
5451
return result;

apps/website/app/api/supabase/document/route.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ type DocumentRecord = Tables<"Document">;
1717
const validateDocument: ItemValidator<DocumentDataInput> = (data) => {
1818
if (!data || typeof data !== "object")
1919
return "Invalid request body: expected a JSON object.";
20+
// eslint-disable-next-line @typescript-eslint/naming-convention
2021
const { space_id, author_id, source_local_id } = data;
2122

2223
if (!author_id) return "Missing required author_id field.";

apps/website/app/api/supabase/platform-account/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
} from "~/utils/supabase/apiUtils";
1111
import { type TablesInsert, Constants } from "@repo/database/dbTypes";
1212

13+
// eslint-disable-next-line @typescript-eslint/naming-convention
1314
const { AgentType, Platform } = Constants.public.Enums;
1415

1516
type PlatformAccountDataInput = TablesInsert<"PlatformAccount">;
@@ -19,6 +20,7 @@ const accountValidator: ItemValidator<PlatformAccountDataInput> = (
1920
) => {
2021
if (!account || typeof account !== "object")
2122
return "Invalid request body: expected a JSON object.";
23+
/* eslint-disable @typescript-eslint/naming-convention */
2224
const {
2325
name,
2426
platform,
@@ -29,6 +31,7 @@ const accountValidator: ItemValidator<PlatformAccountDataInput> = (
2931
metadata,
3032
dg_account,
3133
} = account;
34+
/* eslint-enable @typescript-eslint/naming-convention */
3235

3336
if (!name || typeof name !== "string" || name.trim() === "")
3437
return "Missing or invalid name";

0 commit comments

Comments
 (0)