Developer-gated collection for NPC characters, including the vendor fields (enabled, priceModifier, sells[]) used by the marketplace to attribute auto-generated listings to background merchants.
159 lines
4.7 KiB
TypeScript
159 lines
4.7 KiB
TypeScript
// storage-adapter-import-placeholder
|
|
import { postgresAdapter } from "@payloadcms/db-postgres";
|
|
import { lexicalEditor } from "@payloadcms/richtext-lexical";
|
|
import path from "path";
|
|
import { buildConfig } from "payload";
|
|
import { fileURLToPath } from "url";
|
|
import sharp from "sharp";
|
|
|
|
import { Users } from "@/collections/users/Users";
|
|
import { Awards } from "@/collections/users/Awards";
|
|
import { Media } from "@/collections/Media";
|
|
import { Ranks } from "@/collections/users/Ranks";
|
|
import { Profiles } from "@/collections/users/Profiles";
|
|
import { Missions } from "@/collections/intelligence/Missions";
|
|
import { Maps } from "@/collections/world/Maps";
|
|
import { Campaigns } from "@/collections/intelligence/Campaigns";
|
|
import { Qualifications } from "@/collections/users/Qualifications";
|
|
import { MissionFiles } from "@/collections/server/MissionFiles";
|
|
import { ModLists } from "@/collections/server/ModLists";
|
|
import { Factions } from "@/collections/intelligence/Factions";
|
|
import { Assets } from "@/collections/logistics/Assets";
|
|
import { NarrativeEvents } from "@/collections/world/NarrativeEvents";
|
|
import { Resources } from "@/collections/logistics/Resources";
|
|
import { Vehicles } from "@/collections/logistics/Vehicles";
|
|
import { Structures } from "@/collections/logistics/Structures";
|
|
import { Shipments } from "@/collections/logistics/Shipments";
|
|
import { Assignments } from "@/collections/users/Assignments";
|
|
import { Technologies } from "@/collections/intelligence/Technologies";
|
|
import { GameRules } from "@/collections/game/GameRules";
|
|
import { GameStructures } from "@/collections/game/GameStructures";
|
|
import { GameHardResources } from "@/collections/game/GameHardResources";
|
|
import { GameEventLogs } from "@/collections/game/GameEventLogs";
|
|
import { GameVehicles } from "@/collections/game/GameVehicles";
|
|
import { GameNpcs } from "@/collections/game/GameNpcs";
|
|
import { Experience } from "@/collections/users/Experience";
|
|
import { BankAccounts } from "@/collections/banking/BankAccounts";
|
|
import { BankTransactions } from "@/collections/banking/BankTransactions";
|
|
import { LedgerEntries } from "@/collections/banking/LedgerEntries";
|
|
import { LockerStorages } from "@/collections/locker/LockerStorages";
|
|
import { Loadouts } from "@/collections/locker/Loadouts";
|
|
import { UserNotifications } from "@/collections/users/UserNotifications";
|
|
import { nodemailerAdapter } from "@payloadcms/email-nodemailer";
|
|
import nodemailer from "nodemailer";
|
|
|
|
const filename = fileURLToPath(import.meta.url);
|
|
const dirname = path.dirname(filename);
|
|
|
|
export default buildConfig({
|
|
// serverURL: "http://localhost:3000/",
|
|
admin: {
|
|
user: Users.slug,
|
|
importMap: {
|
|
baseDir: path.resolve(dirname),
|
|
},
|
|
meta: {
|
|
titleSuffix: "- Polaris Task Force",
|
|
icons: [
|
|
{
|
|
rel: "icon",
|
|
type: "image/png",
|
|
url: "/images/icon-favicon.png",
|
|
},
|
|
],
|
|
},
|
|
components: {
|
|
beforeDashboard: ["@/components/static/BeforeDashboardText"],
|
|
header: ["@/components/static/VersionOverlay"],
|
|
graphics: {
|
|
Logo: "@/components/graphics/AppLogo",
|
|
Icon: "@/components/graphics/AppIcon",
|
|
},
|
|
},
|
|
},
|
|
globals: [GameRules],
|
|
collections: [
|
|
Media,
|
|
|
|
// Game
|
|
GameHardResources,
|
|
GameStructures,
|
|
GameVehicles,
|
|
GameNpcs,
|
|
GameEventLogs,
|
|
|
|
// Users
|
|
Users,
|
|
Ranks,
|
|
Profiles,
|
|
Awards,
|
|
Qualifications,
|
|
Assignments,
|
|
Experience,
|
|
UserNotifications,
|
|
|
|
// Intel
|
|
Missions,
|
|
Campaigns,
|
|
Factions,
|
|
Technologies,
|
|
|
|
// Logistics
|
|
Assets,
|
|
Resources,
|
|
Vehicles,
|
|
Structures,
|
|
Shipments,
|
|
|
|
// Banking
|
|
BankAccounts,
|
|
BankTransactions,
|
|
LedgerEntries,
|
|
|
|
// Locker
|
|
LockerStorages,
|
|
Loadouts,
|
|
|
|
// World
|
|
Maps,
|
|
NarrativeEvents,
|
|
|
|
// Server
|
|
MissionFiles,
|
|
ModLists,
|
|
],
|
|
editor: lexicalEditor(),
|
|
secret: process.env.PAYLOAD_SECRET || "",
|
|
typescript: {
|
|
outputFile: path.resolve(dirname, "payload-types.ts"),
|
|
},
|
|
db: postgresAdapter({
|
|
pool: {
|
|
connectionString: process.env.DATABASE_URI || "",
|
|
},
|
|
push: process.env.NODE_ENV === "development",
|
|
}),
|
|
sharp,
|
|
bin: [
|
|
{
|
|
scriptPath: path.resolve(dirname, "scripts/gameTick.ts"),
|
|
key: "game-tick",
|
|
},
|
|
],
|
|
plugins: [
|
|
// payloadCloudPlugin(),
|
|
// storage-adapter-placeholder
|
|
],
|
|
email: nodemailerAdapter({
|
|
defaultFromAddress: process.env.EMAIL_FROM_ADDRESS || "",
|
|
defaultFromName: process.env.EMAIL_FROM_NAME || "",
|
|
transport: nodemailer.createTransport({
|
|
host: process.env.EMAIL_HOST || "",
|
|
port: Number(process.env.EMAIL_PORT) || 587,
|
|
auth: {
|
|
user: process.env.EMAIL_USERNAME || "",
|
|
pass: process.env.EMAIL_PASSWORD || "",
|
|
},
|
|
}),
|
|
})
|
|
});
|