Buckets:
| (()=>{var a={};a.id=9670,a.ids=[9670],a.modules={261:a=>{"use strict";a.exports=require("next/dist/shared/lib/router/utils/app-paths")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},6452:(a,b,c)=>{"use strict";c.d(b,{Os:()=>j,_1:()=>f,b4:()=>h,eA:()=>g,iP:()=>i});var d=c(33873),e=c.n(d);let f=e().resolve("@","..",".."),g=e().join(f,"output"),h=e().join(f,"datasets"),i=e().join(f,"data"),j=e().join(f,"models")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},32948:(a,b,c)=>{"use strict";c.r(b),c.d(b,{handler:()=>M,patchFetch:()=>L,routeModule:()=>H,serverHooks:()=>K,workAsyncStorage:()=>I,workUnitAsyncStorage:()=>J});var d={};c.r(d),c.d(d,{POST:()=>F});var e=c(95736),f=c(9117),g=c(4044),h=c(39326),i=c(32324),j=c(261),k=c(54290),l=c(85328),m=c(38928),n=c(46595),o=c(3421),p=c(17679),q=c(41681),r=c(63446),s=c(86439),t=c(51356),u=c(10641),v=c(29021),w=c.n(v),x=c(33873),y=c.n(x),z=c(74075),A=c.n(z),B=c(28354),C=c(94345);let D=(0,B.promisify)(A().brotliCompress),E=(0,B.promisify)(A().gzip);async function F(a){let b=await (0,C.EU)(),{datasetName:c}=await a.json(),d=y().join(b,c);try{try{await w().promises.access(d)}catch{return u.NextResponse.json({error:`Folder '${c}' not found`},{status:404})}let b=await G(d);b.sort((a,b)=>a.localeCompare(b));let e=d+y().sep,f=b.map(a=>a.slice(e.length)),g=JSON.stringify({root:e,images:f}),h=a.headers.get("accept-encoding")??"";if(/\bbr\b/.test(h)){let a=await D(g);return new u.NextResponse(a,{headers:{"Content-Type":"application/json","Content-Encoding":"br"}})}if(/\bgzip\b/.test(h)){let a=await E(g);return new u.NextResponse(a,{headers:{"Content-Type":"application/json","Content-Encoding":"gzip"}})}return new u.NextResponse(g,{headers:{"Content-Type":"application/json"}})}catch(a){return console.error("Error finding images:",a),u.NextResponse.json({error:"Failed to process request"},{status:500})}}async function G(a){let b=[".png",".jpg",".jpeg",".webp",".mp4",".avi",".mov",".mkv",".wmv",".m4v",".flv",".mp3",".wav",".flac",".ogg"],c=[],d=await w().promises.readdir(a,{withFileTypes:!0}),e=[];for(let f of d){let d=f.name;if(d.startsWith("."))continue;let g=y().join(a,d);if(f.isDirectory()){if("_controls"===d)continue;e.push(g)}else if(f.isFile()){let a=y().extname(d).toLowerCase();b.includes(a)&&c.push(g)}}for(let a of(await Promise.all(e.map(a=>G(a)))))c=c.concat(a);return c}let H=new e.AppRouteRouteModule({definition:{kind:f.RouteKind.APP_ROUTE,page:"/api/datasets/listImages/route",pathname:"/api/datasets/listImages",filename:"route",bundlePath:"app/api/datasets/listImages/route"},distDir:".next",relativeProjectDir:"",resolvedPagePath:"/app/ai-toolkit/ui/src/app/api/datasets/listImages/route.ts",nextConfigOutput:"",userland:d}),{workAsyncStorage:I,workUnitAsyncStorage:J,serverHooks:K}=H;function L(){return(0,g.patchFetch)({workAsyncStorage:I,workUnitAsyncStorage:J})}async function M(a,b,c){var d;let e="/api/datasets/listImages/route";"/index"===e&&(e="/");let g=await H.prepare(a,b,{srcPage:e,multiZoneDraftMode:!1});if(!g)return b.statusCode=400,b.end("Bad Request"),null==c.waitUntil||c.waitUntil.call(c,Promise.resolve()),null;let{buildId:u,params:v,nextConfig:w,isDraftMode:x,prerenderManifest:y,routerServerContext:z,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,resolvedPathname:C}=g,D=(0,j.normalizeAppPath)(e),E=!!(y.dynamicRoutes[D]||y.routes[C]);if(E&&!x){let a=!!y.routes[C],b=y.dynamicRoutes[D];if(b&&!1===b.fallback&&!a)throw new s.NoFallbackError}let F=null;!E||H.isDev||x||(F="/index"===(F=C)?"/":F);let G=!0===H.isDev||!E,I=E&&!G,J=a.method||"GET",K=(0,i.getTracer)(),L=K.getActiveScopeSpan(),M={params:v,prerenderManifest:y,renderOpts:{experimental:{cacheComponents:!!w.experimental.cacheComponents,authInterrupts:!!w.experimental.authInterrupts},supportsDynamicResponse:G,incrementalCache:(0,h.getRequestMeta)(a,"incrementalCache"),cacheLifeProfiles:null==(d=w.experimental)?void 0:d.cacheLife,isRevalidate:I,waitUntil:c.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:void 0,onInstrumentationRequestError:(b,c,d)=>H.onRequestError(a,b,d,z)},sharedContext:{buildId:u}},N=new k.NodeNextRequest(a),O=new k.NodeNextResponse(b),P=l.NextRequestAdapter.fromNodeNextRequest(N,(0,l.signalFromNodeResponse)(b));try{let d=async c=>H.handle(P,M).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let d=K.getRootSpanAttributes();if(!d)return;if(d.get("next.span_type")!==m.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${d.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let e=d.get("next.route");if(e){let a=`${J} ${e}`;c.setAttributes({"next.route":e,"http.route":e,"next.span_name":a}),c.updateName(a)}else c.updateName(`${J} ${a.url}`)}),g=async g=>{var i,j;let k=async({previousCacheEntry:f})=>{try{if(!(0,h.getRequestMeta)(a,"minimalMode")&&A&&B&&!f)return b.statusCode=404,b.setHeader("x-nextjs-cache","REVALIDATED"),b.end("This page could not be found"),null;let e=await d(g);a.fetchMetrics=M.renderOpts.fetchMetrics;let i=M.renderOpts.pendingWaitUntil;i&&c.waitUntil&&(c.waitUntil(i),i=void 0);let j=M.renderOpts.collectedTags;if(!E)return await (0,o.I)(N,O,e,M.renderOpts.pendingWaitUntil),null;{let a=await e.blob(),b=(0,p.toNodeOutgoingHttpHeaders)(e.headers);j&&(b[r.NEXT_CACHE_TAGS_HEADER]=j),!b["content-type"]&&a.type&&(b["content-type"]=a.type);let c=void 0!==M.renderOpts.collectedRevalidate&&!(M.renderOpts.collectedRevalidate>=r.INFINITE_CACHE)&&M.renderOpts.collectedRevalidate,d=void 0===M.renderOpts.collectedExpire||M.renderOpts.collectedExpire>=r.INFINITE_CACHE?void 0:M.renderOpts.collectedExpire;return{value:{kind:t.CachedRouteKind.APP_ROUTE,status:e.status,body:Buffer.from(await a.arrayBuffer()),headers:b},cacheControl:{revalidate:c,expire:d}}}}catch(b){throw(null==f?void 0:f.isStale)&&await H.onRequestError(a,b,{routerKind:"App Router",routePath:e,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})},z),b}},l=await H.handleResponse({req:a,nextConfig:w,cacheKey:F,routeKind:f.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:y,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:B,responseGenerator:k,waitUntil:c.waitUntil});if(!E)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==t.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(j=l.value)?void 0:j.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});(0,h.getRequestMeta)(a,"minimalMode")||b.setHeader("x-nextjs-cache",A?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),x&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let m=(0,p.fromNodeOutgoingHttpHeaders)(l.value.headers);return(0,h.getRequestMeta)(a,"minimalMode")&&E||m.delete(r.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||b.getHeader("Cache-Control")||m.get("Cache-Control")||m.set("Cache-Control",(0,q.getCacheControlHeader)(l.cacheControl)),await (0,o.I)(N,O,new Response(l.value.body,{headers:m,status:l.value.status||200})),null};L?await g(L):await K.withPropagatedContext(a.headers,()=>K.trace(m.BaseServerSpan.handleRequest,{spanName:`${J} ${a.url}`,kind:i.SpanKind.SERVER,attributes:{"http.method":J,"http.target":a.url}},g))}catch(b){if(b instanceof s.NoFallbackError||await H.onRequestError(a,b,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,n.c)({isRevalidate:I,isOnDemandRevalidate:A})}),E)throw b;return await (0,o.I)(N,O,new Response(null,{status:500})),null}}},33873:a=>{"use strict";a.exports=require("path")},44870:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-route.runtime.prod.js")},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},74075:a=>{"use strict";a.exports=require("zlib")},78335:()=>{},82344:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(96330);let e=globalThis.prisma??new d.PrismaClient},86439:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external")},94345:(a,b,c)=>{"use strict";c.d(b,{EU:()=>k,Mc:()=>n,RI:()=>j,VI:()=>l,f2:()=>m});var d=c(33873),e=c.n(d),f=c(82344),g=c(6452),h=c(93940);let i=new(c.n(h)()),j=()=>{i.flushAll()},k=async()=>{let a="DATASETS_FOLDER",b=i.get(a);if(b)return b;let c=await f.A.settings.findFirst({where:{key:"DATASETS_FOLDER"}});return b=g.b4,c?.value&&""!==c.value&&(b=c.value),b=e().resolve(b),i.set(a,b),b},l=async()=>{let a="TRAINING_FOLDER",b=i.get(a);if(b)return b;let c=await f.A.settings.findFirst({where:{key:a}});return b=g.eA,c?.value&&""!==c.value&&(b=c.value),b=e().resolve(b),i.set(a,b),b},m=async()=>{let a="DATA_ROOT",b=i.get(a);if(b)return b;let c=await f.A.settings.findFirst({where:{key:a}});return b=g.iP,c?.value&&""!==c.value&&(b=c.value),b=e().resolve(b),i.set(a,b),b},n=async()=>{if(process.env.MODELS_PATH&&""!==process.env.MODELS_PATH.trim())return process.env.MODELS_PATH;let a=await f.A.settings.findFirst({where:{key:"MODELS_PATH"}});return a?.value&&""!==a.value?a.value:e().join(process.cwd(),"..","models")}},94735:a=>{"use strict";a.exports=require("events")},96330:a=>{"use strict";a.exports=require("@prisma/client")},96487:()=>{}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[5873,1692,3940],()=>b(b.s=32948));module.exports=c})(); |
Xet Storage Details
- Size:
- 9.79 kB
- Xet hash:
- ea1238bd922618d63913a5c259162d08c226fbfbc36cedc905c61e7c8491f60d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.