@fabrix/spool-cart
Version:
Spool - eCommerce Spool for Fabrix
469 lines (468 loc) • 13 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ACCOUNT_EVENT_TYPE = {
CREDIT: 'credit',
DEBIT: 'debit'
};
exports.COLLECTION_UPLOAD = {
title: 'Title',
seo_title: 'SEO Title',
handle: 'Handle',
description: 'Description',
seo_description: 'SEO Description',
excerpt: 'Excerpt',
body: 'Body',
primary_purpose: 'Primary Purpose',
published: 'Published',
position: 'Position',
sort_order: 'Sort Order',
shipping_rate: 'Shipping Rate',
shipping_percentage: 'Shipping Percentage',
shipping_type: 'Shipping Type',
shipping_name: 'Shipping Name',
tax_rate: 'Tax Rate',
tax_percentage: 'Tax Percentage',
tax_type: 'Tax Type',
tax_name: 'Tax Name',
discount_scope: 'Discount Scope',
discount_type: 'Discount Type',
discount_rate: 'Discount Rate',
discount_percentage: 'Discount Percentage',
discount_product_include: 'Discount Product Include',
discount_product_exclude: 'Discount Product Exclude',
shipping_product_exclude: 'Discount Product Exclude',
tax_product_exclude: 'Discount Product Exclude',
images: 'Images',
images_alt: 'Images Alt',
collections: 'Collections',
tags: 'Tags'
};
exports.COLLECTION_MODELS = {
COLLECTION: 'collection',
CUSTOMER: 'customer',
PRODUCT: 'product',
PRODUCT_VARIANT: 'productvariant',
};
exports.COUPON_MODELS = {
PRODUCT: 'product',
};
exports.CUSTOMER_DEFAULTS = {
CURRENCY: 'USD'
};
exports.CUSTOMER_MODELS = {
CUSTOMER: 'customer',
USER: 'user'
};
exports.CUSTOMER_UPLOAD = {
account_balance: 'Account Balance',
email: 'Email',
first_name: 'First Name',
last_name: 'Last Name',
company: 'Company',
phone: 'Phone',
billing_address_1: 'Billing Address 1',
billing_address_2: 'Billing Address 2',
billing_address_3: 'Billing Address 3',
billing_company: 'Billing Company',
billing_city: 'Billing City',
billing_province: 'Billing Province',
billing_postal_code: 'Billing Postal Code',
billing_country: 'Billing Country',
shipping_address_1: 'Shipping Address 1',
shipping_address_2: 'Shipping Address 2',
shipping_address_3: 'Shipping Address 3',
shipping_company: 'Shipping Company',
shipping_city: 'Shipping City',
shipping_province: 'Shipping Province',
shipping_postal_code: 'Shipping Postal Code',
shipping_country: 'Shipping Country',
state: 'State',
type: 'Type',
tags: 'Tags',
collections: 'Collections',
accounts: 'Accounts',
users: 'Users'
};
exports.DISCOUNT_MODELS = {
CART: 'cart',
COLLECTION: 'collection',
CUSTOMER: 'customer',
PRODUCT: 'product',
SUBSCRIPTION: 'subscription',
PRODUCT_VARIANT: 'productvariant',
ORDER: 'order',
ORDER_ITEM: 'order_item'
};
exports.DISCOUNT_SCOPE = {
INDIVIDUAL: 'individual',
GLOBAL: 'global'
};
exports.IMAGE_MODELS = {
COLLECTION: 'collection',
CUSTOMER: 'customer',
PRODUCT: 'product',
USER: 'user'
};
exports.ORDER_UPLOAD = {
customer: 'Customer Email',
order_items: 'Items',
billing_address_1: 'Billing Address 1',
billing_address_2: 'Billing Address 2',
billing_address_3: 'Billing Address 3',
billing_company: 'Billing Company',
billing_city: 'Billing City',
billing_province: 'Billing Province',
billing_postal_code: 'Billing Postal Code',
billing_country: 'Billing Country',
shipping_address_1: 'Shipping Address 1',
shipping_address_2: 'Shipping Address 2',
shipping_address_3: 'Shipping Address 3',
shipping_company: 'Shipping Company',
shipping_city: 'Shipping City',
shipping_province: 'Shipping Province',
shipping_postal_code: 'Shipping Postal Code',
shipping_country: 'Shipping Country',
tags: 'Tags',
note: 'Note'
};
exports.PRODUCT_UPLOAD = {
handle: 'Handle',
title: 'Title',
body: 'Body',
seo_title: 'SEO Title',
seo_description: 'SEO Description',
vendors: 'Vendors',
type: 'Type',
tags: 'Tags',
collections: 'Collections',
associations: 'Associations',
published: 'Published',
available: 'Available',
option_name: 'Option / * Name',
option_value: 'Option / * Value',
property_pricing_name: 'Property Pricing / * Name',
property_pricing_group: 'Property Pricing / * Group',
property_pricing_value: 'Property Pricing / * Value',
property_pricing_image: 'Property Pricing / * Image',
property_pricing_multi_select: 'Property Pricing / * Multi Select',
images: 'Images Sources',
images_alt: 'Images Alt Text',
sku: 'Variant SKU',
weight: 'Variant Weight',
weight_unit: 'Variant Weight Unit',
inventory_tracker: 'Variant Inventory Tracker',
inventory_quantity: 'Variant Inventory Quantity',
inventory_policy: 'Variant Inventory Policy',
max_quantity: 'Variant Max Quantity',
fulfillment_service: 'Variant Fulfillment Service',
price: 'Variant Price',
compare_at_price: 'Variant Compare at Price',
variant_currency: 'Variant Currency',
requires_shipping: 'Variant Requires Shipping',
requires_taxes: 'Variant Taxable',
barcode: 'Variant Barcode',
variant_images: 'Variant Images',
variant_images_alt: 'Variant Images Alt Text',
tax_code: 'Variant Tax Code',
gift_card: 'Gift Card',
metadata: 'Metadata',
requires_subscription: 'Subscription',
subscription_unit: 'Subscription Unit',
subscription_interval: 'Subscription Interval',
shops: 'Shops',
shops_quantity: 'Shops Quantity',
average_shipping: 'Average Shipping',
exclude_payment_types: 'Exclude Payment Types',
g_product_category: 'Google Shopping / Google Product Category',
g_gender: 'Google Shopping / Gender',
g_age_group: 'Google Shopping / Age Group',
g_mpn: 'Google Shopping / MPN',
g_adwords_grouping: 'Google Shopping / Adwords Grouping',
g_adwords_label: 'Google Shopping / Adwords Labels',
g_condition: 'Google Shopping / Condition',
g_custom_product: 'Google Shopping / Custom Product',
g_custom_label_0: 'Google Shopping / Custom Label 0',
g_custom_label_1: 'Google Shopping / Custom Label 1',
g_custom_label_2: 'Google Shopping / Custom Label 2',
g_custom_label_3: 'Google Shopping / Custom Label 3',
g_custom_label_4: 'Google Shopping / Custom Label 4',
};
exports.PRODUCT_REVIEW_UPLOAD = {
handle: 'Handle',
id: 'ID',
product_id: 'Product ID',
email: 'email',
score: 'Score',
review: 'Review'
};
exports.PRODUCT_META_UPLOAD = {
handle: 'Handle',
id: 'ID',
product_id: 'Product ID'
};
exports.SUBSCRIPTION_UPLOAD = {
products: 'Products',
customer: 'Customer',
interval: 'Interval',
unit: 'Unit',
active: 'Active',
token: 'Token'
};
exports.VENDOR_UPLOAD = {
handle: 'Handle',
name: 'Name',
billing_address_1: 'Billing Address 1',
billing_address_2: 'Billing Address 2',
billing_address_3: 'Billing Address 3',
billing_company: 'Billing Company',
billing_city: 'Billing City',
billing_province: 'Billing Province',
billing_postal_code: 'Billing Postal Code',
billing_country: 'Billing Country',
shipping_address_1: 'Shipping Address 1',
shipping_address_2: 'Shipping Address 2',
shipping_address_3: 'Shipping Address 3',
shipping_company: 'Shipping Company',
shipping_city: 'Shipping City',
shipping_province: 'Shipping Province',
shipping_postal_code: 'Shipping Postal Code',
shipping_country: 'Shipping Country',
products: 'Products'
};
exports.UNITS = {
G: 'g',
KG: 'kg',
OZ: 'oz',
LB: 'lb'
};
exports.INTERVALS = {
NONE: null,
DAY: 'd',
WEEK: 'w',
BIWEEK: 'ww',
MONTH: 'm',
BIMONTH: 'mm',
YEAR: 'y',
BIYEAR: 'yy'
};
exports.INVENTORY_POLICY = {
DENY: 'deny',
RESTRICT: 'restrict',
CONTINUE: 'continue'
};
exports.CUSTOMER_STATE = {
DISABLED: 'disabled',
INVITED: 'invited',
ENABLED: 'enabled',
DECLINED: 'declined'
};
exports.CART_STATUS = {
OPEN: 'open',
DRAFT: 'draft',
CLOSED: 'closed',
ABANDONED: 'abandoned',
ORDERED: 'ordered'
};
exports.DISCOUNT_TYPES = {
PERCENTAGE: 'percentage',
RATE: 'rate',
THRESHOLD: 'threshold',
SHIPPING: 'shipping'
};
exports.DISCOUNT_STATUS = {
ENABLED: 'enabled',
DISABLED: 'disabled',
DEPLETED: 'depleted'
};
exports.ORDER_CANCEL = {
CUSTOMER: 'customer',
FRAUD: 'fraud',
INVENTORY: 'inventory',
OTHER: 'other'
};
exports.SUBSCRIPTION_CANCEL = {
CUSTOMER: 'customer',
FRAUD: 'fraud',
INVENTORY: 'inventory',
FUNDING: 'funding',
OTHER: 'other'
};
exports.ORDER_STATUS = {
OPEN: 'open',
CLOSED: 'closed',
CANCELLED: 'cancelled',
DRAFT: 'draft'
};
exports.PAYMENT_KIND = {
IMMEDIATE: 'immediate',
MANUAL: 'manual'
};
exports.ORDER_FINANCIAL = {
CANCELLED: 'cancelled',
PENDING: 'pending',
AUTHORIZED: 'authorized',
PARTIALLY_PAID: 'partially_paid',
PAID: 'paid',
PARTIALLY_REFUNDED: 'partially_refunded',
REFUNDED: 'refunded',
VOIDED: 'voided'
};
exports.ORDER_FULFILLMENT = {
PENDING: 'pending',
FULFILLED: 'fulfilled',
SENT: 'sent',
NONE: 'none',
PARTIAL: 'partial',
CANCELLED: 'cancelled'
};
exports.ORDER_FULFILLMENT_KIND = {
IMMEDIATE: 'immediate',
MANUAL: 'manual'
};
exports.FULFILLMENT_SERVICE = {
MANUAL: 'manual'
};
exports.FULFILLMENT_STATUS = {
PENDING: 'pending',
FULFILLED: 'fulfilled',
SENT: 'sent',
NONE: 'none',
PARTIAL: 'partial',
CANCELLED: 'cancelled'
};
exports.FULFILLMENT_EVENT_STATUS = {
CONFIRMED: 'confirmed',
IN_TRANSIT: 'in_transit',
OUT_FOR_DELIVERY: 'out_for_delivery',
DELIVERED: 'delivered',
FAILURE: 'failure'
};
exports.PAYMENT_PROCESSING_METHOD = {
CHECKOUT: 'checkout',
SUBSCRIPTION: 'subscription',
DIRECT: 'direct',
MANUAL: 'manual',
OFFSITE: 'offsite',
EXPRESS: 'express'
};
exports.REFUND_MODELS = {
TRANSACTION: 'transaction'
};
exports.SHIPPING_MODELS = {
CITY: 'city',
COUNTY: 'county',
COUNTRY: 'country',
PROVINCE: 'province'
};
exports.TAG_MODELS = {
CART: 'cart',
COLLECTION: 'collection',
CUSTOMER: 'customer',
ORDER: 'order',
PRODUCT: 'product',
PRODUCT_VARIANT: 'product_variant',
USER: 'user'
};
exports.TRANSACTION_ERRORS = {
INCORRECT_NUMBER: 'incorrect_number',
INVALID_NUMBER: 'invalid_number',
INVALID_EXPIRY_DATE: 'invalid_expiry_date',
INVALID_CVC: 'invalid_cvc',
EXPIRED_CARD: 'expired_card',
INCORRECT_CVC: 'incorrect_cvc',
INCORRECT_ZIP: 'incorrect_zip',
INCORRECT_ADDRESS: 'incorrect_address',
CARD_DECLINED: 'card_declined',
PROCESSING_ERROR: 'processing_error',
CALL_ISSUER: 'call_issuer',
PICK_UP_CARD: 'pick_up_card'
};
exports.TRANSACTION_STATUS = {
PENDING: 'pending',
FAILURE: 'failure',
SUCCESS: 'success',
ERROR: 'error',
CANCELLED: 'cancelled'
};
exports.TRANSACTION_KIND = {
AUTHORIZE: 'authorize',
CAPTURE: 'capture',
SALE: 'sale',
VOID: 'void',
REFUND: 'refund'
};
exports.COLLECTION_PURPOSE = {
NAVIGATION: 'navigation',
VENDOR: 'vendor',
GROUP: 'group',
DISCOUNT: 'discount',
SHIPPING: 'shipping',
TAXES: 'taxes'
};
exports.COLLECTION_SORT_ORDER = {
ALPHA_ASC: 'alpha-asc',
ALPHA_DESC: 'alpha-desc',
BEST_SELLING: 'best-selling',
CREATED: 'created',
CREATED_DESC: 'created-desc',
MANUAL: 'manual',
PRICE_ASC: 'price-asc',
PRICE_DESC: 'price-desc'
};
exports.COLLECTION_DISCOUNT_SCOPE = {
INDIVIDUAL: 'individual',
GLOBAL: 'global'
};
exports.COLLECTION_DISCOUNT_TYPE = {
PERCENTAGE: 'percentage',
FIXED: 'fixed',
RATE: 'rate'
};
exports.COLLECTION_TAX_TYPE = {
PERCENTAGE: 'percentage',
FIXED: 'fixed',
};
exports.COLLECTION_SHIPPING_TYPE = {
PERCENTAGE: 'percentage',
FIXED: 'fixed',
};
exports.PRODUCT_DEFAULTS = {
HOST: 'localhost',
TAX_CODE: 'P000000',
PRICE: 0,
CALCULATED_PRICE: 0,
DISCOUNTED_LINES: [],
TOTAL_DISCOUNTS: 0,
CURRENCY: 'USD',
PUBLISHED_SCOPE: 'global',
PUBLISHED: false,
AVAILABLE: true,
OPTIONS: [],
WEIGHT: 0,
WEIGHT_UNIT: 'g',
REVIEWS_SCORE: 0,
TOTAL_REVIEWS: 0,
TOTAL_VARIANTS: 0
};
exports.TRANSACTION_DEFAULTS = {
CURRENCY: 'USD',
SOURCE_NAME: 'web'
};
exports.VARIANT_DEFAULTS = {
PUBLISHED: false,
MAX_QUANTITY: -1,
TAX_CODE: 'P000000',
WEIGHT_UNIT: 'g',
CURRENCY: 'USD',
AVAILABLE: true,
FULFILLMENT_SERVICE: 'manual',
SUBSCRIPTION_INTERVAL: 0,
SUBSCRIPTION_UNIT: null,
REQUIRES_SUBSCRIPTION: false,
REQUIRES_SHIPPING: true,
REQUIRES_TAX: true,
INVENTORY_MANAGEMENT: false,
INVENTORY_POLICY: 'deny',
INVENTORY_QUANTITY: 0,
INVENTORY_LEAD_TIME: 0
};