This commit is contained in:
2026-08-28 17:31:02 +02:00
commit 2b30e8bd39
694 changed files with 49243 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
export type BuildUploadHintOptions = {
allowedMimesCsv: string;
maxFileBytes: number;
maxFiles?: number;
maxFilesLabel?: string;
encryptedAtRest?: boolean;
};
+6
View File
@@ -0,0 +1,6 @@
export type PaginatedResponse<T> = {
items: T[];
total: number;
page: number;
limit: number;
};
+4
View File
@@ -0,0 +1,4 @@
export type UploadValidationOptions = {
allowedMimesCsv: string;
maxFileBytes: number;
};
+7
View File
@@ -0,0 +1,7 @@
import type { Ref } from 'vue';
export type UsePollingOptions = {
intervalMs: number;
enabled?: Ref<boolean>;
immediate?: boolean;
};
@@ -0,0 +1,4 @@
export type CreateOrUpdateCategoryPayload = {
name: string;
sortOrder: number;
};
@@ -0,0 +1,16 @@
import type { DiscountType } from './DiscountType';
export type CreateOrUpdateDiscountCodePayload = {
code: string;
type: DiscountType;
value: number;
isActive: boolean;
validFrom: string | Date | null;
validUntil: string | Date | null;
maxRedemptions: number | null;
minOrderAmount: number | null;
isExclusive: boolean;
productIds: string[];
categoryIds: string[];
variantIds: string[];
};
@@ -0,0 +1,23 @@
import type { Category } from '@/types/product/Category';
import type { Product } from '@/types/product/Product';
import type { ProductVariant } from '@/types/product/ProductVariant';
import type { DiscountType } from './DiscountType';
export type DiscountCode = {
id: string;
code: string;
type: DiscountType;
value: number;
isActive: boolean;
validFrom: string | null;
validUntil: string | null;
maxRedemptions: number | null;
redemptionCount: number;
minOrderAmount: number | null;
isExclusive: boolean;
products?: Product[];
categories?: Category[];
variants?: ProductVariant[];
createdAt: string;
updatedAt: string;
};
@@ -0,0 +1,6 @@
export type DiscountScope = {
applyToAll: boolean;
categoryIds: string[];
productIds: string[];
variantIds: string[];
};
@@ -0,0 +1,4 @@
export enum DiscountType {
Percent = 'percent',
Fixed = 'fixed'
}
@@ -0,0 +1 @@
export type MoneroNetwork = 'mainnet' | 'stagenet';
@@ -0,0 +1,3 @@
export interface MoneroWalletRevealSeedPayload {
password: string;
}
@@ -0,0 +1,3 @@
export interface MoneroWalletRevealSeedResult {
mnemonic: string;
}
@@ -0,0 +1,12 @@
import type { MoneroNetwork } from './MoneroNetwork';
import type { MoneroWalletSyncStatus } from './MoneroWalletSyncStatus';
export interface MoneroWalletStatus {
network: MoneroNetwork;
rpcVersion: string;
walletHeight: number;
daemonHeight: number | null;
syncStatus: MoneroWalletSyncStatus;
balanceXmr: string;
unlockedBalanceXmr: string;
}
@@ -0,0 +1,5 @@
export enum MoneroWalletSyncStatus {
Synced = 'synced',
Syncing = 'syncing',
Unknown = 'unknown'
}
@@ -0,0 +1,4 @@
export interface MoneroWalletWithdrawPayload {
destinationAddress: string;
password: string;
}
@@ -0,0 +1,4 @@
export interface MoneroWalletWithdrawResult {
txHashes: string[];
amountXmr: string;
}
+9
View File
@@ -0,0 +1,9 @@
export type InvoiceState = {
isAwaitingPayment: boolean;
isUnderpaid: boolean;
isPaidSufficient: boolean;
isPaidAwaitingConfirmations: boolean;
isPaidAndConfirmed: boolean;
isExpired: boolean;
hasPendingConfirmations: boolean;
};
@@ -0,0 +1,4 @@
export enum ManualLineFulfillmentStatus {
Pending = 'pending',
Fulfilled = 'fulfilled'
}
+5
View File
@@ -0,0 +1,5 @@
export type OrderDiscount = {
id: string;
code: string;
amountFiat: number;
};
+25
View File
@@ -0,0 +1,25 @@
import type { InvoiceExtended } from '@/types/payment/InvoiceExtended';
import type { OrderFailureReason } from './OrderFailureReason';
import type { OrderLine } from './OrderLine';
import type { OrderMessage } from './OrderMessage';
import type { OrderState } from './OrderState';
import type { OrderTotals } from './OrderTotals';
import type { OrderDiscount } from './OrderDiscount';
export type OrderExtended = {
id: string;
state: OrderState;
totals: OrderTotals;
fiatCurrency: string;
failureReason: OrderFailureReason | null;
accessTokenSavedConfirmedAt: string | null;
quotedAt: string | null;
accessToken: string;
lines?: OrderLine[];
discounts?: OrderDiscount[];
checkoutInvoice?: InvoiceExtended | null;
shippingInvoice?: InvoiceExtended | null;
messages?: OrderMessage[];
createdAt: string;
updatedAt: string;
};
@@ -0,0 +1,4 @@
export enum OrderFailureReason {
StockUnavailable = 'stock_unavailable',
DiscountExhausted = 'discount_exhausted'
}
+18
View File
@@ -0,0 +1,18 @@
import type { DeliveryMode } from '@/types/product/DeliveryMode';
import type { OrderLineAutoFulfillmentItem } from './OrderLineAutoFulfillmentItem';
import type { OrderLineManualFulfillment } from './OrderLineManualFulfillment';
export type OrderLine = {
id: string;
productId: string;
variantId: string;
productTitle: string;
variantTitle: string;
thumbnailUrl: string | null;
qty: number;
unitPriceFiat: number;
lineSubtotalFiat: number;
deliveryMode: DeliveryMode;
autoFulfillmentItems: OrderLineAutoFulfillmentItem[];
manualFulfillment: OrderLineManualFulfillment | null;
};
@@ -0,0 +1,9 @@
import type { OrderLineAutoFulfillmentItemAttachment } from './OrderLineAutoFulfillmentItemAttachment';
export type OrderLineAutoFulfillmentItem = {
id: string;
sortOrder: number;
contentSnapshot: string;
sourceDigitalStockItemId: string;
attachments: OrderLineAutoFulfillmentItemAttachment[];
};
@@ -0,0 +1,8 @@
export type OrderLineAutoFulfillmentItemAttachment = {
id: string;
storageKey: string;
sourceDigitalStockAttachmentId: string;
originalFilename: string;
mimeType: string;
sizeBytes: number;
};
@@ -0,0 +1,7 @@
import type { ManualLineFulfillmentStatus } from './ManualLineFulfillmentStatus';
export type OrderLineManualFulfillment = {
id: string;
status: ManualLineFulfillmentStatus;
fulfilledAt: string | null;
};
+18
View File
@@ -0,0 +1,18 @@
import type { InvoiceStatusLabel } from '@/types/payment/InvoiceStatusLabel';
import type { OrderFailureReason } from '@/types/order/OrderFailureReason';
import type { OrderStatus } from '@/types/order/OrderStatus';
export type OrderListItem = {
id: string;
status: OrderStatus;
checkoutPaymentLabel: InvoiceStatusLabel | null;
shippingPaymentLabel: InvoiceStatusLabel | null;
totalFiat: number;
grandTotalFiat: number | null;
fiatCurrency: string;
lineCount: number;
unreadMessageCount: number;
failureReason: OrderFailureReason | null;
createdAt: string;
updatedAt: string;
};
+8
View File
@@ -0,0 +1,8 @@
import type { OrderMessageSender } from './OrderMessageSender';
export type OrderMessage = {
id: string;
sender: OrderMessageSender;
body: string;
createdAt: string;
};
@@ -0,0 +1,4 @@
export enum OrderMessageSender {
Buyer = 'buyer',
Staff = 'staff'
}
+8
View File
@@ -0,0 +1,8 @@
import type { InvoiceState } from './InvoiceState';
import type { OrderStatus } from './OrderStatus';
export type OrderState = {
status: OrderStatus;
checkoutInvoiceState: InvoiceState | null;
shippingInvoiceState: InvoiceState | null;
};
+5
View File
@@ -0,0 +1,5 @@
export enum OrderStatus {
Unfulfilled = 'unfulfilled',
Fulfilled = 'fulfilled',
Unfulfillable = 'unfulfillable'
}
+7
View File
@@ -0,0 +1,7 @@
export type OrderTotals = {
subtotalFiat: number;
discountTotalFiat: number;
totalFiat: number;
shippingCostFiat: number | null;
grandTotalFiat: number | null;
};
@@ -0,0 +1,3 @@
export interface SetDeliveryCostPayload {
deliveryCost: number;
}
+18
View File
@@ -0,0 +1,18 @@
import type { InvoiceMoneroDetails } from './InvoiceMoneroDetails';
import type { InvoicePayment } from './InvoicePayment';
import type { InvoiceReason } from './InvoiceReason';
import type { PaymentMethod } from './PaymentMethod';
export type Invoice = {
id: string;
reason: InvoiceReason;
paymentMethod: PaymentMethod;
amountFiat: number;
fiatCurrency: string;
expiresAt: string;
paymentAddress: string;
expectedTotalAtomic: string;
createdAt: string;
moneroDetails?: InvoiceMoneroDetails | null;
payments?: InvoicePayment[];
};
+9
View File
@@ -0,0 +1,9 @@
import type { Invoice } from './Invoice';
import type { InvoicePaymentExtended } from './InvoicePaymentExtended';
import type { InvoiceStatusLabel } from './InvoiceStatusLabel';
export type InvoiceExtended = Omit<Invoice, 'payments'> & {
statusLabel: InvoiceStatusLabel | null;
expectedTotalCrypto: string;
payments: InvoicePaymentExtended[];
};
@@ -0,0 +1,6 @@
export type InvoiceMoneroDetails = {
id: string;
paymentAddressIndex: number;
fiatPerXmrAtCreation: number;
requiredConfirmations: number;
};
+7
View File
@@ -0,0 +1,7 @@
export type InvoicePayment = {
id: string;
txHash: string;
amountAtomic: string;
confirmations: number;
createdAt: string;
};
@@ -0,0 +1,7 @@
import type { InvoicePayment } from './InvoicePayment';
export type InvoicePaymentExtended = InvoicePayment & {
amountCrypto: string;
isConfirmed: boolean;
confirmationsLabel: string;
};
+4
View File
@@ -0,0 +1,4 @@
export enum InvoiceReason {
Checkout = 'checkout',
Shipping = 'shipping'
}
@@ -0,0 +1,6 @@
export type InvoiceStatusLabel =
| 'Payment confirmed'
| 'Awaiting confirmations'
| 'Partial payment received'
| 'Payment expired'
| 'Awaiting payment';
+7
View File
@@ -0,0 +1,7 @@
export enum PaymentMethod {
Xmr = 'xmr'
}
export const paymentMethodCryptoCurrency: Record<PaymentMethod, string> = {
[PaymentMethod.Xmr]: 'XMR'
};
+7
View File
@@ -0,0 +1,7 @@
export type Category = {
id: string;
name: string;
sortOrder: number;
createdAt: string;
updatedAt: string;
};
+4
View File
@@ -0,0 +1,4 @@
export enum DeliveryMode {
Auto = 'auto',
Manual = 'manual'
}
@@ -0,0 +1,7 @@
export interface DigitalStockAttachment {
id: string;
originalFilename: string;
mimeType: string;
sizeBytes: number;
createdAt: string;
}
+10
View File
@@ -0,0 +1,10 @@
import type { DigitalStockAttachment } from './DigitalStockAttachment';
export interface DigitalStockItem {
id: string;
content: string;
isSold: boolean;
createdAt: string;
updatedAt: string;
attachments?: DigitalStockAttachment[];
}
@@ -0,0 +1,5 @@
export type DigitalStockListQuery = {
page: number;
limit: number;
hideSold: boolean;
};
@@ -0,0 +1,4 @@
export type PendingImageAction =
| { type: 'thumbnail'; imageId: string }
| { type: 'delete'; imageId: string }
| { type: 'reorder'; imageId: string };
+15
View File
@@ -0,0 +1,15 @@
import type { DeliveryMode } from './DeliveryMode';
import type { ProductVariantExtended } from './ProductVariantExtended';
import type { Category } from './Category';
export interface Product {
id: string;
title: string;
deliveryMode: DeliveryMode;
isDraft: boolean;
descriptionHtml: string;
variants?: ProductVariantExtended[];
categories?: Category[];
createdAt: string;
updatedAt: string;
}
+4
View File
@@ -0,0 +1,4 @@
export type ProductOption = {
id: string;
title: string;
};
+16
View File
@@ -0,0 +1,16 @@
import type { DigitalStockItem } from './DigitalStockItem';
import type { Product } from './Product';
import type { VariantImage } from './VariantImage';
export interface ProductVariant {
id: string;
title: string;
price: number;
stockQuantity: number | null;
sortOrder: number;
createdAt: string;
updatedAt: string;
digitalStockItems?: DigitalStockItem[];
images?: VariantImage[];
product?: Product;
}
@@ -0,0 +1,5 @@
import type { ProductVariant } from './ProductVariant';
export interface ProductVariantExtended extends ProductVariant {
stockAvailable: number;
}
@@ -0,0 +1,6 @@
export interface ProductVariantPayload {
title: string;
price: number;
stockQuantity: number;
sortOrder: number;
}
@@ -0,0 +1,6 @@
import type { Product } from './Product';
import type { ProductVariantExtended } from './ProductVariantExtended';
export interface ProductWithVariantsExtended extends Omit<Product, 'variants'> {
variants: ProductVariantExtended[];
}
@@ -0,0 +1,6 @@
export interface UpdateProductPayload {
title: string;
isDraft: boolean;
descriptionHtml: string;
categoryIds: string[];
}
+8
View File
@@ -0,0 +1,8 @@
export interface VariantImage {
id: string;
url: string;
sortOrder: number;
isThumbnail: boolean;
createdAt: string;
updatedAt: string;
}
+4
View File
@@ -0,0 +1,4 @@
export type VariantOption = {
id: string;
label: string;
};
@@ -0,0 +1,3 @@
export interface ConnectSimplexNotificationsPayload {
simplexNotificationLink: string;
}
@@ -0,0 +1,4 @@
export interface MoneroConfirmationTier {
upToTotalFiat?: string;
minConfirmations: number;
}
@@ -0,0 +1,6 @@
export interface SetupChecklist {
logo: boolean;
favicon: boolean;
simplexLink: boolean;
shippingNote: boolean;
}
@@ -0,0 +1,22 @@
import type { ShopSettingsMonero } from './ShopSettingsMonero';
import type { SetupChecklist } from './SetupChecklist';
export interface ShopSettings {
id: string | null;
shopName: string;
shopFiatCurrency: string;
monero: ShopSettingsMonero;
logoUrl: string | null;
faviconUrl: string | null;
simplexLink: string | null;
simplexNotificationLink: string | null;
shippingNote: string | null;
notificationsEnabled: boolean;
notifyOnNewOrder: boolean;
notifyOnOrderMessage: boolean;
simplexNotificationConnected: boolean;
isSetupComplete: boolean;
setupChecklist: SetupChecklist;
createdAt: string | null;
updatedAt: string | null;
}
@@ -0,0 +1,5 @@
import type { MoneroConfirmationTier } from './MoneroConfirmationTier';
export interface ShopSettingsMonero {
confirmationTiers: MoneroConfirmationTier[];
}
@@ -0,0 +1,5 @@
export interface UpdateNotificationsPayload {
notificationsEnabled: boolean;
notifyOnNewOrder: boolean;
notifyOnOrderMessage: boolean;
}
@@ -0,0 +1,3 @@
export interface UpdateShippingNotePayload {
shippingNote: string;
}
@@ -0,0 +1,3 @@
export interface UpdateSimplexLinkPayload {
simplexLink: string;
}