Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/security-deps-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@inngest/workflow-kit": patch
---

Address security vulnerabilities in transitive dependencies. No runtime API changes; updates dev/build dependency versions and adds pnpm overrides for transitive packages with known advisories (vite, esbuild, cookie, path-to-regexp, qs, cross-spawn, tmp, minimatch, brace-expansion, picomatch, postcss, ws, @babel/runtime, @babel/helpers, next, uuid). Bumps `inngest` devDep to ^3.54.2 (fixes GHSA env-var disclosure), `@storybook/*` addons to ^8.6.18, `typescript` to ^5.9.3, and `@changesets/cli` to ^2.31.0.
3 changes: 0 additions & 3 deletions examples/nextjs-blog-cms/.eslintrc.json

This file was deleted.

8 changes: 4 additions & 4 deletions examples/nextjs-blog-cms/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { createClient } from "@/lib/supabase/server";
import { type Workflow } from "@/lib/supabase/types";

export const sendBlogPostToReview = async (id: string) => {
const supabase = createClient();
const supabase = await createClient();
await supabase
.from("blog_posts")
.update({
Expand All @@ -32,7 +32,7 @@ export const approveBlogPostAiSuggestions = async (id: string) => {
};

export const publishBlogPost = async (id: string) => {
const supabase = createClient();
const supabase = await createClient();
await supabase
.from("blog_posts")
.update({
Expand All @@ -49,7 +49,7 @@ export const publishBlogPost = async (id: string) => {
});
};
export const updateWorkflow = async (workflow: Workflow) => {
const supabase = createClient();
const supabase = await createClient();
await supabase
.from("workflows")
.update({
Expand All @@ -59,7 +59,7 @@ export const updateWorkflow = async (workflow: Workflow) => {
};

export const toggleWorkflow = async (workflowId: number, enabled: boolean) => {
const supabase = createClient();
const supabase = await createClient();
await supabase
.from("workflows")
.update({
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-blog-cms/app/api/blog-posts/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createClient } from "@/lib/supabase/server";
import { NextResponse } from "next/server";

export async function GET() {
const supabase = createClient();
const supabase = await createClient();
const { data: blogPosts } = await supabase
.from("blog_posts")
.select(
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-blog-cms/app/api/workflows/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createClient } from "@/lib/supabase/server";
import { NextResponse } from "next/server";

export async function GET() {
const supabase = createClient();
const supabase = await createClient();
const { data: workflows } = await supabase
.from("workflows")
.select("*")
Expand Down
7 changes: 4 additions & 3 deletions examples/nextjs-blog-cms/app/automation/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ export const runtime = "edge";
export default async function Automation({
params,
}: {
params: { id: string };
params: Promise<{ id: string }>;
}) {
const supabase = createClient();
const { id } = await params;
const supabase = await createClient();
const { data: workflow } = await supabase
.from("workflows")
.select("*")
.eq("id", params.id!)
.eq("id", id!)
.single();
if (workflow) {
return <AutomationEditor workflow={workflow} />;
Expand Down
9 changes: 7 additions & 2 deletions examples/nextjs-blog-cms/app/blog-post/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,13 @@ import { mdxComponents } from "@/lib/mdxComponents";

export const revalidate = 0;

export default async function BlogPost({ params }: { params: { id: string } }) {
const blogPost = await loadBlogPost(params.id);
export default async function BlogPost({
params,
}: {
params: Promise<{ id: string }>;
}) {
const { id } = await params;
const blogPost = await loadBlogPost(id);

if (blogPost) {
const { default: MDXBlogPostContent } = await evaluate(
Expand Down
14 changes: 14 additions & 0 deletions examples/nextjs-blog-cms/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import nextPlugin from "eslint-config-next";
import nextTypescript from "eslint-config-next/typescript";
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";

const config = [
...(Array.isArray(nextPlugin) ? nextPlugin : [nextPlugin]),
...(Array.isArray(nextCoreWebVitals) ? nextCoreWebVitals : [nextCoreWebVitals]),
...(Array.isArray(nextTypescript) ? nextTypescript : [nextTypescript]),
{
ignores: [".next/**", "node_modules/**", "supabase/**"],
},
];

export default config;
12 changes: 6 additions & 6 deletions examples/nextjs-blog-cms/lib/inngest/workflowActionHandlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const actionsWithHandlers: EngineAction<typeof inngest>[] = [
// Add a Table of Contents
...actions[0],
handler: async ({ event, step, workflowAction }) => {
const supabase = createClient();
const supabase = await createClient();

const blogPost = await step.run("load-blog-post", async () =>
loadBlogPost(event.data.id)
Expand Down Expand Up @@ -86,7 +86,7 @@ export const actionsWithHandlers: EngineAction<typeof inngest>[] = [
// Perform a grammar review
...actions[1],
handler: async ({ event, step, workflowAction }) => {
const supabase = createClient();
const supabase = await createClient();

const blogPost = await step.run("load-blog-post", async () =>
loadBlogPost(event.data.id)
Expand Down Expand Up @@ -139,7 +139,7 @@ export const actionsWithHandlers: EngineAction<typeof inngest>[] = [
// Apply changes after approval
...actions[2],
handler: async ({ event, step }) => {
const supabase = createClient();
const supabase = await createClient();

const blogPost = await step.run("load-blog-post", async () =>
loadBlogPost(event.data.id)
Expand Down Expand Up @@ -196,7 +196,7 @@ export const actionsWithHandlers: EngineAction<typeof inngest>[] = [
// Apply changes
...actions[3],
handler: async ({ event, step }) => {
const supabase = createClient();
const supabase = await createClient();

const blogPost = await step.run("load-blog-post", async () =>
loadBlogPost(event.data.id)
Expand All @@ -219,7 +219,7 @@ export const actionsWithHandlers: EngineAction<typeof inngest>[] = [
// Generate LinkedIn posts
...actions[4],
handler: async ({ event, step, workflowAction }) => {
const supabase = createClient();
const supabase = await createClient();

const blogPost = await step.run("load-blog-post", async () =>
loadBlogPost(event.data.id)
Expand Down Expand Up @@ -279,7 +279,7 @@ export const actionsWithHandlers: EngineAction<typeof inngest>[] = [
// Generate Twitter posts
...actions[5],
handler: async ({ event, step, workflowAction }) => {
const supabase = createClient();
const supabase = await createClient();
const numberOfTweets = 2;

const blogPost = await step.run("load-blog-post", async () =>
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-blog-cms/lib/loaders/blog-post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { createClient } from "../supabase/server";
import { BlogPost } from "../supabase/types";

export async function loadBlogPost(id: string): Promise<BlogPost> {
const supabase = createClient();
const supabase = await createClient();
const { data: blogPosts } = await supabase
.from("blog_posts")
.select(
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs-blog-cms/lib/loaders/workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Workflow } from "@inngest/workflow-kit";
import { createClient } from "../supabase/server";

export async function loadWorkflow(event: { name: string }) {
const supabase = createClient();
const supabase = await createClient();
const { data } = await supabase
.from("workflows")
.select("*", {})
Expand Down
4 changes: 2 additions & 2 deletions examples/nextjs-blog-cms/lib/supabase/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { createServerClient } from "@supabase/ssr";
import { cookies } from "next/headers";
import { Database } from "./types";

export function createClient() {
const cookieStore = cookies();
export async function createClient() {
const cookieStore = await cookies();

return createServerClient<Database>(
process.env.NEXT_PUBLIC_SUPABASE_URL!,
Expand Down
23 changes: 16 additions & 7 deletions examples/nextjs-blog-cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "eslint . --ext .ts,.tsx,.js,.jsx"
},
"dependencies": {
"@inngest/workflow-kit": "0.1.3-alpha-20240930224141-9a7240323ec48bf95e5725173ab63ae424d76e6b",
Expand All @@ -19,12 +19,13 @@
"@radix-ui/react-switch": "^1.1.0",
"@radix-ui/react-tabs": "^1.1.0",
"@supabase/ssr": "^0.5.1",
"@supabase/supabase-js": "^2.45.4",
"@supabase/supabase-js": "~2.45.4",
"@xyflow/react": "^12.1.1",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"inngest": "^3.19.14",
"lucide-react": "^0.441.0",
"next": "16.1.5",
"next": "^16.2.6",
"next-mdx-remote": "^6.0.0",
"openai": "^4.61.0",
"react": "^18",
Expand All @@ -33,16 +34,24 @@
"remark-html": "^16.0.1",
"swr": "^2.2.5",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7"
"tailwindcss-animate": "^1.0.7",
"zod": "^3.25.76"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"eslint": "^8",
"eslint-config-next": "16.1.5",
"postcss": "^8",
"eslint": "^9",
"eslint-config-next": "^16.2.6",
"postcss": "^8.5.10",
"tailwindcss": "^3.4.1",
"typescript": "^5"
},
"pnpm": {
"overrides": {
"postcss@<8.5.10": "^8.5.10",
"underscore@<1.13.8": "^1.13.8",
"@supabase/auth-js@<2.70.0": "^2.70.0"
}
}
}
Loading
Loading