bc-api-client
Version:
A client for the BigCommerce management API and app authentication
487 lines (486 loc) • 15.5 kB
JavaScript
// src/endpoints.ts
var catalogSummary = "/catalog/summary";
var products = {
path: "/catalog/products",
byId: (id) => `/catalog/products/${id}`,
batchPrices: "/pricing/products",
metafields: {
batch: "/catalog/products/metafields",
product: {
path: (productId) => `/catalog/products/${productId}/metafields`,
byId: (productId, id) => `/catalog/products/${productId}/metafields/${id}`
}
},
bulkPricingRules: {
path: (productId) => `/catalog/products/${productId}/bulk-pricing-rules`,
byId: (productId, id) => `/catalog/products/${productId}/bulk-pricing-rules/${id}`
},
categoryAssignments: "/catalog/products/category-assignments",
channelAssignments: "/catalog/products/channel-assignments",
complexRules: {
path: (productId) => `/catalog/products/${productId}/complex-rules`,
byId: (productId, id) => `/catalog/products/${productId}/complex-rules/${id}`
},
customFields: {
path: (productId) => `/catalog/products/${productId}/custom-fields`,
byId: (productId, id) => `/catalog/products/${productId}/custom-fields/${id}`
},
images: {
path: (productId) => `/catalog/products/${productId}/images`,
byId: (productId, id) => `/catalog/products/${productId}/images/${id}`
},
reviews: {
path: (productId) => `/catalog/products/${productId}/reviews`,
byId: (productId, id) => `/catalog/products/${productId}/reviews/${id}`
},
videos: {
path: (productId) => `/catalog/products/${productId}/videos`,
byId: (productId, id) => `/catalog/products/${productId}/videos/${id}`
}
};
var modifiers = {
path: (productId) => `/catalog/products/${productId}/modifiers`,
byId: (productId, id) => `/catalog/products/${productId}/modifiers/${id}`,
values: {
path: (productId, modifierId) => `/catalog/products/${productId}/modifiers/${modifierId}/values`,
byId: (productId, modifierId, id) => `/catalog/products/${productId}/modifiers/${modifierId}/values/${id}`,
createImage: (productId, modifierId, id) => `/catalog/products/${productId}/modifiers/${modifierId}/values/${id}/image`
}
};
var variantOptions = {
path: (productId) => `/catalog/products/${productId}/options`,
byId: (productId, id) => `/catalog/products/${productId}/options/${id}`,
values: {
path: (productId, optionId) => `/catalog/products/${productId}/options/${optionId}/values`,
byId: (productId, optionId, id) => `/catalog/products/${productId}/options/${optionId}/values/${id}`
}
};
var variants = {
batch: "/catalog/variants",
path: (productId) => `/catalog/products/${productId}/variants`,
byId: (productId, id) => `/catalog/products/${productId}/variants/${id}`,
createImage: (productId, id) => `/catalog/products/${productId}/variants/${id}/image`,
metafields: {
batch: "/catalog/variants/metafields",
path: (productId, id) => `/catalog/products/${productId}/variants/${id}/metafields`,
byId: (productId, variantId, id) => `/catalog/products/${productId}/variants/${variantId}/metafields/${id}`
}
};
var brands = {
path: "/catalog/brands",
byId: (id) => `/catalog/brands/${id}`,
image: (id) => `/catalog/brands/${id}/image`,
metafields: {
batch: "/catalog/brands/metafields",
path: (id) => `/catalog/brands/${id}/metafields`,
byId: (brandId, id) => `/catalog/brands/${brandId}/metafields/${id}`
}
};
var categories = {
deprecated: {
path: "/catalog/categories",
byId: (id) => `/catalog/categories/${id}`
},
image: (id) => `/catalog/categories/${id}/image`,
metafields: {
batch: "/catalog/categories/metafields",
path: (id) => `/catalog/categories/${id}/metafields`,
byId: (categoryId, id) => `/catalog/categories/${categoryId}/metafields/${id}`
},
sortOrder: (id) => `/catalog/categories/${id}/products/sort-order`
};
var trees = {
path: "/catalog/trees",
byId: (id) => `/catalog/trees/${id}`,
categories: (id) => `/catalog/trees/${id}/categories`,
allCategories: "/catalog/trees/categories"
};
var abandonedCarts = {
path: (token) => `/abandoned-carts/${token}`,
settings: {
global: "/abandoned-carts/settings",
channel: (channelId) => `/abandoned-carts/settings/${channelId}`
}
};
var carts = {
path: "/carts",
byId: (uuid) => `/carts/${uuid}`,
createRedirectUrl: (uuid) => `/carts/${uuid}/redirect_urls`,
items: {
path: (uuid) => `/carts/${uuid}/items`,
byId: (cartUuid, itemUuid) => `/carts/${cartUuid}/items/${itemUuid}`
},
metafields: {
batch: "/carts/metafields",
path: (uuid) => `/carts/${uuid}/metafields`,
byId: (cartUuid, metafieldUuid) => `/carts/${cartUuid}/metafields/${metafieldUuid}`
},
settings: {
global: "/carts/settings",
channel: (channelId) => `/carts/settings/${channelId}`
}
};
var channels = {
path: "/channels",
byId: (id) => `/channels/${id}`,
activeTheme: (id) => `/channels/${id}/active-theme`,
site: (id) => `/channels/${id}/site`,
menus: (id) => `/channels/${id}/channel-menus`,
checkoutUrl: (id) => `/channels/${id}/site/checkout-url`,
currencyAssignments: {
path: (id) => `/channels/${id}/currency-assignments`,
byId: (channelId, id) => `/channels/${channelId}/currency-assignments/${id}`
},
listings: {
path: (id) => `/channels/${id}/listings`,
byId: (channelId, id) => `/channels/${channelId}/listings/${id}`
},
metafields: {
batch: "/channels/metafields",
path: (id) => `/channels/${id}/metafields`,
byId: (channelId, id) => `/channels/${channelId}/metafields/${id}`
}
};
var checkouts = {
path: (uuid) => `/checkouts/${uuid}`,
billingAddress: (uuid) => `/checkouts/${uuid}/billing-address`,
consignments: {
path: (uuid) => `/checkouts/${uuid}/consignments`,
byId: (checkoutUuid, consignmentUuid) => `/checkouts/${checkoutUuid}/consignments/${consignmentUuid}`
},
coupons: {
add: (uuid) => `/checkouts/${uuid}/coupons`,
delete: (uuid, code) => `/checkouts/${uuid}/coupons/${code}`
},
discounts: (uuid) => `/checkouts/${uuid}/discounts`,
fees: (uuid) => `/checkouts/${uuid}/fees`,
createOrder: (uuid) => `/checkouts/${uuid}/orders`,
settings: "/checkouts/settings",
createToken: (uuid) => `/checkouts/${uuid}/token`
};
var currencies = {
v2: {
path: "/currencies",
byId: (id) => `/currencies/${id}`
}
};
var customers = {
path: "/customers",
addresses: (id) => `/customers/${id}/addresses`,
attributes: (id) => `/customers/${id}/attributes`,
attributesValues: (id) => `/customers/${id}/attribute-values`,
settings: {
channel: (channelId) => `/customers/settings/channels/${channelId}`,
global: "/customers/settings"
},
consent: (id) => `/customers/${id}/consent`,
formFieldValues: "/customers/form-field-values",
storedInstruments: (id) => `/customers/${id}/stored-instruments`,
validateCredentials: "/customers/validate-credentials",
metafields: {
batch: "/customers/metafields",
path: (id) => `/customers/${id}/metafields`,
byId: (customerId, id) => `/customers/${customerId}/metafields/${id}`
},
v2: {
groups: {
path: "/customer_groups",
byId: (id) => `/customer_groups/${id}`,
count: "/customer_groups/count"
},
deprecated: {
path: "/customers",
byId: (id) => `/customers/${id}`,
addresses: {
path: (id) => `/customers/${id}/addresses`,
byId: (customerId, id) => `/customers/${customerId}/addresses/${id}`
},
validatePassword: (id) => `/customers/${id}/validate_password`
}
},
subscribers: {
path: "/customers/subscribers",
byId: (id) => `/customers/subscribers/${id}`
}
};
var customerSegmentation = {
segments: "/segments",
shopperProfileSegments: (profileId) => `/shopper-profiles/${profileId}/segments`,
shopperProfiles: "/shopper-profiles",
segmentShopperProfiles: (segmentId) => `/segments/${segmentId}/shopper-profiles`
};
var geography = {
v2: {
countries: {
path: "/countries",
byId: (id) => `/countries/${id}`,
count: "/countries/count",
states: {
path: (id) => `/countries/${id}/states`,
byId: (countryId, id) => `/countries/${countryId}/states/${id}`,
count: (countryId) => `/countries/${countryId}/states/count`
}
},
states: {
path: "/countries/states",
count: "/countries/states/count"
}
}
};
var inventory = {
adjustments: {
absolute: "/inventory/adjustments/absolute",
relative: "/inventory/adjustments/relative"
},
items: {
path: "/inventory/items",
atLocation: (locationId) => `/inventory/locations/${locationId}/items`,
updateLocationSettings: (locationId) => `/inventory/locations/${locationId}/items`
}
};
var locations = {
path: "/inventory/locations",
metafields: {
batch: "/inventory/locations/metafields",
path: (id) => `/inventory/locations/${id}/metafields`,
byId: (locationId, id) => `/inventory/locations/${locationId}/metafields/${id}`
}
};
var ordersV2 = {
path: "/orders",
byId: (id) => `/orders/${id}`,
count: "/orders/count",
consignments: {
path: (id) => `/orders/${id}/consignments`,
shippingQuotes: (orderId, consignmentId) => `/orders/${orderId}/consignments/shipping/${consignmentId}/shipping_quotes`
},
coupons: (id) => `/orders/${id}/coupons`,
fees: (id) => `/orders/${id}/fees`,
messages: (id) => `/orders/${id}/messages`,
products: {
path: (id) => `/orders/${id}/products`,
byId: (orderId, id) => `/orders/${orderId}/products/${id}`
},
shipments: {
path: (id) => `/orders/${id}/shipments`,
count: (id) => `/orders/${id}/shipments/count`,
byId: (orderId, id) => `/orders/${orderId}/shipments/${id}`
},
shippingAddresses: {
path: (id) => `/orders/${id}/shipping_addresses`,
byId: (orderId, id) => `/orders/${orderId}/shipping_addresses/${id}`,
quotes: (orderId, id) => `/orders/${orderId}/shipping_addresses/${id}/shipping_quotes`
},
statuses: {
path: "/order_statuses",
byId: (id) => `/order_statuses/${id}`
},
taxes: (id) => `/orders/${id}/taxes`
};
var orders = {
v2: ordersV2,
transactions: (id) => `/orders/${id}/transactions`,
metafields: {
batch: "/orders/metafields",
path: (id) => `/orders/${id}/metafields`,
byId: (orderId, id) => `/orders/${orderId}/metafields/${id}`
},
settings: {
global: "/orders/settings",
channel: (channelId) => `/orders/settings/${channelId}`
},
payments: {
capture: (id) => `/orders/${id}/payment_actions/capture`,
void: (id) => `/orders/${id}/payment_actions/void`
},
refunds: {
path: "/orders/payment_actions/refunds",
byId: (refundId) => `/orders/payment_actions/refunds/${refundId}`,
quote: (id) => `/orders/${id}/payment_actions/refund_quote`,
forOrder: (id) => `/orders/${id}/payment_actions/refunds`
},
pickups: {
path: "/orders/pickups",
methods: "/pickup/methods",
options: "/pickup/options"
}
};
var priceLists = {
path: "/pricelists",
byId: (id) => `/pricelists/${id}`,
assignments: {
path: "/pricelists/assignments",
byId: (id) => `/pricelists/assignments/${id}`
},
records: {
path: "/pricelists/records",
forList: (id) => `/pricelists/${id}/records`,
byVariant: (listId, variantId) => `/pricelists/${listId}/records/${variantId}`,
byCurrency: (listId, variantId, currencyCode) => `/pricelists/${listId}/records/${variantId}/${currencyCode}`
}
};
var promotions = {
path: "/promotions",
byId: (id) => `/promotions/${id}`,
coupons: {
path: (promotionId) => `/promotions/${promotionId}/codes`,
byId: (promotionId, id) => `/promotions/${promotionId}/codes/${id}`
},
settings: "/promotions/settings"
};
var redirects = {
path: "/storefront/redirects",
imexJobs: "/storefront/redirects/imex/jobs",
createExportJob: "/storefront/redirects/imex/export",
createImportJob: "/storefront/redirects/imex/import",
exportEventStream: (jobUuid) => `/storefront/redirects/imex/export/${jobUuid}/events`,
importEventStream: (jobUuid) => `/storefront/redirects/imex/import/${jobUuid}/events`,
downloadExport: (jobUuid) => `/storefront/redirects/imex/export/${jobUuid}/download`
};
var scripts = {
path: "/content/scripts",
byId: (uuid) => `/content/scripts/${uuid}`
};
var settings = {
analytics: {
providers: "/settings/analytics",
provider: (providerId) => `/settings/analytics/${providerId}`
},
catalog: "/settings/catalog",
emailStatuses: "/settings/email-statuses",
createFavicon: "/settings/favicon/image",
inventory: {
path: "/settings/inventory",
notifications: "/settings/inventory/notifications"
},
logo: {
path: "/settings/logo",
image: "/settings/logo/image"
},
filters: {
enabled: "/settings/search/filters",
available: "/settings/search/filters/available",
contextual: "/settings/search/filters/contexts"
},
locale: "/settings/locale",
profile: "/settings/profile",
storefront: {
category: "/settings/storefront/category",
product: "/settings/storefront/product",
robotstxt: "/settings/storefront/robotstxt",
search: "/settings/storefront/search",
security: "/settings/storefront/security",
seo: "/settings/storefront/seo",
status: "/settings/storefront/status",
uom: "/settings/storefront/units-of-measurement"
}
};
var shippingV2 = {
carrierConnections: "/shipping/carrier/connection",
methods: {
path: (zoneId) => `/shipping/zones/${zoneId}/methods`,
byId: (zoneId, id) => `/shipping/zones/${zoneId}/methods/${id}`
},
zones: {
path: "/shipping/zones",
byId: (id) => `/shipping/zones/${id}`
}
};
var shipping = {
v2: shippingV2,
customsInformation: "/shipping/products/customs-information",
settings: {
global: "/shipping/settings",
channel: (channelId) => `/shipping/settings/${channelId}`
}
};
var sites = {
path: "/sites",
byId: (id) => `/sites/${id}`,
certificates: {
all: "/sites/certificates",
forSite: (id) => `/sites/${id}/certificates`
},
routes: {
path: (siteId) => `/sites/${siteId}/routes`,
byId: (siteId, id) => `/sites/${siteId}/routes/${id}`
}
};
var store = {
v2: {
info: "/store",
time: "/time"
},
metafields: {
batch: "/store/metafields",
path: (id) => `/store/metafields/${id}`,
byId: (storeId, id) => `/store/metafields/${storeId}/${id}`
},
logs: "/store/systemlogs"
};
var tax = {
v2: {
classes: {
path: "/tax_classes",
byId: (id) => `/tax_classes/${id}`
}
},
customers: "/tax/customers",
rates: "/tax/rates",
zones: "/tax/zones",
properties: "/tax/properties",
productProperties: "/tax/products/properties",
settings: "/tax/settings"
};
var wishlists = {
path: "/wishlists",
byId: (id) => `/wishlists/${id}`,
items: {
delete: (id, itemId) => `/wishlists/${id}/items/${itemId}`,
add: (id) => `/wishlists/${id}/items`
}
};
var webhooks = {
path: "/hooks",
byId: (id) => `/hooks/${id}`,
admin: "/hooks/admin",
upsertEmailNotifications: "/hooks/admin"
};
var bc = {
catalogSummary,
products,
modifiers,
variantOptions,
variants,
brands,
categories,
trees,
abandonedCarts,
carts,
channels,
checkouts,
currencies,
customers,
customerSegmentation,
geography,
inventory,
locations,
orders,
priceLists,
promotions,
redirects,
scripts,
settings,
shipping,
sites,
store,
tax,
wishlists,
webhooks
};
export {
bc,
customerSegmentation,
geography
};
//# sourceMappingURL=endpoints.js.map