(()=>{var e={};e.id=1286,e.ids=[1286],e.modules={3295:e=>{"use strict";e.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},10846:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},12909:(e,r,t)=>{"use strict";function s(){let e=process.env.JWT_SECRET;if(!e)throw Error("JWT_SECRET is not set");return e}function o(e){let r=e.headers.get("authorization");if(r&&r.startsWith("Bearer "))return r.slice(7);let t=e.cookies.get("admin_token")?.value;if(t)return t;let s=e.cookies.get("token")?.value;return s||null}t.d(r,{V:()=>o,u:()=>s})},27910:e=>{"use strict";e.exports=require("stream")},28354:e=>{"use strict";e.exports=require("util")},29294:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-async-storage.external.js")},43018:(e,r,t)=>{"use strict";t.r(r),t.d(r,{patchFetch:()=>v,routeModule:()=>h,serverHooks:()=>y,workAsyncStorage:()=>m,workUnitAsyncStorage:()=>k});var s={};t.r(s),t.d(s,{GET:()=>f});var o=t(96559),n=t(48088),u=t(37719),i=t(32190),a=t(43205),c=t.n(a),p=t(96330),d=t(12909);let l=new p.PrismaClient,x=(0,d.u)();async function f(e){try{let r,t=(0,d.V)(e);if(!t)return i.NextResponse.json({error:"Authorization token gerekli"},{status:401});try{r=c().verify(t,x)}catch(e){return i.NextResponse.json({error:"Ge\xe7ersiz token"},{status:401})}let s=await l.user.findUnique({where:{id:r.userId},include:{company:{include:{products:!0}}}});if(!s)return i.NextResponse.json({error:"Kullanıcı bulunamadı"},{status:404});let o=s.company.products.map(e=>({id:e.id,title:e.title,brand:e.brand,category:e.category,stockCode:e.stockCode,isbn:e.isbn,cost:e.cost,quantity:e.quantity,desi:e.desi,psf:e.psf}));return i.NextResponse.json({products:o})}catch(e){return console.error("Products fetch error:",e),i.NextResponse.json({error:"Sunucu hatası"},{status:500})}}let h=new o.AppRouteRouteModule({definition:{kind:n.RouteKind.APP_ROUTE,page:"/api/products/all/route",pathname:"/api/products/all",filename:"route",bundlePath:"app/api/products/all/route"},resolvedPagePath:"/Users/mustafaseyhan/Project/PazarAnalist/src/app/api/products/all/route.ts",nextConfigOutput:"standalone",userland:s}),{workAsyncStorage:m,workUnitAsyncStorage:k,serverHooks:y}=h;function v(){return(0,u.patchFetch)({workAsyncStorage:m,workUnitAsyncStorage:k})}},44870:e=>{"use strict";e.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},55511:e=>{"use strict";e.exports=require("crypto")},63033:e=>{"use strict";e.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},78335:()=>{},79428:e=>{"use strict";e.exports=require("buffer")},96330:e=>{"use strict";e.exports=require("@prisma/client")},96487:()=>{}};var r=require("../../../../webpack-runtime.js");r.C(e);var t=e=>r(r.s=e),s=r.X(0,[4447,580,3205],()=>t(43018));module.exports=s})();