feat: whole shops listed on IMVU, and GET /imports/available
Whole-shop grants now import the shop's products, not only those people asked for. The hub lists the shop on IMVU's public API (general-rated products) when the grant is accepted, daily after, and on "List the shop again". Each listing keeps the products' info and queues what isn't imported yet, less exclusions. IMVU's small pages overlap and miss products, so the hub asks for pages of 1000 and drops repeats. GET /imports/available tells the proxy what T5DE has of IMVU products and shops, from what the hub knows only. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
8f6dacba10
commit
b4eed85bd6
15 files changed
+4954
-20
No files matched your search
@@ -10,7 +10,15 @@ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@
|
||||
import { api, unwrap, type ImportGrant } from "@/lib/api";
|
||||
import { ConsoleNav, requireConsole } from "../../../console-nav";
|
||||
import { shortFingerprint } from "@/lib/importer";
|
||||
import { changeImporterAccount, decideGrant, retryJob, setImporter, setImporterSettings } from "../../actions";
|
||||
import {
|
||||
changeImporterAccount,
|
||||
decideGrant,
|
||||
listShop,
|
||||
retryJob,
|
||||
setImporter,
|
||||
setImporterSettings,
|
||||
} from "../../actions";
|
||||
import { ShopListing } from "@/components/shop-listing";
|
||||
import { ImporterAccountForm } from "./importer-account-form";
|
||||
|
||||
export const metadata: Metadata = { title: "Imports" };
|
||||
@@ -325,7 +333,7 @@ export default async function CatalogImports({
|
||||
</CardHeader>
|
||||
<CardContent className="divide-y">
|
||||
{others.map((g) => (
|
||||
<GrantRow key={g.id} id={id} grant={g} accept={can.accept} withdraw={can.withdraw} />
|
||||
<GrantRow key={g.id} id={id} grant={g} accept={can.accept} withdraw={can.withdraw} run={can.run} />
|
||||
))}
|
||||
</CardContent>
|
||||
</Card>
|
||||
@@ -415,11 +423,13 @@ function GrantRow({
|
||||
grant: g,
|
||||
accept,
|
||||
withdraw,
|
||||
run = false,
|
||||
}: {
|
||||
id: string;
|
||||
grant: ImportGrant;
|
||||
accept: boolean;
|
||||
withdraw: boolean;
|
||||
run?: boolean;
|
||||
}) {
|
||||
const open = g.status === "pending" || g.status === "active" || g.status === "suspended";
|
||||
return (
|
||||
@@ -440,8 +450,16 @@ function GrantRow({
|
||||
? `The whole shop${g.exclude.length ? `, less ${g.exclude.length} left out` : ""}.`
|
||||
: `${g.products.length} chosen product${g.products.length === 1 ? "" : "s"}: ${g.products.slice(0, 10).join(", ")}${g.products.length > 10 ? "…" : ""}.`}{" "}
|
||||
{g.listed ? "Listed." : "Unlisted."}
|
||||
<ShopListing grant={g} />
|
||||
</p>
|
||||
{g.statusReason && <p className="text-sm text-muted-foreground">{g.statusReason}</p>}
|
||||
{run && g.status === "active" && g.scope === "shop" && (
|
||||
<ActionForm action={listShop} fields={{ id, grant: g.id }}>
|
||||
<SubmitButton size="sm" variant="outline" pendingLabel="Listing…">
|
||||
{g.shopListedAt ? "List the shop again" : "List the shop now"}
|
||||
</SubmitButton>
|
||||
</ActionForm>
|
||||
)}
|
||||
{open && (accept || withdraw) && (
|
||||
<ActionForm action={decideGrant} fields={{ id, grant: g.id }}>
|
||||
<div className="flex max-w-2xl flex-wrap gap-2">
|
||||
|
||||
Reference in new issue
Block a user