frontend update

This commit is contained in:
akdeb 2025-04-17 14:38:57 +01:00
parent 15cfc8593d
commit 8dae932aaf
702 changed files with 97616 additions and 232 deletions

BIN
.DS_Store vendored

Binary file not shown.

BIN
firmware-arduino/.DS_Store vendored Normal file

Binary file not shown.

View file

@ -17,11 +17,10 @@ monitor_speed = 115200
lib_deps =
bblanchon/ArduinoJson@^7.1.0
links2004/WebSockets@^2.4.1
https://github.com/esp-arduino-libs/ESP32_Button.git
ESP32Async/ESPAsyncWebServer@^3.7.6
https://github.com/esp-arduino-libs/ESP32_Button.git#v0.0.1
https://github.com/pschatzmann/arduino-audio-tools.git#v1.0.1
https://github.com/pschatzmann/arduino-libopus.git
ESP32Async/AsyncTCP
ESP32Async/ESPAsyncWebServer
https://github.com/pschatzmann/arduino-libopus.git#a1.1.0
; board_build.arduino.memory_type = qio_opi
; board_build.flash_mode = qio
@ -40,4 +39,4 @@ build_flags =
-std=gnu++17
-D CORE_DEBUG_LEVEL=5
-D DEBUG_ESP_PORT=Serial
-D TOUCH_SENSOR_ENABLE=1
-D TOUCH_SENSOR_ENABLE=1 ; Enable touch sensor driver

View file

@ -183,43 +183,15 @@ I2SStream i2sInput;
StreamCopy micToWsCopier(wsStream, i2sInput);
const int MIC_COPY_SIZE = 64;
void micTask1(void *parameter) {
auto i2sConfig = i2sInput.defaultConfig(RX_MODE);
i2sConfig.bits_per_sample = BITS_PER_SAMPLE;
i2sConfig.sample_rate = SAMPLE_RATE;
i2sConfig.channels = CHANNELS;
i2sConfig.i2s_format = I2S_LEFT_JUSTIFIED_FORMAT;
i2sConfig.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT;
i2sConfig.pin_bck = I2S_SCK;
i2sConfig.pin_ws = I2S_WS;
i2sConfig.pin_data = I2S_SD;
i2sConfig.port_no = I2S_PORT_IN;
i2sInput.begin(i2sConfig);
while (1) {
if (scheduleListeningRestart && millis() >= scheduledTime) {
transitionToListening();
}
if (deviceState == LISTENING && webSocket.isConnected()) {
micToWsCopier.copyBytes(MIC_COPY_SIZE);
}
vTaskDelay(1);
}
}
void micTask(void *parameter) {
// start I2S input stream.
// Configure and start I2S input stream.
auto i2sConfig = i2sInput.defaultConfig(RX_MODE);
i2sConfig.bits_per_sample = BITS_PER_SAMPLE;
i2sConfig.sample_rate = SAMPLE_RATE;
i2sConfig.channels = CHANNELS;
i2sConfig.i2s_format = I2S_LEFT_JUSTIFIED_FORMAT;
i2sConfig.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT;
// I2S input pins a
// Configure your I2S input pins appropriately here:
i2sConfig.pin_bck = I2S_SCK;
i2sConfig.pin_ws = I2S_WS;
i2sConfig.pin_data = I2S_SD;
@ -227,16 +199,16 @@ void micTask(void *parameter) {
i2sInput.begin(i2sConfig);
while (1) {
// Checking to see if a transition to listening mode is scheduled.
// Check to see if a transition to listening mode is scheduled.
if (scheduleListeningRestart && millis() >= scheduledTime) {
transitionToListening();
}
if (deviceState == LISTENING && webSocket.isConnected()) {
// smaller chunk size to avoid blocking too long
// Use smaller chunk size to avoid blocking too long
micToWsCopier.copyBytes(MIC_COPY_SIZE);
// yielding frequently
// Yield more frequently
vTaskDelay(1);
} else {
vTaskDelay(10);
@ -278,7 +250,7 @@ void webSocketEvent(WStype_t type, uint8_t *payload, size_t length)
currentVolume = doc["volume_control"].as<int>();
bool is_ota = doc["is_ota"].as<bool>();
bool is_reset = doc["is_reset"].as<bool>();
volume.setVolume(currentVolume / 100.0f); // Setting initial volume (e.g., 70/100 = 0.7)
volume.setVolume(currentVolume / 100.0f); // Set initial volume (e.g., 70/100 = 0.7)
if (is_ota) {
Serial.println("OTA update received");

View file

@ -6,18 +6,32 @@ Preferences preferences;
OtaStatus otaState = OTA_IDLE;
bool factory_reset_status = false;
// websocket_setup("192.168.1.166", 8000, "/");
// websocket_setup("talkedge.deno.dev",443, "/");
// websocket_setup("xygbupeczfhwamhqnucy.supabase.co", 443, "/functions/v1/relay");
// websocket_setup("https://emkmtesvjrqhvx2mo2mxslvmmy0zsuhq.lambda-url.us-east-1.on.aws/", 8000, "/");
// Runtime WebSocket server details
/**
* Configuration for Elato Firmware
*
* DEVELOPMENT vs PRODUCTION SETUP:
* --------------------------------
* 1. Define `DEV_MODE` in your config.h file to use local development servers
* 2. `DEV_MODE` requires updating the IP addresses to your local network IP
* 3. Without `DEV_MODE` defined, the firmware will use your production servers
*
* Development Mode (find your local IP address using ifconfig):
* - WebSocket: Your local IP (e.g., 192.168.1.100:8000)
* - Backend: Your local IP (e.g., 192.168.1.100:3000)
* - No SSL certificates required
*
* Production Mode:
* - WebSocket: <your-websocket-server>.deno.dev (port 443)
* - Backend: <your-vercel-backend-server> (port 3000)
* - Uses pre-configured SSL certificates (set in Config.cpp)
*/
#ifdef DEV_MODE
const char *ws_server = "10.2.1.25";
const char *ws_server = "10.2.1.187";
const uint16_t ws_port = 8000;
const char *ws_path = "/";
// Backend server details
const char *backend_server = "10.2.1.25";
const char *backend_server = "10.2.1.187";
const uint16_t backend_port = 3000;
#else
@ -60,21 +74,20 @@ const gpio_num_t BUTTON_PIN = GPIO_NUM_2; // Only RTC IO are allowed - ESP32 Pin
#endif
// supabase CA cert
// const char *CA_cert = R"EOF(
// -----BEGIN CERTIFICATE-----
// <YOUR HOST CERTIFICATE HERE>
// -----END CERTIFICATE-----
// )EOF";
const char *Vercel_CA_cert = R"EOF(
-----BEGIN CERTIFICATE-----
<YOUR VERCEL CERTIFICATE HERE>
-----END CERTIFICATE-----
)EOF";
// Supabase Edge Functions CA cert
// const char *CA_cert = R"EOF(
// -----BEGIN CERTIFICATE-----
// <YOUR HOST CERTIFICATE HERE>
// -----END CERTIFICATE-----
// )EOF";
// talkedge.deno.dev CA cert
// Deno Edge Functions CA cert
const char *CA_cert = R"EOF(
-----BEGIN CERTIFICATE-----
<YOUR TALKEDGE CERTIFICATE HERE>

View file

@ -6,15 +6,15 @@ HttpsOTAStatus_t otastatus;
// OTA firmware url
#ifdef TOUCH_MODE
const char *ota_firmware_url = "https://elato.s3.us-east-1.amazonaws.com/firmware-touch.bin";
const char *ota_firmware_url = "<YOUR S3 OTA FIRMWARE URL HERE> - TOUCH MODE";
#else
const char *ota_firmware_url = "https://elato.s3.us-east-1.amazonaws.com/firmware-button.bin";
const char *ota_firmware_url = "<YOUR S3 OTA FIRMWARE URL HERE> - BUTTON MODE";
#endif
const char *server_certificate = R"EOF(
-----BEGIN CERTIFICATE-----
<YOUR HOST CERTIFICATE HERE>
<YOUR S3 HOST CERTIFICATE HERE>
-----END CERTIFICATE-----
)EOF";

View file

@ -117,6 +117,7 @@ void setupWiFi()
webServer.begin();
}
void touchTask(void* parameter) {
touch_pad_init();
touch_pad_config(TOUCH_PAD_NUM2);
@ -124,6 +125,7 @@ void touchTask(void* parameter) {
bool touched = false;
unsigned long pressStartTime = 0;
unsigned long lastTouchTime = 0;
const unsigned long LONG_PRESS_DURATION = 500; // 500ms for long press
while (1) {
// Read the touch sensor
@ -131,50 +133,32 @@ void touchTask(void* parameter) {
bool isTouched = (touchValue > TOUCH_THRESHOLD);
unsigned long currentTime = millis();
// Debounced touch detection
// Initial touch detection
if (isTouched && !touched && (currentTime - lastTouchTime > TOUCH_DEBOUNCE_DELAY)) {
touched = true;
pressStartTime = currentTime; // Start timing the press
lastTouchTime = currentTime;
enterSleep();
}
// if (!webSocket.isConnected()) {
// enterSleep();
// } else if (deviceState == SPEAKING) {
// // First, set the flag to prevent further audio processing
// // deviceState = PROCESSING;
// scheduleListeningRestart = true;
// scheduledTime = millis() + 100; // Shorter delay
// unsigned long audio_end_ms = getSpeakingDuration();
// // Use ArduinoJson to create the message
// JsonDocument doc;
// doc["type"] = "instruction";
// doc["msg"] = "INTERRUPT";
// doc["audio_end_ms"] = audio_end_ms;
// String jsonString;
// serializeJson(doc, jsonString);
// // Take mutex to ensure clean WebSocket access
// if (xSemaphoreTake(wsMutex, pdMS_TO_TICKS(10)) == pdTRUE) {
// webSocket.sendTXT(jsonString);
// xSemaphoreGive(wsMutex);
// }
// }
// Check for long press while touched
if (touched && isTouched) {
if (currentTime - pressStartTime >= LONG_PRESS_DURATION) {
enterSleep(); // Only enter sleep after 500ms of continuous touch
}
}
// Release detection
if (!isTouched && touched) {
touched = false;
pressStartTime = 0; // Reset the press timer
}
vTaskDelay(20); // Reduced from 50ms to 20ms for better responsiveness
}
// (This point is never reached.)
vTaskDelete(NULL);
}
void setupDeviceMetadata() {
// factoryResetDevice();
deviceState = IDLE;

View file

@ -6,7 +6,6 @@ NEXT_PUBLIC_SUPABASE_ANON_KEY=<YOUR_SUPABASE_ANON_KEY>
JWT_SECRET_KEY=<YOUR_JWT_SECRET_KEY>
ENCRYPTION_KEY=<YOUR_ENCRYPTION_KEY>
OPENAI_API_KEY=<YOUR_OPENAI_API_KEY>
ENCRYPTION_KEY=<YOUR_ENCRYPTION_KEY>
# NEXT_PUBLIC_SUPABASE_URL=http://localhost:54321
GOOGLE_OAUTH=True

View file

@ -101,12 +101,9 @@ export default async function Login({ searchParams }: LoginProps) {
/>
)}
{/* <Separator className="mt-2" />
<div className="flex flex-row gap-2 items-center w-full h-[300px] mx-auto relative rounded-xl overflow-hidden">
<Image src="/teddy.png" alt="Elato Login" fill className="object-cover" />
</div> */}
<Separator className="mt-2" />
{/*<form className="flex-1 flex flex-col w-full justify-center gap-4">
<form className="flex-1 flex flex-col w-full justify-center gap-4">
<Label className="text-md" htmlFor="email">
Email
</Label>
@ -147,7 +144,7 @@ export default async function Login({ searchParams }: LoginProps) {
{searchParams.message}
</p>
)}
</form> */}
</form>
</CardContent>
</Card>
</div>

View file

@ -3,15 +3,14 @@
import { Label } from "@/components/ui/label";
import { Button } from "@/components/ui/button";
import { Mail } from "lucide-react";
import { ThemeSwitcher } from "@/components/theme-switcher";
import { Separator } from "@/components/ui/separator";
import { FaDiscord, FaGithub } from "react-icons/fa";
import { FaDiscord, FaGithub, FaTiktok } from "react-icons/fa";
import Link from "next/link";
import { usePathname } from "next/navigation";
import {
discordInviteLink,
githubPublicLink,
feedbackFormLink,
tiktokLink,
} from "@/lib/data";
import { useMediaQuery } from "@/hooks/useMediaQuery";
@ -19,14 +18,12 @@ export default function Footer() {
const pathname = usePathname();
const isHome = pathname.includes("/home");
const isMobile = useMediaQuery("(max-width: 768px)");
const isRoot = pathname === "/";
// const isRoot = pathname === "/";
return (
<footer
className={`w-full ${
isHome ? "pb-16" : "pb-2"
} ${
isRoot ? "bg-gradient-to-r bg-purple-900 text-white border-transparent" : "border-gray-200"
} flex flex-col sm:flex-row items-center sm:justify-center border-t-[1px] mx-auto text-center text-xs sm:gap-8 sm:py-1 py-2`}
} border-gray-200 flex flex-col sm:flex-row items-center sm:justify-center border-t-[1px] mx-auto text-center text-xs sm:gap-8 sm:py-1 py-2`}
>
<div className="flex flex-row items-center gap-8">
<a href={feedbackFormLink} target="_blank">
@ -40,7 +37,7 @@ export default function Footer() {
Send feedback
</Button>
</a>
<Label className={`font-normal text-xs ${isRoot ? "text-gray-100" : "text-gray-500"}`}>
<Label className={`font-normal text-xs text-gray-500`}>
Elato AI © {new Date().getFullYear()} All rights
reserved.
</Label>
@ -56,7 +53,7 @@ export default function Footer() {
<Button
variant="ghost"
size="icon"
className={`w-7 h-7 ${isRoot ? "text-gray-100" : "text-gray-500"}`}
className={`w-7 h-7 text-gray-500`}
>
<FaGithub />
</Button>
@ -65,23 +62,32 @@ export default function Footer() {
<Button
variant="ghost"
size="icon"
className={`w-7 h-7 ${isRoot ? "text-gray-100" : "text-gray-500"}`}
className={`w-7 h-7 text-gray-500`}
>
<FaDiscord />
</Button>
</Link>
<Link href={tiktokLink} passHref>
<Button
variant="ghost"
size="icon"
className={`w-7 h-7 text-gray-500`}
>
<FaTiktok />
</Button>
</Link>
</div>
<a
href="/privacy"
className={`font-normal underline ${isRoot ? "text-gray-100" : "text-gray-500"} text-xs`}
className={`font-normal underline text-gray-500 text-xs`}
>
Privacy Policy
</a>
<a
href="/terms"
className={`font-normal underline ${isRoot ? "text-gray-100" : "text-gray-500"} text-xs`}
className={`font-normal underline text-gray-500 text-xs`}
>
Terms of Service
</a>

View file

@ -8,7 +8,7 @@ export const CreateCharacterShowcase = () => {
{/* Text Content - On right for desktop, top for mobile */}
<div className="order-1 lg:order-2 w-full lg:w-2/5">
<h2 className="text-3xl md:text-4xl font-bold mb-6 text-gray-800">
Create Your Own
Create Your Own AI
</h2>
<p className="text-lg text-gray-600 mb-6">
Create a character that is unique and personalized to your needs.

View file

@ -0,0 +1,97 @@
// frontend/app/components/LandingPage/ProductGallery.tsx
'use client';
import { useState } from 'react';
import Image from 'next/image';
import {
Carousel,
CarouselContent,
CarouselItem,
CarouselNext,
CarouselPrevious,
} from "@/components/ui/carousel";
const images = [
{
src: "/products/device1.jpeg",
alt: "Elato Device - white",
},
{
src: "/products/device2.jpeg",
alt: "Elato Device - gray",
},
{
src: "/products/device4.jpeg",
alt: "Elato Device - white",
},
{
src: "/products/device5.jpeg",
alt: "Elato Device - gray",
},
{
src: "/products/device6.jpeg",
alt: "Elato Device - black",
},
{
src: "/products/device7.jpeg",
alt: "Elato Device - white",
},
{
src: "/products/device8.jpeg",
alt: "Elato Device - gray",
},
];
export default function ProductGallery() {
const [selectedImage, setSelectedImage] = useState(images[0]);
return (
<div className="w-full max-w-3xl mx-auto space-y-8 py-8">
{/* Main Image */}
<div className="relative w-full h-[400px] rounded-2xl bg-gray-50">
<Image
src={selectedImage.src}
alt={selectedImage.alt}
fill
className="object-contain rounded-2xl"
priority
/>
</div>
{/* Thumbnail Carousel */}
<div className="w-full px-8">
<Carousel
opts={{
align: "start",
loop: true,
}}
className="w-full"
>
<CarouselContent className="-ml-4">
{images.map((image, index) => (
<CarouselItem key={index} className="pl-4 basis-1/5 py-2">
<div
className={`relative sm:h-20 h-16 cursor-pointer rounded-lg overflow-hidden ${
selectedImage.src === image.src
? 'ring-2 ring-yellow-500'
: 'hover:opacity-75'
}`}
onClick={() => setSelectedImage(image)}
>
<Image
src={image.src}
alt={image.alt}
fill
className="object-cover"
/>
</div>
</CarouselItem>
))}
</CarouselContent>
<CarouselPrevious />
<CarouselNext />
</Carousel>
</div>
</div>
);
}

View file

@ -0,0 +1,129 @@
"use client"
import { useState } from "react";
import { Button } from "@/components/ui/button";
import { Card, CardContent } from "@/components/ui/card";
import Image from "next/image";
import Link from "next/link";
import { ShoppingCart } from "lucide-react";
type Product = {
id: string;
name: string;
description: string;
price: number;
imageUrl: string;
features: string[];
url: string;
};
const products: Product[] = [
{
id: "1",
name: "Elato AI Device",
description: "Transform any toy into an AI companion with any voice and personality with our advanced conversational AI",
price: 55,
url: "/products",
imageUrl: "/products/device1.jpeg",
features: [
"Works with any toy or plushie",
"Create unlimited AI characters",
"First month subscription FREE",
"Easy to set up in minutes",
]
},
// {
// id: "2",
// name: "Elato AI Dev Kit",
// description: "Create custom AI experiences with our developer-friendly kit, complete with sensors and tutorials",
// price: 45,
// url: "/products/ai-devkit",
// imageUrl: "/products/devkit.png",
// features: [
// "Flash our open source code to your device",
// "Flexible speaker and Lipo battery options",
// "Set your own voice and personality",
// "Attach a custom case"
// ]
// }
];
export default function ProductsSection() {
return (
<section className="w-full py-12 bg-gradient-to-b from-gray-50 to-white">
<div className="container px-4 md:px-6 max-w-screen-sm mx-auto">
<div className="text-center mb-10">
<h2 className="text-3xl md:text-4xl font-bold mb-6 text-gray-800">
Our Product
</h2>
<p className="text-lg text-gray-600 mt-2">
Everything you need to bring conversational AI to your world
</p>
</div>
<div className="grid grid-cols-1 gap-8">
{products.map((product) => (
<Link href={product.url} key={product.id}>
<Card
key={product.id}
className="bg-white rounded-xl p-6 shadow-lg border border-gray-100
transform transition-all duration-300
hover:shadow-xl hover:border-purple-200
relative
before:absolute before:inset-0 before:opacity-0
hover:before:opacity-100 before:transition-opacity
hover:translate-y-[-2px] cursor-pointer"
>
<CardContent className="p-0 relative">
<div className="flex flex-col md:flex-row gap-6 items-center md:items-start">
{/* Image Section */}
<div className="w-full md:w-2/5 min-h-[200px] h-full relative rounded-xl overflow-hidden border border-purple-100">
<Image
src={product.imageUrl}
alt={product.name}
fill
className="object-cover"
// sizes="(max-width: 768px) 100vw, 33vw"
priority
/>
</div>
<div className="w-full md:w-3/5 flex flex-col gap-4 justify-between min-h-[200px]">
{/* Content Section */}
<div className="flex-1 flex flex-col items-start md:text-left">
<h3 className="text-xl font-bold text-purple-900 mb-2">
{product.name}
</h3>
<p className="text-gray-600 mb-4">
{product.description}
</p>
{/* <div className="flex flex-col gap-2">
{product.features.map((feature) => (
<p className="text-gray-600 text-sm">{feature}</p>
))}
</div> */}
</div>
{/* Price and Button Section */}
<div className="flex flex-row items-center justify-end gap-4">
<p className="text-2xl font-bold text-purple-900">
${product.price}
</p>
<Button
size="lg"
className="w-full sm:w-auto flex-row items-center gap-2 px-4 bg-gradient-to-r from-purple-600 to-pink-500 text-white border-0 text-md"
>
<ShoppingCart className="h-4 w-4" /> Buy Now
</Button>
</div></div>
</div>
</CardContent>
</Card>
</Link>
))}
</div>
</div>
</section>
);
}

View file

@ -0,0 +1,21 @@
"use client";
import React from "react";
import { useRef } from "react";
import { useEffect } from "react";
import { useCallback } from "react";
export default function YoutubeDemo() {
return <div className="w-full max-w-3xl mx-auto">
<div className="relative" style={{ paddingBottom: '56.25%' }}>
<iframe
className="absolute top-0 left-0 w-full h-full rounded-xl shadow-lg"
src="https://www.youtube.com/embed/o1eIAwVll5I"
title="Elato Demo"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowFullScreen
/>
</div>
<p className="text-center text-gray-600 mt-4 text-lg">Watch the Elato Demo</p>
</div>
}

View file

@ -36,19 +36,12 @@ export function Navbar({
return (
<div
className={`backdrop-blur-[3px] flex-none flex items-center sticky top-0 z-50 transition-transform duration-300 h-[80px] ${
className={`backdrop-blur-[3px] flex-none flex items-center sticky top-0 z-50 transition-transform duration-300 h-[60px] ${
isVisible ? "translate-y-0" : "-translate-y-full"
} ${!isHome ? "h-[80px]" : "h-[60px]"}`}
}`}
>
{!isHome && (
<div className="fixed h-8 top-0 flex items-center justify-center w-full bg-yellow-100 dark:bg-yellow-900/30 px-4 py-2 text-center font-medium text-yellow-800 dark:text-yellow-200 z-40 gap-2 text-sm">
Starmoon has a new home!
</div>
)}
<nav
className={`mx-auto w-full max-w-[1440px] px-4 flex items-center justify-between ${
!isHome ? "pt-8" : ""
}`}
className={`mx-auto w-full max-w-[1440px] px-4 flex items-center justify-between`}
>
<LeftNavbarButtons user={user} />
<NavbarButtons user={user} stars={stars} isHome={isHome} />

View file

@ -59,13 +59,6 @@ const NavbarButtons: React.FC<NavbarButtonsProps> = ({
>
<FaGithub className="text-xl" />
<p className="hidden sm:flex font-normal">GitHub</p>
<Separator
orientation="vertical"
className="hidden sm:flex"
/>
<p className="hidden sm:flex text-xs font-normal">
{stars?.toLocaleString() ?? 498}
</p>
</Button>
</Link>
)}

View file

@ -135,26 +135,6 @@ export function NavbarDropdownMenu({ user, stars }: NavbarMenuButtonProps) {
<span>{isKids ? "Elato for Hobbyists" : "Elato for Kids"}</span>
</Link>
</DropdownMenuItem> */}
<DropdownMenuItem>
<Link
href={docsLink}
passHref
className="flex flex-row gap-2 w-full"
>
<BookOpen size={ICON_SIZE} />
<span>Docs</span>
</Link>
</DropdownMenuItem>
<DropdownMenuItem>
<Link
href={businessDemoLink}
passHref
className="flex flex-row gap-2 w-full"
>
<CalendarCheck size={ICON_SIZE} />
<span>Business Demo</span>
</Link>
</DropdownMenuItem>
</DropdownMenuGroup>
<DropdownMenuItem>
<Link
@ -166,12 +146,7 @@ export function NavbarDropdownMenu({ user, stars }: NavbarMenuButtonProps) {
>
<FaGithub size={ICON_SIZE} />
<span>GitHub</span>
{stars && (
<div className="flex items-center gap-1 rounded-lg bg-muted px-2 py-0.5 text-xs text-muted-foreground">
<span>{stars.toLocaleString()}</span>
<Star size={12} fill="currentColor" />
</div>
)}
</Link>
</DropdownMenuItem>
<DropdownMenuItem>

View file

@ -2,11 +2,14 @@ import Link from "next/link"
import { ChevronRight, Zap, Star, Home } from "lucide-react"
import { Button } from "@/components/ui/button"
import VideoPlayer from "./components/LandingPage/VideoPlayer"
import { DEVICE_COST, SUBSCRIPTION_COST, videoSrc, videoSrc2, videoSrc3, videoSrc4 } from "@/lib/data";
import { DEVICE_COST, discordInviteLink, SUBSCRIPTION_COST, tiktokLink, videoSrc, videoSrc2, videoSrc3, videoSrc4 } from "@/lib/data";
import { createClient } from "@/utils/supabase/server"
import { getAllPersonalities } from "@/db/personalities"
import { CharacterShowcase } from "./components/LandingPage/CharacterShowcase";
import { CreateCharacterShowcase } from "./components/LandingPage/CreateCharacterShowcase";
import { FaDiscord, FaTiktok } from "react-icons/fa";
import ProductsSection from "./components/LandingPage/ProductsSection";
import Image from "next/image";
export default async function LandingPage() {
const supabase = createClient();
@ -18,21 +21,16 @@ export default async function LandingPage() {
{/* Hero Section */}
<section className="w-full py-12 md:py-20">
<div className="container px-4 md:px-6 max-w-screen-lg mx-auto">
<div className="grid gap-6 lg:grid-cols-2 lg:gap-12 items-center">
<div className="flex flex-col justify-center space-y-4">
<div className="inline-flex w-fit items-center space-x-2 rounded-full bg-purple-100 px-3 py-1 text-sm text-purple-700">
<Zap className="h-4 w-4" />
<span>First month FREE!</span>
</div>
<h1 className="text-5xl md:text-6xl font-bold tracking-tighter text-purple-900 leading-tight">
Any AI voice for {" "}
<div className="grid gap-6 lg:grid-cols-1 lg:gap-12 items-center">
<div className="flex flex-col items-center justify-center space-y-4">
<h1 className="text-5xl text-center md:text-6xl font-bold tracking-tight text-purple-900" style={{ lineHeight: '1.2' }}>
<span className="text-transparent bg-clip-text bg-gradient-to-r from-purple-600 to-pink-500">
Your Toys
</span>{" "}
Realtime, Conversational AI
</span>{" "} on ESP32 with Arduino and Edge Functions
</h1>
<p className="text-xl text-gray-600 max-w-[600px]">
<p className="text-xl text-gray-600 text-center max-w-[600px]">
Attach your <span className="font-silkscreen mx-1">Elato</span> device to any toy or plushie and watch them become AI characters you can talk
to!
</p>
@ -61,7 +59,7 @@ export default async function LandingPage() {
</Link>
</div>
<div className="flex items-center space-x-2 text-amber-500 mb-4">
<div className="flex items-center space-x-2 justify-center text-amber-500 mb-4">
<Star className="fill-amber-500" />
<Star className="fill-amber-500" />
<Star className="fill-amber-500" />
@ -81,25 +79,42 @@ export default async function LandingPage() {
</div> */}
</div>
<div className="flex flex-row gap-2 items-center">
<div className="w-full py-8">
<h3 className="text-center text-sm font-medium text-gray-500 mb-6">POWERED BY</h3>
<div className="flex flex-wrap justify-center items-center gap-12">
<a href="https://vercel.com" target="_blank" rel="noopener noreferrer" className="transition-all">
<Image src="/logos/vercel.png" alt="Vercel" width={100} height={24} style={{ height: '36px', width: 'auto' }} />
</a>
<a href="https://deno.com" target="_blank" rel="noopener noreferrer" className="transition-all">
<Image src="/logos/deno.png" alt="Deno" width={100} height={24} style={{ height: '36px', width: 'auto' }} />
</a>
<a href="https://supabase.com" target="_blank" rel="noopener noreferrer" className="transition-all">
<Image src="/logos/supabase.png" alt="Supabase" width={100} height={24} style={{ height: '48px', width: 'auto' }} />
</a>
<a href="https://arduino.cc" target="_blank" rel="noopener noreferrer" className="transition-all">
<Image src="/logos/arduino.png" alt="Arduino" width={100} height={24} style={{ height: '36px', width: 'auto' }} />
</a>
<a href="https://espressif.com" target="_blank" rel="noopener noreferrer" className="transition-all">
<Image src="/logos/espressif.png" alt="Espressif ESP32" width={100} height={24} style={{ height: '24px', width: 'auto' }} />
</a>
<a href="https://platformio.org" target="_blank" rel="noopener noreferrer" className="transition-all">
<Image src="/logos/platformio.png" alt="PlatformIO" width={100} height={24} style={{ height: '36px', width: 'auto' }} />
</a>
</div>
</div>
</div>
</div>
<VideoPlayer sources={[videoSrc, videoSrc2, videoSrc3, videoSrc4]} />
</div>
</div>
</section>
{/* Personalities */}
{/* <Personalities allPersonalities={adultPersonalities} /> */}
{/* Products Section */}
<ProductsSection />
{/* Character Showcase */}
<CharacterShowcase allPersonalities={adultPersonalities} />
{/* Create Character Showcase */}
<CreateCharacterShowcase />
{/* How It Works */}
<section className="w-full py-12 bg-gradient-to-b from-purple-50 to-white">
{/* How It Works */}
<section className="w-full py-12 bg-gradient-to-b from-purple-50 to-white">
<div className="container px-4 md:px-6">
<div className="text-center mb-10">
<h2 className="text-3xl md:text-4xl font-bold mb-6 text-gray-800">
@ -136,57 +151,17 @@ export default async function LandingPage() {
</div>
</section>
{/* Pricing */}
<section className="w-full py-16 bg-white">
<div className="container px-4 md:px-6">
<div className="max-w-3xl mx-auto bg-gradient-to-r from-purple-600 to-pink-500 rounded-3xl overflow-hidden shadow-xl">
<div className="p-8 md:p-12 text-white text-center">
<h2 className="text-3xl md:text-4xl font-bold mb-6">Get Your <span className="font-silkscreen">Elato</span> Today!</h2>
<div className="flex flex-col md:flex-row items-center justify-center gap-4 mb-6">
<div className="text-5xl md:text-6xl font-bold">${DEVICE_COST}</div>
<div className="text-xl">
<span className="block">One-time purchase</span>
<span className="block text-purple-100">+ ${SUBSCRIPTION_COST}/month after first FREE month<br /> <span className="text-xs">(or use your own OpenAI API key)</span></span>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mb-8 text-left max-w-2xl mx-auto">
<div className="flex items-start space-x-2">
<div className="bg-white rounded-full p-1 mt-1">
<Zap className="h-4 w-4 text-purple-600" />
</div>
<span>Works with ANY toy or plushie</span>
</div>
<div className="flex items-start space-x-2">
<div className="bg-white rounded-full p-1 mt-1">
<Zap className="h-4 w-4 text-purple-600" />
</div>
<span>Create unlimited AI characters</span>
</div>
<div className="flex items-start space-x-2">
<div className="bg-white rounded-full p-1 mt-1">
<Zap className="h-4 w-4 text-purple-600" />
</div>
<span>First month subscription FREE</span>
</div>
<div className="flex items-start space-x-2">
<div className="bg-white rounded-full p-1 mt-1">
<Zap className="h-4 w-4 text-purple-600" />
</div>
<span>Easy to set up in minutes</span>
</div>
</div>
{/* Character Showcase */}
<CharacterShowcase allPersonalities={adultPersonalities} />
{/* Create Character Showcase */}
<CreateCharacterShowcase />
<Button size="lg" className="bg-white text-purple-600 hover:bg-purple-50 text-lg h-14 px-8">
<Link href={"/products"}>Buy Now</Link>
</Button>
</div>
</div>
</div>
</section>
{/* Testimonials */}
<section className="w-full py-16 bg-purple-50">
<section className="w-full py-16 bg-gradient-to-b from-purple-50 to-white">
<div className="container px-4 md:px-6">
<div className="text-center mb-10">
<h2 className="text-3xl md:text-4xl font-bold mb-6 text-gray-800">
@ -240,6 +215,56 @@ export default async function LandingPage() {
</div>
</section>
{/* Pricing */}
<section className="w-full py-16 bg-white">
<div className="container px-4 md:px-6">
<div className="max-w-3xl mx-auto bg-gradient-to-r from-purple-600 to-pink-500 rounded-3xl overflow-hidden shadow-xl">
<div className="p-8 md:p-12 text-white text-center">
<h2 className="text-3xl md:text-4xl font-bold mb-6">Get Your <span className="font-silkscreen">Elato</span> Today!</h2>
<div className="flex flex-col md:flex-row items-center justify-center gap-4 mb-6">
<div className="text-5xl md:text-6xl font-bold">${DEVICE_COST}</div>
<div className="text-xl">
<span className="block">One-time purchase</span>
<span className="block text-purple-100">+ ${SUBSCRIPTION_COST}/month after first FREE month<br /> <span className="text-xs">(or use your own OpenAI API key)</span></span>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mb-8 text-left max-w-2xl mx-auto">
<div className="flex items-start space-x-2">
<div className="bg-white rounded-full p-1 mt-1">
<Zap className="h-4 w-4 text-purple-600" />
</div>
<span>Works with ANY toy or plushie</span>
</div>
<div className="flex items-start space-x-2">
<div className="bg-white rounded-full p-1 mt-1">
<Zap className="h-4 w-4 text-purple-600" />
</div>
<span>Create unlimited AI characters</span>
</div>
<div className="flex items-start space-x-2">
<div className="bg-white rounded-full p-1 mt-1">
<Zap className="h-4 w-4 text-purple-600" />
</div>
<span>First month subscription FREE</span>
</div>
<div className="flex items-start space-x-2">
<div className="bg-white rounded-full p-1 mt-1">
<Zap className="h-4 w-4 text-purple-600" />
</div>
<span>Easy to set up in minutes</span>
</div>
</div>
<Button size="lg" className="bg-white text-purple-600 hover:bg-purple-50 text-lg h-14 px-8">
<Link href={"/products"}>Buy Now</Link>
</Button>
</div>
</div>
</div>
</section>
{/* FAQ */}
{/* <section className="w-full py-16 bg-purple-50">
<FAQ className="bg-purple-50" titleClassName="text-purple-900" />
@ -247,7 +272,7 @@ export default async function LandingPage() {
{/* CTA */}
<section className="w-full py-20 bg-gradient-to-r from-purple-600 to-pink-500 text-white">
{/* <section className="w-full py-20 bg-gradient-to-r from-purple-600 to-pink-500 text-white">
<div className="container px-4 md:px-6 text-center">
<h2 className="text-3xl md:text-5xl font-bold mb-6">Ready to Bring Your Toys to Life?</h2>
<p className="text-xl mb-8 max-w-2xl mx-auto">
@ -258,7 +283,7 @@ export default async function LandingPage() {
</Button>
<p className="mt-4 text-purple-100">First month subscription FREE, then just ${SUBSCRIPTION_COST}/month <span className="text-xs">(or use your own OpenAI API key)</span></p>
</div>
</section>
</section> */}
</main>
</div>
)

View file

@ -1,5 +1,5 @@
import { Badge } from "@/components/ui/badge";
import { Truck, Bird } from "lucide-react";
import { Truck, Bird, Box } from "lucide-react";
import ProductImageCarousel from "../components/Order/ProductImageCarousel";
import Checkout from "../components/Order/Checkout";
import FAQ from "../components/Order/FAQ";
@ -9,6 +9,9 @@ import KeyFeatures from "../components/Order/KeyFeatures";
import { videoSrc, videoSrc2, videoSrc3, videoSrc4 } from "@/lib/data";
import VideoPlayer from "../components/LandingPage/VideoPlayer";
import ProductCarousel from "../components/ProductCarousel";
import YoutubeDemo from "../components/LandingPage/YoutubeDemo";
import ProductGallery from "../components/LandingPage/ProductGallery";
const SubtitleText =
"All AI characters packed into one fully assembled compact device that can be added to any object.";
@ -19,7 +22,7 @@ export default function Component() {
{/* Hero Section */}
<div className="flex flex-col-reverse gap-6 sm:gap-12 md:flex-row items-start sm:mt-4 mb-16">
<div className="w-full md:w-3/5 px-4">
<VideoPlayer sources={[videoSrc, videoSrc2, videoSrc3, videoSrc4]} />
<ProductGallery />
</div>
<div className="md:w-2/5 px-6 mt-6">
<div className="flex flex-row items-center gap-2 mb-4">
@ -27,13 +30,13 @@ export default function Component() {
variant="secondary"
className="text-sm border-0 flex flex-row items-center gap-1 text-white bg-gradient-to-r from-yellow-500 to-amber-500 hover:bg-gradient-to-bl focus:ring-4 focus:outline-none focus:ring-yellow-300 dark:focus:ring-yellow-800 font-medium rounded-lg text-center"
>
<Bird size={16} /> {"Early Bird"}
<Box size={16} /> {"Early Bird"}
</Badge>
<Badge
variant="secondary"
className="text-sm font-medium rounded-lg text-center flex flex-row items-center gap-1"
>
<Truck size={16} /> {"FREE Shipping"}
<Truck size={16} /> {"Kickstarter Pre-Order!"}
</Badge>
</div>
<h1 className="text-3xl font-silkscreen mt-10 mb-4 font-semibold tracking-tight sm:text-4xl">
@ -49,6 +52,10 @@ export default function Component() {
</p>
</div>
</div>
<div className="my-12 px-4">
<YoutubeDemo />
</div>
{/* <ProductCarousel /> */}
<div className="flex flex-col gap-12 px-6">
{/* Product Details */}

View file

@ -2,11 +2,11 @@ export const defaultToyId: string = "56224f7f-250d-4351-84ee-e4a13b881c7b";
export const defaultPersonalityId: string =
"a1c073e6-653d-40cf-acc1-891331689409";
export const paymentLink = "https://buy.stripe.com/5kAaG6alo1mo0Tu28a";
export const starmoonProductsLink = "https://elatoai.com/products";
export const paymentLink = "https://buy.stripe.com/bIY0033Dc7LB28o9AJ";
export const starmoonProductsLink = "https://elatoai.com/products";
export const discordInviteLink = "https://discord.gg/KJWxDPBRUj";
export const tiktokLink = "https://www.tiktok.com/@elatoai";
export const githubPublicLink = "https://github.com/StarmoonAI/Starmoon";
export const githubPublicLink = "https://github.com/akdeb/ElatoAI";
export const businessDemoLink = "https://calendly.com/akadeb/elato-ai-demo";
export const feedbackFormLink = "https://forms.gle/2QmukEG2FXNwBdee7";
@ -34,7 +34,7 @@ export const userFormNameLabel = "Your Name";
export const INITIAL_CREDITS = 50;
export const SECONDS_PER_CREDIT = (30 * 60) / INITIAL_CREDITS; // 30 minutes equals 50 credits
export const DEVICE_COST = 69;
export const DEVICE_COST = 55;
export const ORIGINAL_COST = 111;
export const SUBSCRIPTION_COST = 10;

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

View file

@ -0,0 +1 @@
<svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 116.84 21.04" width="3650" height="660"><defs><style>.cls-1{fill:#e7352c;}.cls-2{fill:#333;}</style></defs><title>导航栏-菜单-logo</title><path class="cls-1" d="M6.93,15.65a1.48,1.48,0,1,1-1.48-1.48,1.48,1.48,0,0,1,1.48,1.48"/><path class="cls-1" d="M19.84,14.11a15.34,15.34,0,0,0-13-13A9.73,9.73,0,0,0,4.69,2.66V4.09A12.18,12.18,0,0,1,16.86,16.25h1.43a10.25,10.25,0,0,0,1.55-2.14"/><path class="cls-1" d="M21,9.62A9.62,9.62,0,0,0,11.33,0c-.34,0-.67,0-1,.05l-.22.64A16.55,16.55,0,0,1,20.25,10.82l.64-.23c0-.32.06-.64.06-1"/><path class="cls-1" d="M11.44,21A11.44,11.44,0,0,1,0,9.61,11.36,11.36,0,0,1,3.35,1.52L4,2.13a10.56,10.56,0,0,0,0,15,10.56,10.56,0,0,0,15,0l.61.61A11.35,11.35,0,0,1,11.44,21"/><path class="cls-1" d="M11.31,16.91A6.65,6.65,0,0,0,8.7,11,6.51,6.51,0,0,0,5.35,9.64.61.61,0,0,1,4.82,9a.59.59,0,0,1,.65-.54,7.85,7.85,0,0,1,7,8.58,6.85,6.85,0,0,1-.26,1.35l1.74.49a9.66,9.66,0,0,0,1.5-.57,10.64,10.64,0,0,0,.19-2.05A11,11,0,0,0,6.31,5.4a4.84,4.84,0,0,0-1.75,0A3.81,3.81,0,0,0,2.67,6.57a3.74,3.74,0,0,0,1.67,6,8.66,8.66,0,0,0,.94.17h0a3.51,3.51,0,0,1,2.92,3.46,3.47,3.47,0,0,1-.56,1.89l1.2.77a8.91,8.91,0,0,0,1.8.3,6.58,6.58,0,0,0,.66-2.3"/><rect class="cls-2" x="104.18" y="3.17" width="2.21" height="14.7"/><path class="cls-2" d="M68.39,11.73a2.51,2.51,0,0,0,1.46-2.41V5.81a2.64,2.64,0,0,0-.78-1.95,2.6,2.6,0,0,0-1.78-.7H60.91V17.89h2.22V12H65.4a2,2,0,0,1,2,1.74l.87,4.17h2.42L69.75,14a3,3,0,0,0-1.36-2.22M63.13,5.24v0h3.8a.75.75,0,0,1,.71.84v3a.75.75,0,0,1-.71.84h-3.8Z"/><path class="cls-2" d="M29.09,3.87a2.67,2.67,0,0,0-.78,2v9.4a2.64,2.64,0,0,0,.78,1.95,2.62,2.62,0,0,0,1.78.7h6V15.82h-5.6a.76.76,0,0,1-.72-.84V11.2H36V9.14H30.52V6.08a.76.76,0,0,1,.72-.84h5.6V3.17h-6a2.66,2.66,0,0,0-1.78.7"/><path class="cls-2" d="M111.24,5.24h5.6V3.17h-6a2.66,2.66,0,0,0-1.78.7,2.71,2.71,0,0,0-.78,2v12h2.21V11.2H116V9.14h-5.52V6.08a.76.76,0,0,1,.72-.84"/><path class="cls-2" d="M45.2,9.14H41.77A.79.79,0,0,1,41,8.35V6.08a.75.75,0,0,1,.71-.84H47.2V3.17H41.33a2.66,2.66,0,0,0-1.78.7,2.67,2.67,0,0,0-.78,2V8.88a2.59,2.59,0,0,0,2.58,2.59h3.44a.79.79,0,0,1,.79.79V15a.76.76,0,0,1-.72.84H38.77v2.07h6.46a2.55,2.55,0,0,0,2.56-2.66v-3.5A2.58,2.58,0,0,0,45.2,9.14"/><path class="cls-2" d="M72.65,3.87a2.67,2.67,0,0,0-.78,2v9.4a2.64,2.64,0,0,0,.78,1.95,2.62,2.62,0,0,0,1.78.7h6V15.82h-5.6a.75.75,0,0,1-.71-.84V11.2h5.51V9.14H74.08V6.08a.75.75,0,0,1,.71-.84h5.6V3.17h-6a2.66,2.66,0,0,0-1.78.7"/><path class="cls-2" d="M88.76,9.14H85.33a.79.79,0,0,1-.79-.79V6.08a.75.75,0,0,1,.71-.84h5.51V3.17H84.88a2.64,2.64,0,0,0-1.77.7,2.67,2.67,0,0,0-.78,2V8.88a2.58,2.58,0,0,0,2.58,2.59h3.43a.79.79,0,0,1,.79.79V15a.75.75,0,0,1-.71.84H82.33v2.07h6.46a2.6,2.6,0,0,0,1.77-.71,2.63,2.63,0,0,0,.79-2v-3.5a2.58,2.58,0,0,0-2.59-2.58"/><path class="cls-2" d="M99.6,9.14H96.17a.79.79,0,0,1-.79-.79V6.08a.75.75,0,0,1,.71-.84h5.51V3.17H95.73a2.66,2.66,0,0,0-1.78.7,2.67,2.67,0,0,0-.78,2V8.88a2.59,2.59,0,0,0,2.58,2.59h3.44a.79.79,0,0,1,.79.79V15a.76.76,0,0,1-.72.84H93.17v2.07h6.46a2.55,2.55,0,0,0,2.56-2.66v-3.5A2.58,2.58,0,0,0,99.6,9.14"/><path class="cls-2" d="M56.48,3.16H49.79V17.89H52V12.17h4.48a2.57,2.57,0,0,0,1.77-.7,2.63,2.63,0,0,0,.79-2V5.81a2.65,2.65,0,0,0-.79-1.95,2.57,2.57,0,0,0-1.77-.7m.34,6.11a.75.75,0,0,1-.71.84H52V5.22h4.11a.75.75,0,0,1,.71.84Z"/></svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

1
node_modules/.bin/mkdirp generated vendored Symbolic link
View file

@ -0,0 +1 @@
../mkdirp/dist/cjs/src/bin.js

1
node_modules/.bin/supabase generated vendored Symbolic link
View file

@ -0,0 +1 @@
../supabase/bin/supabase

356
node_modules/.package-lock.json generated vendored Normal file
View file

@ -0,0 +1,356 @@
{
"name": "ElatoAI",
"lockfileVersion": 3,
"requires": true,
"packages": {
"node_modules/@isaacs/fs-minipass": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@isaacs/fs-minipass/-/fs-minipass-4.0.1.tgz",
"integrity": "sha512-wgm9Ehl2jpeqP3zw/7mo3kRHFp5MEDhqAdwy1fTGkHAwnkGOVsgpvQhL8B5n1qlb01jV3n/bI0ZfZp5lWA1k4w==",
"dev": true,
"license": "ISC",
"dependencies": {
"minipass": "^7.0.4"
},
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/agent-base": {
"version": "7.1.3",
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.3.tgz",
"integrity": "sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 14"
}
},
"node_modules/bin-links": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/bin-links/-/bin-links-5.0.0.tgz",
"integrity": "sha512-sdleLVfCjBtgO5cNjA2HVRvWBJAHs4zwenaCPMNJAJU0yNxpzj80IpjOIimkpkr+mhlA+how5poQtt53PygbHA==",
"dev": true,
"license": "ISC",
"dependencies": {
"cmd-shim": "^7.0.0",
"npm-normalize-package-bin": "^4.0.0",
"proc-log": "^5.0.0",
"read-cmd-shim": "^5.0.0",
"write-file-atomic": "^6.0.0"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/chownr": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chownr/-/chownr-3.0.0.tgz",
"integrity": "sha512-+IxzY9BZOQd/XuYPRmrvEVjF/nqj5kgT4kEq7VofrDoM1MxoRjEWkrCC3EtLi59TVawxTAn+orJwFQcrqEN1+g==",
"dev": true,
"license": "BlueOak-1.0.0",
"engines": {
"node": ">=18"
}
},
"node_modules/cmd-shim": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/cmd-shim/-/cmd-shim-7.0.0.tgz",
"integrity": "sha512-rtpaCbr164TPPh+zFdkWpCyZuKkjpAzODfaZCf/SVJZzJN+4bHQb/LP3Jzq5/+84um3XXY8r548XiWKSborwVw==",
"dev": true,
"license": "ISC",
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/data-uri-to-buffer": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
"integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 12"
}
},
"node_modules/debug": {
"version": "4.4.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz",
"integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==",
"dev": true,
"license": "MIT",
"dependencies": {
"ms": "^2.1.3"
},
"engines": {
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
}
},
"node_modules/fetch-blob": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
"integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "paypal",
"url": "https://paypal.me/jimmywarting"
}
],
"license": "MIT",
"dependencies": {
"node-domexception": "^1.0.0",
"web-streams-polyfill": "^3.0.3"
},
"engines": {
"node": "^12.20 || >= 14.13"
}
},
"node_modules/formdata-polyfill": {
"version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
"integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
"dev": true,
"license": "MIT",
"dependencies": {
"fetch-blob": "^3.1.2"
},
"engines": {
"node": ">=12.20.0"
}
},
"node_modules/https-proxy-agent": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
"integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
"dev": true,
"license": "MIT",
"dependencies": {
"agent-base": "^7.1.2",
"debug": "4"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
"integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.8.19"
}
},
"node_modules/minipass": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz",
"integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=16 || 14 >=14.17"
}
},
"node_modules/minizlib": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/minizlib/-/minizlib-3.0.2.tgz",
"integrity": "sha512-oG62iEk+CYt5Xj2YqI5Xi9xWUeZhDI8jjQmC5oThVH5JGCTgIjr7ciJDzC7MBzYd//WvR1OTmP5Q38Q8ShQtVA==",
"dev": true,
"license": "MIT",
"dependencies": {
"minipass": "^7.1.2"
},
"engines": {
"node": ">= 18"
}
},
"node_modules/mkdirp": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-3.0.1.tgz",
"integrity": "sha512-+NsyUUAZDmo6YVHzL/stxSu3t9YS1iljliy3BSDrXJ/dkn1KYdmtZODGGjLcc9XLgVVpH4KshHB8XmZgMhaBXg==",
"dev": true,
"license": "MIT",
"bin": {
"mkdirp": "dist/cjs/src/bin.js"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
"dev": true,
"license": "MIT"
},
"node_modules/node-domexception": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
"integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
"dev": true,
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/jimmywarting"
},
{
"type": "github",
"url": "https://paypal.me/jimmywarting"
}
],
"license": "MIT",
"engines": {
"node": ">=10.5.0"
}
},
"node_modules/node-fetch": {
"version": "3.3.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
"integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
"dev": true,
"license": "MIT",
"dependencies": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"engines": {
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/node-fetch"
}
},
"node_modules/npm-normalize-package-bin": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-4.0.0.tgz",
"integrity": "sha512-TZKxPvItzai9kN9H/TkmCtx/ZN/hvr3vUycjlfmH0ootY9yFBzNOpiXAdIn1Iteqsvk4lQn6B5PTrt+n6h8k/w==",
"dev": true,
"license": "ISC",
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/proc-log": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz",
"integrity": "sha512-Azwzvl90HaF0aCz1JrDdXQykFakSSNPaPoiZ9fm5qJIMHioDZEi7OAdRwSm6rSoPtY3Qutnm3L7ogmg3dc+wbQ==",
"dev": true,
"license": "ISC",
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/read-cmd-shim": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/read-cmd-shim/-/read-cmd-shim-5.0.0.tgz",
"integrity": "sha512-SEbJV7tohp3DAAILbEMPXavBjAnMN0tVnh4+9G8ihV4Pq3HYF9h8QNez9zkJ1ILkv9G2BjdzwctznGZXgu/HGw==",
"dev": true,
"license": "ISC",
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/supabase": {
"version": "2.20.12",
"resolved": "https://registry.npmjs.org/supabase/-/supabase-2.20.12.tgz",
"integrity": "sha512-8UTRRvQdMsfs7jcHPDfv6cFYwrar5OyqidtB8GSdPCaKfEP+0n4TwCVwu7H0tDCbCYs28HDZDzQAZ8Ox+aVIiA==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"dependencies": {
"bin-links": "^5.0.0",
"https-proxy-agent": "^7.0.2",
"node-fetch": "^3.3.2",
"tar": "7.4.3"
},
"bin": {
"supabase": "bin/supabase"
},
"engines": {
"npm": ">=8"
}
},
"node_modules/tar": {
"version": "7.4.3",
"resolved": "https://registry.npmjs.org/tar/-/tar-7.4.3.tgz",
"integrity": "sha512-5S7Va8hKfV7W5U6g3aYxXmlPoZVAwUMy9AOKyF2fVuZa2UD3qZjg578OrLRt8PcNN1PleVaL/5/yYATNL0ICUw==",
"dev": true,
"license": "ISC",
"dependencies": {
"@isaacs/fs-minipass": "^4.0.0",
"chownr": "^3.0.0",
"minipass": "^7.1.2",
"minizlib": "^3.0.1",
"mkdirp": "^3.0.1",
"yallist": "^5.0.0"
},
"engines": {
"node": ">=18"
}
},
"node_modules/web-streams-polyfill": {
"version": "3.3.3",
"resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
"integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 8"
}
},
"node_modules/write-file-atomic": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-6.0.0.tgz",
"integrity": "sha512-GmqrO8WJ1NuzJ2DrziEI2o57jKAVIQNf8a18W3nCYU3H7PNWqCCVTeH6/NQE93CIllIgQS98rrmVkYgTX9fFJQ==",
"dev": true,
"license": "ISC",
"dependencies": {
"imurmurhash": "^0.1.4",
"signal-exit": "^4.0.1"
},
"engines": {
"node": "^18.17.0 || >=20.5.0"
}
},
"node_modules/yallist": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-5.0.0.tgz",
"integrity": "sha512-YgvUTfwqyc7UXVMrB+SImsVYSmTS8X/tSrtdNZMImM+n7+QTriRXyXim0mBrTXNeqzVF0KWGgHPeiyViFFrNDw==",
"dev": true,
"license": "BlueOak-1.0.0",
"engines": {
"node": ">=18"
}
}
}
}

15
node_modules/@isaacs/fs-minipass/LICENSE generated vendored Normal file
View file

@ -0,0 +1,15 @@
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

71
node_modules/@isaacs/fs-minipass/README.md generated vendored Normal file
View file

@ -0,0 +1,71 @@
# fs-minipass
Filesystem streams based on [minipass](http://npm.im/minipass).
4 classes are exported:
- ReadStream
- ReadStreamSync
- WriteStream
- WriteStreamSync
When using `ReadStreamSync`, all of the data is made available
immediately upon consuming the stream. Nothing is buffered in memory
when the stream is constructed. If the stream is piped to a writer,
then it will synchronously `read()` and emit data into the writer as
fast as the writer can consume it. (That is, it will respect
backpressure.) If you call `stream.read()` then it will read the
entire file and return the contents.
When using `WriteStreamSync`, every write is flushed to the file
synchronously. If your writes all come in a single tick, then it'll
write it all out in a single tick. It's as synchronous as you are.
The async versions work much like their node builtin counterparts,
with the exception of introducing significantly less Stream machinery
overhead.
## USAGE
It's just streams, you pipe them or read() them or write() to them.
```js
import { ReadStream, WriteStream } from 'fs-minipass'
// or: const { ReadStream, WriteStream } = require('fs-minipass')
const readStream = new ReadStream('file.txt')
const writeStream = new WriteStream('output.txt')
writeStream.write('some file header or whatever\n')
readStream.pipe(writeStream)
```
## ReadStream(path, options)
Path string is required, but somewhat irrelevant if an open file
descriptor is passed in as an option.
Options:
- `fd` Pass in a numeric file descriptor, if the file is already open.
- `readSize` The size of reads to do, defaults to 16MB
- `size` The size of the file, if known. Prevents zero-byte read()
call at the end.
- `autoClose` Set to `false` to prevent the file descriptor from being
closed when the file is done being read.
## WriteStream(path, options)
Path string is required, but somewhat irrelevant if an open file
descriptor is passed in as an option.
Options:
- `fd` Pass in a numeric file descriptor, if the file is already open.
- `mode` The mode to create the file with. Defaults to `0o666`.
- `start` The position in the file to start reading. If not
specified, then the file will start writing at position zero, and be
truncated by default.
- `autoClose` Set to `false` to prevent the file descriptor from being
closed when the stream is ended.
- `flags` Flags to use when opening the file. Irrelevant if `fd` is
passed in, since file won't be opened in that case. Defaults to
`'a'` if a `pos` is specified, or `'w'` otherwise.

View file

@ -0,0 +1,118 @@
/// <reference types="node" />
/// <reference types="node" />
/// <reference types="node" />
import EE from 'events';
import { Minipass } from 'minipass';
declare const _autoClose: unique symbol;
declare const _close: unique symbol;
declare const _ended: unique symbol;
declare const _fd: unique symbol;
declare const _finished: unique symbol;
declare const _flags: unique symbol;
declare const _flush: unique symbol;
declare const _handleChunk: unique symbol;
declare const _makeBuf: unique symbol;
declare const _mode: unique symbol;
declare const _needDrain: unique symbol;
declare const _onerror: unique symbol;
declare const _onopen: unique symbol;
declare const _onread: unique symbol;
declare const _onwrite: unique symbol;
declare const _open: unique symbol;
declare const _path: unique symbol;
declare const _pos: unique symbol;
declare const _queue: unique symbol;
declare const _read: unique symbol;
declare const _readSize: unique symbol;
declare const _reading: unique symbol;
declare const _remain: unique symbol;
declare const _size: unique symbol;
declare const _write: unique symbol;
declare const _writing: unique symbol;
declare const _defaultFlag: unique symbol;
declare const _errored: unique symbol;
export type ReadStreamOptions = Minipass.Options<Minipass.ContiguousData> & {
fd?: number;
readSize?: number;
size?: number;
autoClose?: boolean;
};
export type ReadStreamEvents = Minipass.Events<Minipass.ContiguousData> & {
open: [fd: number];
};
export declare class ReadStream extends Minipass<Minipass.ContiguousData, Buffer, ReadStreamEvents> {
[_errored]: boolean;
[_fd]?: number;
[_path]: string;
[_readSize]: number;
[_reading]: boolean;
[_size]: number;
[_remain]: number;
[_autoClose]: boolean;
constructor(path: string, opt: ReadStreamOptions);
get fd(): number | undefined;
get path(): string;
write(): void;
end(): void;
[_open](): void;
[_onopen](er?: NodeJS.ErrnoException | null, fd?: number): void;
[_makeBuf](): Buffer;
[_read](): void;
[_onread](er?: NodeJS.ErrnoException | null, br?: number, buf?: Buffer): void;
[_close](): void;
[_onerror](er: NodeJS.ErrnoException): void;
[_handleChunk](br: number, buf: Buffer): boolean;
emit<Event extends keyof ReadStreamEvents>(ev: Event, ...args: ReadStreamEvents[Event]): boolean;
}
export declare class ReadStreamSync extends ReadStream {
[_open](): void;
[_read](): void;
[_close](): void;
}
export type WriteStreamOptions = {
fd?: number;
autoClose?: boolean;
mode?: number;
captureRejections?: boolean;
start?: number;
flags?: string;
};
export declare class WriteStream extends EE {
readable: false;
writable: boolean;
[_errored]: boolean;
[_writing]: boolean;
[_ended]: boolean;
[_queue]: Buffer[];
[_needDrain]: boolean;
[_path]: string;
[_mode]: number;
[_autoClose]: boolean;
[_fd]?: number;
[_defaultFlag]: boolean;
[_flags]: string;
[_finished]: boolean;
[_pos]?: number;
constructor(path: string, opt: WriteStreamOptions);
emit(ev: string, ...args: any[]): boolean;
get fd(): number | undefined;
get path(): string;
[_onerror](er: NodeJS.ErrnoException): void;
[_open](): void;
[_onopen](er?: null | NodeJS.ErrnoException, fd?: number): void;
end(buf: string, enc?: BufferEncoding): this;
end(buf?: Buffer, enc?: undefined): this;
write(buf: string, enc?: BufferEncoding): boolean;
write(buf: Buffer, enc?: undefined): boolean;
[_write](buf: Buffer): void;
[_onwrite](er?: null | NodeJS.ErrnoException, bw?: number): void;
[_flush](): void;
[_close](): void;
}
export declare class WriteStreamSync extends WriteStream {
[_open](): void;
[_close](): void;
[_write](buf: Buffer): void;
}
export {};
//# sourceMappingURL=index.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAInC,QAAA,MAAM,UAAU,eAAuB,CAAA;AACvC,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC/B,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC/B,QAAA,MAAM,GAAG,eAAgB,CAAA;AACzB,QAAA,MAAM,SAAS,eAAsB,CAAA;AACrC,QAAA,MAAM,MAAM,eAAmB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,CAAC,cAAc;IAMpC,CAAC,KAAK,CAAC;IAMP,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,EAAE,MAAM;IAoBxD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,cAAc,GAAG,IAAI;IAC5C,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI;IAoBxC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,cAAc,GAAG,OAAO;IACjD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,GAAG,OAAO;IAsB5C,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM;IAWpB,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,EAAE,MAAM;IAwBzD,CAAC,MAAM,CAAC;IAgBR,CAAC,MAAM,CAAC;CAST;AAED,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,CAAC,KAAK,CAAC,IAAI,IAAI;IAsBf,CAAC,MAAM,CAAC;IASR,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM;CAmBrB"}

430
node_modules/@isaacs/fs-minipass/dist/commonjs/index.js generated vendored Normal file
View file

@ -0,0 +1,430 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.WriteStreamSync = exports.WriteStream = exports.ReadStreamSync = exports.ReadStream = void 0;
const events_1 = __importDefault(require("events"));
const fs_1 = __importDefault(require("fs"));
const minipass_1 = require("minipass");
const writev = fs_1.default.writev;
const _autoClose = Symbol('_autoClose');
const _close = Symbol('_close');
const _ended = Symbol('_ended');
const _fd = Symbol('_fd');
const _finished = Symbol('_finished');
const _flags = Symbol('_flags');
const _flush = Symbol('_flush');
const _handleChunk = Symbol('_handleChunk');
const _makeBuf = Symbol('_makeBuf');
const _mode = Symbol('_mode');
const _needDrain = Symbol('_needDrain');
const _onerror = Symbol('_onerror');
const _onopen = Symbol('_onopen');
const _onread = Symbol('_onread');
const _onwrite = Symbol('_onwrite');
const _open = Symbol('_open');
const _path = Symbol('_path');
const _pos = Symbol('_pos');
const _queue = Symbol('_queue');
const _read = Symbol('_read');
const _readSize = Symbol('_readSize');
const _reading = Symbol('_reading');
const _remain = Symbol('_remain');
const _size = Symbol('_size');
const _write = Symbol('_write');
const _writing = Symbol('_writing');
const _defaultFlag = Symbol('_defaultFlag');
const _errored = Symbol('_errored');
class ReadStream extends minipass_1.Minipass {
[_errored] = false;
[_fd];
[_path];
[_readSize];
[_reading] = false;
[_size];
[_remain];
[_autoClose];
constructor(path, opt) {
opt = opt || {};
super(opt);
this.readable = true;
this.writable = false;
if (typeof path !== 'string') {
throw new TypeError('path must be a string');
}
this[_errored] = false;
this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined;
this[_path] = path;
this[_readSize] = opt.readSize || 16 * 1024 * 1024;
this[_reading] = false;
this[_size] = typeof opt.size === 'number' ? opt.size : Infinity;
this[_remain] = this[_size];
this[_autoClose] =
typeof opt.autoClose === 'boolean' ? opt.autoClose : true;
if (typeof this[_fd] === 'number') {
this[_read]();
}
else {
this[_open]();
}
}
get fd() {
return this[_fd];
}
get path() {
return this[_path];
}
//@ts-ignore
write() {
throw new TypeError('this is a readable stream');
}
//@ts-ignore
end() {
throw new TypeError('this is a readable stream');
}
[_open]() {
fs_1.default.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd));
}
[_onopen](er, fd) {
if (er) {
this[_onerror](er);
}
else {
this[_fd] = fd;
this.emit('open', fd);
this[_read]();
}
}
[_makeBuf]() {
return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]));
}
[_read]() {
if (!this[_reading]) {
this[_reading] = true;
const buf = this[_makeBuf]();
/* c8 ignore start */
if (buf.length === 0) {
return process.nextTick(() => this[_onread](null, 0, buf));
}
/* c8 ignore stop */
fs_1.default.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b));
}
}
[_onread](er, br, buf) {
this[_reading] = false;
if (er) {
this[_onerror](er);
}
else if (this[_handleChunk](br, buf)) {
this[_read]();
}
}
[_close]() {
if (this[_autoClose] && typeof this[_fd] === 'number') {
const fd = this[_fd];
this[_fd] = undefined;
fs_1.default.close(fd, er => er ? this.emit('error', er) : this.emit('close'));
}
}
[_onerror](er) {
this[_reading] = true;
this[_close]();
this.emit('error', er);
}
[_handleChunk](br, buf) {
let ret = false;
// no effect if infinite
this[_remain] -= br;
if (br > 0) {
ret = super.write(br < buf.length ? buf.subarray(0, br) : buf);
}
if (br === 0 || this[_remain] <= 0) {
ret = false;
this[_close]();
super.end();
}
return ret;
}
emit(ev, ...args) {
switch (ev) {
case 'prefinish':
case 'finish':
return false;
case 'drain':
if (typeof this[_fd] === 'number') {
this[_read]();
}
return false;
case 'error':
if (this[_errored]) {
return false;
}
this[_errored] = true;
return super.emit(ev, ...args);
default:
return super.emit(ev, ...args);
}
}
}
exports.ReadStream = ReadStream;
class ReadStreamSync extends ReadStream {
[_open]() {
let threw = true;
try {
this[_onopen](null, fs_1.default.openSync(this[_path], 'r'));
threw = false;
}
finally {
if (threw) {
this[_close]();
}
}
}
[_read]() {
let threw = true;
try {
if (!this[_reading]) {
this[_reading] = true;
do {
const buf = this[_makeBuf]();
/* c8 ignore start */
const br = buf.length === 0
? 0
: fs_1.default.readSync(this[_fd], buf, 0, buf.length, null);
/* c8 ignore stop */
if (!this[_handleChunk](br, buf)) {
break;
}
} while (true);
this[_reading] = false;
}
threw = false;
}
finally {
if (threw) {
this[_close]();
}
}
}
[_close]() {
if (this[_autoClose] && typeof this[_fd] === 'number') {
const fd = this[_fd];
this[_fd] = undefined;
fs_1.default.closeSync(fd);
this.emit('close');
}
}
}
exports.ReadStreamSync = ReadStreamSync;
class WriteStream extends events_1.default {
readable = false;
writable = true;
[_errored] = false;
[_writing] = false;
[_ended] = false;
[_queue] = [];
[_needDrain] = false;
[_path];
[_mode];
[_autoClose];
[_fd];
[_defaultFlag];
[_flags];
[_finished] = false;
[_pos];
constructor(path, opt) {
opt = opt || {};
super(opt);
this[_path] = path;
this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined;
this[_mode] = opt.mode === undefined ? 0o666 : opt.mode;
this[_pos] = typeof opt.start === 'number' ? opt.start : undefined;
this[_autoClose] =
typeof opt.autoClose === 'boolean' ? opt.autoClose : true;
// truncating makes no sense when writing into the middle
const defaultFlag = this[_pos] !== undefined ? 'r+' : 'w';
this[_defaultFlag] = opt.flags === undefined;
this[_flags] = opt.flags === undefined ? defaultFlag : opt.flags;
if (this[_fd] === undefined) {
this[_open]();
}
}
emit(ev, ...args) {
if (ev === 'error') {
if (this[_errored]) {
return false;
}
this[_errored] = true;
}
return super.emit(ev, ...args);
}
get fd() {
return this[_fd];
}
get path() {
return this[_path];
}
[_onerror](er) {
this[_close]();
this[_writing] = true;
this.emit('error', er);
}
[_open]() {
fs_1.default.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd));
}
[_onopen](er, fd) {
if (this[_defaultFlag] &&
this[_flags] === 'r+' &&
er &&
er.code === 'ENOENT') {
this[_flags] = 'w';
this[_open]();
}
else if (er) {
this[_onerror](er);
}
else {
this[_fd] = fd;
this.emit('open', fd);
if (!this[_writing]) {
this[_flush]();
}
}
}
end(buf, enc) {
if (buf) {
//@ts-ignore
this.write(buf, enc);
}
this[_ended] = true;
// synthetic after-write logic, where drain/finish live
if (!this[_writing] &&
!this[_queue].length &&
typeof this[_fd] === 'number') {
this[_onwrite](null, 0);
}
return this;
}
write(buf, enc) {
if (typeof buf === 'string') {
buf = Buffer.from(buf, enc);
}
if (this[_ended]) {
this.emit('error', new Error('write() after end()'));
return false;
}
if (this[_fd] === undefined || this[_writing] || this[_queue].length) {
this[_queue].push(buf);
this[_needDrain] = true;
return false;
}
this[_writing] = true;
this[_write](buf);
return true;
}
[_write](buf) {
fs_1.default.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw));
}
[_onwrite](er, bw) {
if (er) {
this[_onerror](er);
}
else {
if (this[_pos] !== undefined && typeof bw === 'number') {
this[_pos] += bw;
}
if (this[_queue].length) {
this[_flush]();
}
else {
this[_writing] = false;
if (this[_ended] && !this[_finished]) {
this[_finished] = true;
this[_close]();
this.emit('finish');
}
else if (this[_needDrain]) {
this[_needDrain] = false;
this.emit('drain');
}
}
}
}
[_flush]() {
if (this[_queue].length === 0) {
if (this[_ended]) {
this[_onwrite](null, 0);
}
}
else if (this[_queue].length === 1) {
this[_write](this[_queue].pop());
}
else {
const iovec = this[_queue];
this[_queue] = [];
writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw));
}
}
[_close]() {
if (this[_autoClose] && typeof this[_fd] === 'number') {
const fd = this[_fd];
this[_fd] = undefined;
fs_1.default.close(fd, er => er ? this.emit('error', er) : this.emit('close'));
}
}
}
exports.WriteStream = WriteStream;
class WriteStreamSync extends WriteStream {
[_open]() {
let fd;
// only wrap in a try{} block if we know we'll retry, to avoid
// the rethrow obscuring the error's source frame in most cases.
if (this[_defaultFlag] && this[_flags] === 'r+') {
try {
fd = fs_1.default.openSync(this[_path], this[_flags], this[_mode]);
}
catch (er) {
if (er?.code === 'ENOENT') {
this[_flags] = 'w';
return this[_open]();
}
else {
throw er;
}
}
}
else {
fd = fs_1.default.openSync(this[_path], this[_flags], this[_mode]);
}
this[_onopen](null, fd);
}
[_close]() {
if (this[_autoClose] && typeof this[_fd] === 'number') {
const fd = this[_fd];
this[_fd] = undefined;
fs_1.default.closeSync(fd);
this.emit('close');
}
}
[_write](buf) {
// throw the original, but try to close if it fails
let threw = true;
try {
this[_onwrite](null, fs_1.default.writeSync(this[_fd], buf, 0, buf.length, this[_pos]));
threw = false;
}
finally {
if (threw) {
try {
this[_close]();
}
catch {
// ok error
}
}
}
}
}
exports.WriteStreamSync = WriteStreamSync;
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,3 @@
{
"type": "commonjs"
}

118
node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,118 @@
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
/// <reference types="node" resolution-mode="require"/>
import EE from 'events';
import { Minipass } from 'minipass';
declare const _autoClose: unique symbol;
declare const _close: unique symbol;
declare const _ended: unique symbol;
declare const _fd: unique symbol;
declare const _finished: unique symbol;
declare const _flags: unique symbol;
declare const _flush: unique symbol;
declare const _handleChunk: unique symbol;
declare const _makeBuf: unique symbol;
declare const _mode: unique symbol;
declare const _needDrain: unique symbol;
declare const _onerror: unique symbol;
declare const _onopen: unique symbol;
declare const _onread: unique symbol;
declare const _onwrite: unique symbol;
declare const _open: unique symbol;
declare const _path: unique symbol;
declare const _pos: unique symbol;
declare const _queue: unique symbol;
declare const _read: unique symbol;
declare const _readSize: unique symbol;
declare const _reading: unique symbol;
declare const _remain: unique symbol;
declare const _size: unique symbol;
declare const _write: unique symbol;
declare const _writing: unique symbol;
declare const _defaultFlag: unique symbol;
declare const _errored: unique symbol;
export type ReadStreamOptions = Minipass.Options<Minipass.ContiguousData> & {
fd?: number;
readSize?: number;
size?: number;
autoClose?: boolean;
};
export type ReadStreamEvents = Minipass.Events<Minipass.ContiguousData> & {
open: [fd: number];
};
export declare class ReadStream extends Minipass<Minipass.ContiguousData, Buffer, ReadStreamEvents> {
[_errored]: boolean;
[_fd]?: number;
[_path]: string;
[_readSize]: number;
[_reading]: boolean;
[_size]: number;
[_remain]: number;
[_autoClose]: boolean;
constructor(path: string, opt: ReadStreamOptions);
get fd(): number | undefined;
get path(): string;
write(): void;
end(): void;
[_open](): void;
[_onopen](er?: NodeJS.ErrnoException | null, fd?: number): void;
[_makeBuf](): Buffer;
[_read](): void;
[_onread](er?: NodeJS.ErrnoException | null, br?: number, buf?: Buffer): void;
[_close](): void;
[_onerror](er: NodeJS.ErrnoException): void;
[_handleChunk](br: number, buf: Buffer): boolean;
emit<Event extends keyof ReadStreamEvents>(ev: Event, ...args: ReadStreamEvents[Event]): boolean;
}
export declare class ReadStreamSync extends ReadStream {
[_open](): void;
[_read](): void;
[_close](): void;
}
export type WriteStreamOptions = {
fd?: number;
autoClose?: boolean;
mode?: number;
captureRejections?: boolean;
start?: number;
flags?: string;
};
export declare class WriteStream extends EE {
readable: false;
writable: boolean;
[_errored]: boolean;
[_writing]: boolean;
[_ended]: boolean;
[_queue]: Buffer[];
[_needDrain]: boolean;
[_path]: string;
[_mode]: number;
[_autoClose]: boolean;
[_fd]?: number;
[_defaultFlag]: boolean;
[_flags]: string;
[_finished]: boolean;
[_pos]?: number;
constructor(path: string, opt: WriteStreamOptions);
emit(ev: string, ...args: any[]): boolean;
get fd(): number | undefined;
get path(): string;
[_onerror](er: NodeJS.ErrnoException): void;
[_open](): void;
[_onopen](er?: null | NodeJS.ErrnoException, fd?: number): void;
end(buf: string, enc?: BufferEncoding): this;
end(buf?: Buffer, enc?: undefined): this;
write(buf: string, enc?: BufferEncoding): boolean;
write(buf: Buffer, enc?: undefined): boolean;
[_write](buf: Buffer): void;
[_onwrite](er?: null | NodeJS.ErrnoException, bw?: number): void;
[_flush](): void;
[_close](): void;
}
export declare class WriteStreamSync extends WriteStream {
[_open](): void;
[_close](): void;
[_write](buf: Buffer): void;
}
export {};
//# sourceMappingURL=index.d.ts.map

View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,OAAO,EAAE,MAAM,QAAQ,CAAA;AAEvB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAInC,QAAA,MAAM,UAAU,eAAuB,CAAA;AACvC,QAAA,MAAM,MAAM,eAAmB,CAAA;AAC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E,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;IAU/B,IAAI,EAAE,uBAEL;IAED,IAAI,IAAI,WAEP;IAED,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,MAAM,CAAC,cAAc;IAMpC,CAAC,KAAK,CAAC;IAMP,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,EAAE,MAAM;IAoBxD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,cAAc,GAAG,IAAI;IAC5C,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,GAAG,IAAI;IAoBxC,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,cAAc,GAAG,OAAO;IACjD,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,SAAS,GAAG,OAAO;IAsB5C,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM;IAWpB,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,cAAc,EAAE,EAAE,CAAC,EAAE,MAAM;IAwBzD,CAAC,MAAM,CAAC;IAgBR,CAAC,MAAM,CAAC;CAST;AAED,qBAAa,eAAgB,SAAQ,WAAW;IAC9C,CAAC,KAAK,CAAC,IAAI,IAAI;IAsBf,CAAC,MAAM,CAAC;IASR,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,MAAM;CAmBrB"}

420
node_modules/@isaacs/fs-minipass/dist/esm/index.js generated vendored Normal file
View file

@ -0,0 +1,420 @@
import EE from 'events';
import fs from 'fs';
import { Minipass } from 'minipass';
const writev = fs.writev;
const _autoClose = Symbol('_autoClose');
const _close = Symbol('_close');
const _ended = Symbol('_ended');
const _fd = Symbol('_fd');
const _finished = Symbol('_finished');
const _flags = Symbol('_flags');
const _flush = Symbol('_flush');
const _handleChunk = Symbol('_handleChunk');
const _makeBuf = Symbol('_makeBuf');
const _mode = Symbol('_mode');
const _needDrain = Symbol('_needDrain');
const _onerror = Symbol('_onerror');
const _onopen = Symbol('_onopen');
const _onread = Symbol('_onread');
const _onwrite = Symbol('_onwrite');
const _open = Symbol('_open');
const _path = Symbol('_path');
const _pos = Symbol('_pos');
const _queue = Symbol('_queue');
const _read = Symbol('_read');
const _readSize = Symbol('_readSize');
const _reading = Symbol('_reading');
const _remain = Symbol('_remain');
const _size = Symbol('_size');
const _write = Symbol('_write');
const _writing = Symbol('_writing');
const _defaultFlag = Symbol('_defaultFlag');
const _errored = Symbol('_errored');
export class ReadStream extends Minipass {
[_errored] = false;
[_fd];
[_path];
[_readSize];
[_reading] = false;
[_size];
[_remain];
[_autoClose];
constructor(path, opt) {
opt = opt || {};
super(opt);
this.readable = true;
this.writable = false;
if (typeof path !== 'string') {
throw new TypeError('path must be a string');
}
this[_errored] = false;
this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined;
this[_path] = path;
this[_readSize] = opt.readSize || 16 * 1024 * 1024;
this[_reading] = false;
this[_size] = typeof opt.size === 'number' ? opt.size : Infinity;
this[_remain] = this[_size];
this[_autoClose] =
typeof opt.autoClose === 'boolean' ? opt.autoClose : true;
if (typeof this[_fd] === 'number') {
this[_read]();
}
else {
this[_open]();
}
}
get fd() {
return this[_fd];
}
get path() {
return this[_path];
}
//@ts-ignore
write() {
throw new TypeError('this is a readable stream');
}
//@ts-ignore
end() {
throw new TypeError('this is a readable stream');
}
[_open]() {
fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd));
}
[_onopen](er, fd) {
if (er) {
this[_onerror](er);
}
else {
this[_fd] = fd;
this.emit('open', fd);
this[_read]();
}
}
[_makeBuf]() {
return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]));
}
[_read]() {
if (!this[_reading]) {
this[_reading] = true;
const buf = this[_makeBuf]();
/* c8 ignore start */
if (buf.length === 0) {
return process.nextTick(() => this[_onread](null, 0, buf));
}
/* c8 ignore stop */
fs.read(this[_fd], buf, 0, buf.length, null, (er, br, b) => this[_onread](er, br, b));
}
}
[_onread](er, br, buf) {
this[_reading] = false;
if (er) {
this[_onerror](er);
}
else if (this[_handleChunk](br, buf)) {
this[_read]();
}
}
[_close]() {
if (this[_autoClose] && typeof this[_fd] === 'number') {
const fd = this[_fd];
this[_fd] = undefined;
fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'));
}
}
[_onerror](er) {
this[_reading] = true;
this[_close]();
this.emit('error', er);
}
[_handleChunk](br, buf) {
let ret = false;
// no effect if infinite
this[_remain] -= br;
if (br > 0) {
ret = super.write(br < buf.length ? buf.subarray(0, br) : buf);
}
if (br === 0 || this[_remain] <= 0) {
ret = false;
this[_close]();
super.end();
}
return ret;
}
emit(ev, ...args) {
switch (ev) {
case 'prefinish':
case 'finish':
return false;
case 'drain':
if (typeof this[_fd] === 'number') {
this[_read]();
}
return false;
case 'error':
if (this[_errored]) {
return false;
}
this[_errored] = true;
return super.emit(ev, ...args);
default:
return super.emit(ev, ...args);
}
}
}
export class ReadStreamSync extends ReadStream {
[_open]() {
let threw = true;
try {
this[_onopen](null, fs.openSync(this[_path], 'r'));
threw = false;
}
finally {
if (threw) {
this[_close]();
}
}
}
[_read]() {
let threw = true;
try {
if (!this[_reading]) {
this[_reading] = true;
do {
const buf = this[_makeBuf]();
/* c8 ignore start */
const br = buf.length === 0
? 0
: fs.readSync(this[_fd], buf, 0, buf.length, null);
/* c8 ignore stop */
if (!this[_handleChunk](br, buf)) {
break;
}
} while (true);
this[_reading] = false;
}
threw = false;
}
finally {
if (threw) {
this[_close]();
}
}
}
[_close]() {
if (this[_autoClose] && typeof this[_fd] === 'number') {
const fd = this[_fd];
this[_fd] = undefined;
fs.closeSync(fd);
this.emit('close');
}
}
}
export class WriteStream extends EE {
readable = false;
writable = true;
[_errored] = false;
[_writing] = false;
[_ended] = false;
[_queue] = [];
[_needDrain] = false;
[_path];
[_mode];
[_autoClose];
[_fd];
[_defaultFlag];
[_flags];
[_finished] = false;
[_pos];
constructor(path, opt) {
opt = opt || {};
super(opt);
this[_path] = path;
this[_fd] = typeof opt.fd === 'number' ? opt.fd : undefined;
this[_mode] = opt.mode === undefined ? 0o666 : opt.mode;
this[_pos] = typeof opt.start === 'number' ? opt.start : undefined;
this[_autoClose] =
typeof opt.autoClose === 'boolean' ? opt.autoClose : true;
// truncating makes no sense when writing into the middle
const defaultFlag = this[_pos] !== undefined ? 'r+' : 'w';
this[_defaultFlag] = opt.flags === undefined;
this[_flags] = opt.flags === undefined ? defaultFlag : opt.flags;
if (this[_fd] === undefined) {
this[_open]();
}
}
emit(ev, ...args) {
if (ev === 'error') {
if (this[_errored]) {
return false;
}
this[_errored] = true;
}
return super.emit(ev, ...args);
}
get fd() {
return this[_fd];
}
get path() {
return this[_path];
}
[_onerror](er) {
this[_close]();
this[_writing] = true;
this.emit('error', er);
}
[_open]() {
fs.open(this[_path], this[_flags], this[_mode], (er, fd) => this[_onopen](er, fd));
}
[_onopen](er, fd) {
if (this[_defaultFlag] &&
this[_flags] === 'r+' &&
er &&
er.code === 'ENOENT') {
this[_flags] = 'w';
this[_open]();
}
else if (er) {
this[_onerror](er);
}
else {
this[_fd] = fd;
this.emit('open', fd);
if (!this[_writing]) {
this[_flush]();
}
}
}
end(buf, enc) {
if (buf) {
//@ts-ignore
this.write(buf, enc);
}
this[_ended] = true;
// synthetic after-write logic, where drain/finish live
if (!this[_writing] &&
!this[_queue].length &&
typeof this[_fd] === 'number') {
this[_onwrite](null, 0);
}
return this;
}
write(buf, enc) {
if (typeof buf === 'string') {
buf = Buffer.from(buf, enc);
}
if (this[_ended]) {
this.emit('error', new Error('write() after end()'));
return false;
}
if (this[_fd] === undefined || this[_writing] || this[_queue].length) {
this[_queue].push(buf);
this[_needDrain] = true;
return false;
}
this[_writing] = true;
this[_write](buf);
return true;
}
[_write](buf) {
fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) => this[_onwrite](er, bw));
}
[_onwrite](er, bw) {
if (er) {
this[_onerror](er);
}
else {
if (this[_pos] !== undefined && typeof bw === 'number') {
this[_pos] += bw;
}
if (this[_queue].length) {
this[_flush]();
}
else {
this[_writing] = false;
if (this[_ended] && !this[_finished]) {
this[_finished] = true;
this[_close]();
this.emit('finish');
}
else if (this[_needDrain]) {
this[_needDrain] = false;
this.emit('drain');
}
}
}
}
[_flush]() {
if (this[_queue].length === 0) {
if (this[_ended]) {
this[_onwrite](null, 0);
}
}
else if (this[_queue].length === 1) {
this[_write](this[_queue].pop());
}
else {
const iovec = this[_queue];
this[_queue] = [];
writev(this[_fd], iovec, this[_pos], (er, bw) => this[_onwrite](er, bw));
}
}
[_close]() {
if (this[_autoClose] && typeof this[_fd] === 'number') {
const fd = this[_fd];
this[_fd] = undefined;
fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'));
}
}
}
export class WriteStreamSync extends WriteStream {
[_open]() {
let fd;
// only wrap in a try{} block if we know we'll retry, to avoid
// the rethrow obscuring the error's source frame in most cases.
if (this[_defaultFlag] && this[_flags] === 'r+') {
try {
fd = fs.openSync(this[_path], this[_flags], this[_mode]);
}
catch (er) {
if (er?.code === 'ENOENT') {
this[_flags] = 'w';
return this[_open]();
}
else {
throw er;
}
}
}
else {
fd = fs.openSync(this[_path], this[_flags], this[_mode]);
}
this[_onopen](null, fd);
}
[_close]() {
if (this[_autoClose] && typeof this[_fd] === 'number') {
const fd = this[_fd];
this[_fd] = undefined;
fs.closeSync(fd);
this.emit('close');
}
}
[_write](buf) {
// throw the original, but try to close if it fails
let threw = true;
try {
this[_onwrite](null, fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos]));
threw = false;
}
finally {
if (threw) {
try {
this[_close]();
}
catch {
// ok error
}
}
}
}
}
//# sourceMappingURL=index.js.map

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,3 @@
{
"type": "module"
}

72
node_modules/@isaacs/fs-minipass/package.json generated vendored Normal file
View file

@ -0,0 +1,72 @@
{
"name": "@isaacs/fs-minipass",
"version": "4.0.1",
"main": "./dist/commonjs/index.js",
"scripts": {
"prepare": "tshy",
"pretest": "npm run prepare",
"test": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"format": "prettier --write . --loglevel warn",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
},
"keywords": [],
"author": "Isaac Z. Schlueter",
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/npm/fs-minipass.git"
},
"description": "fs read and write streams based on minipass",
"dependencies": {
"minipass": "^7.0.4"
},
"devDependencies": {
"@types/node": "^20.11.30",
"mutate-fs": "^2.1.1",
"prettier": "^3.2.5",
"tap": "^18.7.1",
"tshy": "^1.12.0",
"typedoc": "^0.25.12"
},
"files": [
"dist"
],
"engines": {
"node": ">=18.0.0"
},
"tshy": {
"exports": {
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"exports": {
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"types": "./dist/commonjs/index.d.ts",
"type": "module",
"prettier": {
"semi": false,
"printWidth": 75,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
}

22
node_modules/agent-base/LICENSE generated vendored Normal file
View file

@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2013 Nathan Rajlich <nathan@tootallnate.net>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Some files were not shown because too many files have changed in this diff Show more