Repository navigation
Enums
enums/ contains the catalogs that Selldone apps share: currencies and languages, product and order types, payment and transaction statuses, permissions, business models, logistics values and the route names of every Selldone app. They are not re-exported from the package root, so import each file by path. This page explains the three shapes you will meet and walks through the most useful catalogs.
import { Currency } from "@selldone/core-js/enums/payment/Currency";
import { Language } from "@selldone/core-js/enums/language/Language";
import { ProductType } from "@selldone/core-js/enums/product/ProductType";
import { OrderTypeCode } from "@selldone/core-js/enums/order/OrderTypeCode";
import { StorefrontRoutesName } from "@selldone/core-js/enums/route/StorefrontRoutesName";| Shape | Examples | Use |
|---|---|---|
TypeScript enum
|
OrderType, OrderTypeCode, StorefrontRoutesName, BackofficeRoutesName, ShopMenuType
|
Plain string constants. |
Catalog object (const) |
ProductType, TransactionStatus, BusinessModel, ShopRoles, SubscriptionMode
|
Each entry has a code plus UI data such as an i18n key (name, title, text or desc), an icon or image, sometimes a color. Ideal for rendering lists and chips. |
| Data record |
Currency, Language
|
Reference data with formatting rules (Record<string, ICurrency> / Record<string, ILanguage>). |
The i18n keys (for example "global.product_types.physical") are translated in the selldone/translate packages. Pass them to your i18n instance:
i18n.global.t(ProductType.PHYSICAL.name);Currency (enums/payment/Currency.ts) holds 153 currencies, sorted by code, including a few blockchain tokens (ADA, BTC, ETH, NIOC, SEL, SOL). Each entry is an ICurrency:
| Field | Description |
|---|---|
code |
ISO-style code, e.g. "USD". |
name |
i18n key, e.g. "global.currency.USD". |
unicode |
Symbol, e.g. "$", "€". |
floats |
Decimal places (e.g. 2). |
format |
Number format string, e.g. "0,0.00". |
round_factor |
Rounding factor. |
country, flag
|
Associated country and flag code. |
gradient |
Two colors for UI cards. |
auto_rate |
Whether Selldone can update the exchange rate automatically. |
enable |
Whether the currency is enabled. |
at_end, alt_name, alt_factor, icon, blockchain
|
Optional display details. |
import { Currency, type ICurrency } from "@selldone/core-js/enums/payment/Currency";
const usd: ICurrency = Currency.USD;
usd.unicode; // "$"
usd.floats; // 2
const codes = Object.keys(Currency); // all supported currency codesCurrency-aware helpers (CurrencyHelper, PriceHelper) are described in Helpers and Utilities.
Language (enums/language/Language.ts) holds 99 languages. Each ILanguage has code, locale, flag, dir ("ltr" or "rtl"), title (native name), calendar, full_locale (for Intl formatting) and countries.
import { Language } from "@selldone/core-js/enums/language/Language";
Language.de.title; // "Deutsch"
Language.fa.dir; // "rtl"
Language.fa.full_locale; // "fa-IR"Apps usually set window.$language to the active ILanguage; helpers such as DateConverter read window.$language.full_locale when no locale is passed.
ProductType (enums/product/ProductType.ts) is the catalog of the five product types, with the data UIs need:
| Key | basket_code |
Color |
|---|---|---|
PHYSICAL |
SM |
#689F38 |
VIRTUAL |
SV |
#2196F3 |
FILE |
SF |
#F57C00 |
SERVICE |
SS |
#E91E63 |
SUBSCRIPTION |
SN |
#673AB7 |
Each entry also has name / description i18n keys, image and basket icons, color / colors, the backoffice page names (process_page, order_page, vendor_order_page) and the delivery_states of that order type. The basket_code is the prefix used in order numbers, as in the Storefront route /orders/physical/SM-:basket_id.
import { ProductType } from "@selldone/core-js/enums/product/ProductType";
const type = ProductType[product.type]; // e.g. ProductType.PHYSICAL
console.log(type.color, type.basket_code);The plain string values are also available as Product.ProductType in the Product model.
Order enums (enums/order/):
| Enum | Values |
|---|---|
OrderType |
PHYSICAL, VIRTUAL, SERVICE, FILE, SUBSCRIPTION, DROPSHIPPING, POS, AVOCADO, HYPER
|
OrderTypeCode |
Physical = "PHYSICAL", Virtual, Service, File, Subscription, Avocado = "AVO", Hyper = "HYP", Fulfillment = "FUL" (values of the basket type field) |
OrderExportPdfType |
PDF export types for orders. |
enums/route/ contains the Vue Router route names of each Selldone app, so packages can link to each other's pages without hard-coding paths:
| Enum | App |
|---|---|
StorefrontRoutesName |
Customer storefront, e.g. SHOP_PAGE = "ShopPage", PRODUCT_PAGE = "ProductPage", BASKET_PAGE = "BasketPage", USER_PROFILE_PAGE, SHOP_LOGIN_PAGE. Exposed by the Storefront SDK as window.$storefront.routes. |
BackofficeRoutesName |
Seller dashboard. |
CommunityRoutesName |
Community pages. |
SelldoneRoutesName |
Selldone main website. |
| Folder | Exports |
|---|---|
payment/ |
TransactionStatus (RequireAction, Processing, Canceled, Succeeded, RequireCapture, …), Cards, Stripe payment methods. |
shop/ |
BusinessModel (NORMAL, DROPSHIPPING, WHOLESALER, MARKETPLACE, FRANCHISE), Industries, ShopLicense, ShopPlugin, ShopBadges, Vouchers, ShopMenuType, ModeView, checkout LoginModes / ShippingOptions, LabelingModes, ShopRestriction, ShopQuotaHelper, theme variants. |
product/ |
ProductType, ProductStatus, ProductCondition, PricingTypes, ServiceTypes, ProductVariants (+ helpers such as GetVariantNameByCode), ProductSection, thresholds, cross-sell action types. |
logistic/ |
ShopTransportations, Dimension, ETA, LeadStatus, LogisticProfileType, TimeSpans, TransportationOrderStatus, WeekDays. |
permission/, admin/, staff/
|
ShopPermissions, ShopPermissionRegions, Scopes, PermissionLevels, PermissionNames, ShopRoles. |
subscription/ |
SubscriptionMode, billing periods. |
language/ |
Language, calendars. |
gtag/ |
TrackConfig, TrackProduct, TrackUser, TrackSeller, onboarding events (Google Analytics helpers). |
social/ |
SocialNetwork (+ GetSocialIcon, CreateSocialConnectLink), Brands. |
sms/, email/
|
SmsProviders, SmsTemplateMode, EmailProviders. |
wallet/ |
AccountStatus, GiftStatus, GiftStProgramTypes. |
notification/, push-notification/
|
NotificationHelper, NotificationRepositoryType, FirebaseNotificationCategories. |
debug/ |
StorefrontDebugEvents, StorefrontDebugLogType. |
| Others |
file/FileExtensions, pos/PosDeviceTypes, tax/TaxRegionTypes, support/, timeline/, user/, vendor/, webhook/, guild/, partner/, expert/, analytics/. |
- Models and Types
- Helpers and Utilities
- selldone/translate: translations for the i18n keys.