This commit is contained in:
2026-08-28 17:31:02 +02:00
commit 2b30e8bd39
694 changed files with 49243 additions and 0 deletions
+122
View File
@@ -0,0 +1,122 @@
import { MoneroConfirmationTier } from './MoneroConfirmationTier';
import { MoneroWalletConfig } from './MoneroWalletConfig';
import { NodeEnv } from './NodeEnv';
import { PaymentMethod } from '../modules/payment/types/PaymentMethod';
import { ShopFiatCurrency } from './ShopFiatCurrency';
import { SimplexConfig } from './SimplexConfig';
export interface SignedCookieProfileConfig {
cookieName: string;
expiresInMs: number;
}
export interface SignedCookieConfig {
jwtSecret: string;
feedback: SignedCookieProfileConfig;
cart: SignedCookieProfileConfig;
captcha: SignedCookieProfileConfig;
discount: SignedCookieProfileConfig;
error: SignedCookieProfileConfig;
checkoutSession: SignedCookieProfileConfig;
orderAuth: SignedCookieProfileConfig;
theme: SignedCookieProfileConfig;
}
export interface CaptchaConfig {
length: number;
}
export interface ThrottleConfig {
ttlMs: number;
limit: number;
}
export interface AppConfig {
port: number;
nodeEnv: NodeEnv;
corsOrigins: string[];
cmsPassword: string;
captcha: CaptchaConfig;
throttle: ThrottleConfig;
signedCookie: SignedCookieConfig;
validation: {
productTitleMaxLength: number;
categoryNameMaxLength: number;
discountCodeMaxLength: number;
variantImagesMax: number;
digitalStockAttachmentsMax: number;
shippingNoteMinLength: number;
shippingNoteMaxLength: number;
orderMessageMaxLength: number;
};
}
export interface ShopSettingsConfig {
shopName: string;
shopFiatCurrency: ShopFiatCurrency;
monero: {
confirmationTiers: MoneroConfirmationTier[];
};
}
export interface JwtConfig {
secret: string;
expiresInMs: number;
}
export interface PostgresConfig {
type: 'postgres';
url: string;
host: string;
username: string;
password: string;
port: number;
database: string;
entities: string[];
migrations: string[];
migrationsRun: boolean;
}
export interface MulterConfig {
allowedMimes: readonly string[];
maxFileBytes: number;
}
export interface CoingeckoConfig {
apiBaseUrl: string;
xmrRateFetchTimeoutMs: number;
}
export interface KrakenConfig {
apiBaseUrl: string;
xmrRateFetchTimeoutMs: number;
}
export interface EncryptionConfig {
keyBase64: string;
}
export interface OrderConfig {
checkoutValidityMs: number;
shippingPaymentValidityMs: number;
checkoutStatusRefreshSec: number;
dataRetentionDays: number;
}
export interface InvoiceConfig {
minByMethod: Record<PaymentMethod, string>;
}
export interface Config {
app: AppConfig;
postgres: PostgresConfig;
jwt: JwtConfig;
coingecko: CoingeckoConfig;
kraken: KrakenConfig;
encryption: EncryptionConfig;
shopSettings: ShopSettingsConfig;
order: OrderConfig;
invoice: InvoiceConfig;
moneroWallet: MoneroWalletConfig;
simplex: SimplexConfig;
}
@@ -0,0 +1,3 @@
export type DiskFileTypeValidatorOptions = {
fileType: RegExp;
};
@@ -0,0 +1,4 @@
export interface MoneroConfirmationTier {
upToTotalFiat?: string;
minConfirmations: number;
}
+4
View File
@@ -0,0 +1,4 @@
export enum MoneroNetwork {
Mainnet = 'mainnet',
Stagenet = 'stagenet'
}
+10
View File
@@ -0,0 +1,10 @@
import { MoneroNetwork } from './MoneroNetwork';
export interface MoneroWalletConfig {
network: MoneroNetwork;
rpcUrl: string;
daemonRpcUrl: string;
username: string;
password: string;
rpcTimeoutMs: number;
}
+4
View File
@@ -0,0 +1,4 @@
export enum NodeEnv {
Development = 'development',
Production = 'production'
}
+6
View File
@@ -0,0 +1,6 @@
export type PaginatedResponse<T> = {
items: T[];
total: number;
page: number;
limit: number;
};
+10
View File
@@ -0,0 +1,10 @@
export enum ShopFiatCurrency {
Usd = 'USD',
Eur = 'EUR',
Gbp = 'GBP',
Cad = 'CAD',
Aud = 'AUD',
Chf = 'CHF'
}
export const SHOP_FIAT_CURRENCY_VALUES = Object.values(ShopFiatCurrency);
+4
View File
@@ -0,0 +1,4 @@
export enum ShopSurface {
Clearnet = 'clearnet',
Onion = 'onion'
}
+4
View File
@@ -0,0 +1,4 @@
export interface SimplexConfig {
wsUrl: string;
botDisplayName: string;
}
+1
View File
@@ -0,0 +1 @@
export type UploadFileSource = 'disk' | 'buffer';
+3
View File
@@ -0,0 +1,3 @@
export type ValidatedUploadFile = Express.Multer.File & {
detectedMimeType: string;
};
@@ -0,0 +1,3 @@
export type InformationSchemaTableRow = {
table_name: string;
};
@@ -0,0 +1,3 @@
export type PgEnumTypeRow = {
typname: string;
};
@@ -0,0 +1,4 @@
import { StorefrontOrderRefreshSection } from '../../consts/storefrontOrderRefreshSection';
export type StorefrontOrderRefreshSection =
(typeof StorefrontOrderRefreshSection)[keyof typeof StorefrontOrderRefreshSection];
@@ -0,0 +1,3 @@
export interface IsBase64Options {
byteLength?: number;
}
@@ -0,0 +1,3 @@
export type NullOrIntOptions = {
min?: number;
};
@@ -0,0 +1,3 @@
export type NullOrNumberOptions = {
min?: number;
};