Global

Members

Button

Button component used for payment buttons

.

Source:

Button component used for payment buttons

(constant) client

In React components, you should use Apollo.

Source:

In React components, you should use Apollo. This client is available for Blaze components and other code, but ideally we will not need this forever.

collectionIndex

Sets up necessary indexes on a collection. A wrapper around createIndex

Source:

(constant) CommonOrder :SimpleSchema

The CommonOrder schema describes an order for a single shop, containing only properties that can be provided by a Cart as well. Each fulfillment group in a Cart or Order can be transformed into a single CommonOrder. This allows plugins that operate on both cart and order to provide only a single function, accepting a CommonOrder, where the caller can transform and store the result as necessary for either Cart or Order. For example, tax services accept a CommonOrder and calculate taxes without knowing or caring whether it is for a Cart or an Order.

Source:
Type:
  • SimpleSchema

components

If you've set up a components context using @reactioncommerce/components-context (recommended), then this prop will come from there automatically.

Source:

If you've set up a components context using @reactioncommerce/components-context (recommended), then this prop will come from there automatically. If you have not set up a components context or you want to override one of the components in a single spot, you can pass in the components prop directly.

composer

Builds productMediaById object and passes to child component

Source:

(constant) createdAt

Source:
To Do:
  • TEMP mocks this will be removed in favor of a fixture/factory solution

createDefaultNavigationTree

Creates a default navigation tree for a shop

Source:

customFields

If you need to store customFields, be sure to add them to your GraphQL input schema and your Order SimpleSchema with proper typing.

Source:

If you need to store customFields, be sure to add them to your GraphQL input schema and your Order SimpleSchema with proper typing. This schema need not care what customFields is because the input and Order schemas will validate. Thus, we use blackbox here.

customFields

Custom key/value data that you need to store.

Source:

Custom key/value data that you need to store. You'll need to extend GraphQL schemas if you want to expose any of this data through the API.

customFields

Custom key/value data that you need to store.

Source:

Custom key/value data that you need to store. You'll need to extend GraphQL schemas if you want to expose any of this data through the API.

customFields

Custom key/value data that you need to store.

Source:

Custom key/value data that you need to store. You'll need to extend GraphQL schemas if you want to expose any of this data through the API.

customTaxFields

Custom key/value data that you need to store.

Source:

Custom key/value data that you need to store. You'll need to extend GraphQL schemas if you want to expose any of this data through the API.

customTaxFields

Custom key/value data that you need to store.

Source:

Custom key/value data that you need to store. You'll need to extend GraphQL schemas if you want to expose any of this data through the API.

decodeNavigationTreeItemIds

Recursively decodes opaque _ids for items in a navigation tree

Source:

(constant) depth0

Default Theme Shadows

.

Source:

Default Theme Shadows

extendCommonOrder

Get shipping attributes for a fulfillment group that will be used to determine any applicable shipping restrictions.

Source:

(constant) fakeAddresses :Array.<Object>

array of suggested address objects

.

Source:

array of suggested address objects

Type:
  • Array.<Object>

(constant) fakeValidationErrors :Array.<Object>

array of generic validation errors objects

.

Source:

array of generic validation errors objects

Type:
  • Array.<Object>

findCatalogProductsAndVariants

Returns products in the Catalog collection that correspond to the cart items provided.

Source:

formatPhoneNumber

prepends country code to phone no. if required

Source:

generateSitemaps

Generates & stores sitemap documents for one or more shops, without Meteor method context

Source:

generateSitemapsJob

Initializes and processes a job that regenerates XML sitemaps

Source:

getAbsoluteUrl

Combines and returns the given root URL and path

Source:

getNavigationItemContentForLanguage

Returns translated navigation item content

Source:

getNavigationTreeItemIds

Recursively returns the _ids of all items in a navigation tree

Source:

getPaymentMethodConfigByName

Source:

getRootNode

Loads and returns element for #react-root

Source:

getRootUrl

Returns the root URL, returning process.env.ROOT_URL if set, otherwise using the request's protocol & hostname

Source:

getSitemapXML

Loads and returns the XML for one of a shop's sitemaps

Source:

getStripeApi

Source:

getStripeApiKey

Source:

getStripeInstance

Source:

getStripeInstance

Source:

getSurchargeMessageForLanguage

Returns translated surcharge message

Source:

getTagSuggestions

Returns tags matching the given term

Source:

handleSitemapRoutes

Route handler/middleware for generated sitemap XML files

Source:

highlightInput

Uses a CSS animation to briefly highlight an input

Source:

highlightVariantInput

Does the same as highlightInput, but with a lighter green color

Source:

initApollo

Initializes Apollo Client

Source:

initBrowserRouter

Renders app inside of Apollo and React Router HOCs

Source:

(constant) internalProductIds

Source:
To Do:
  • TEMP mocks these will be removed in favor of a fixture/factory solution

(constant) internalShopId

Source:
To Do:
  • TEMP Mocks these will be removed in favor of a fixture/factory solution

(constant) internalTagIds

Source:
To Do:
  • TEMP mocks these will be removed in favor of a fixture/factory solution

isCapturing

True if currently capturing this payment

.

Source:

True if currently capturing this payment

isRefunding

True while a refund is being created

.

Source:

True while a refund is being created

isShopPrimary

Whether the current shop is the Primary Shop (vs a Merchant Shop)

Source:

lazyLoadMonths

Dynamically imports MomentJS locales and returns an array of months in user's language.

Source:

loadData

Load fixture data into various collections if those collections are blank

.

Source:

Load fixture data into various collections if those collections are blank

loadMore

Load more content for a Apollo GraphQL query

.

Source:

Load more content for a Apollo GraphQL query

loadNextPage

Load next page of content for a Apollo GraphQL query

.

Source:

Load next page of content for a Apollo GraphQL query

loadPreviousPage

Load previous page of content for a Apollo GraphQL query

.

Source:

Load previous page of content for a Apollo GraphQL query

mergeProductAndVariants

Merges a product and its variants

Source:

migrateTagNav

Migrates the existing tag nav items to a navigation tree

Source:

(constant) mockCatalogItems

mock internal catalog items

.

Source:

mock internal catalog items

(constant) mockExternalCatalogOptions

mock external catalog product variant options

.

Source:

mock external catalog product variant options

(constant) mockExternalCatalogProductNodes

Mock absolute URLs in catalog products when returned from GraphQL

.

Source:

Mock absolute URLs in catalog products when returned from GraphQL

(constant) mockExternalCatalogProducts

mock external catalog products

.

Source:

mock external catalog products

(constant) mockExternalCatalogVariants

mock external catalog product variants

.

Source:

mock external catalog product variants

(constant) mockInternalCatalogOptions

mock internal catalog product variant options

.

Source:

mock internal catalog product variant options

(constant) mockInternalCatalogProducts

mock internal catalog products

.

Source:

mock internal catalog products

(constant) mockInternalCatalogVariants

mock internal catalog product variants

.

Source:

mock internal catalog product variants

(constant) mockSortedByPriceHigh2LowCatalogItemsResponse

mock sorted by minPrice high to low catalogItems query response

.

Source:

mock sorted by minPrice high to low catalogItems query response

(constant) mockSortedByPriceLow2HighCatalogItemsResponse

mock sorted by minPrice low to high catalogItems query response

.

Source:

mock sorted by minPrice low to high catalogItems query response

(constant) mockUnsortedCatalogItemsResponse

mock unsorted catalogItems query response

.

Source:

mock unsorted catalogItems query response

onApprovePayment

Function to be called when "Approve" is clicked for a payment

.

Source:

Function to be called when "Approve" is clicked for a payment

onCapturePayment

Function to be called when "Capture" is clicked for a payment

.

Source:

Function to be called when "Capture" is clicked for a payment

onRefundPayment

Function to be called when a refund is requested for a payment

.

Source:

Function to be called when a refund is requested for a payment

orderDetailComposer

adds subscriptions to the order detail view

Source:

pagination

Create pagination functions for next and previous and page info data

.

Source:

Create pagination functions for next and previous and page info data

payment

Payment details

.

Source:

Payment details

paymentMethod

The payment method definition

.

Source:

The payment method definition

refunds

List of refunds

.

Source:

List of refunds

registerOperatorRoute

Registers new route in the operator UI.

Source:

(constant) rui_components

Default Theme Elements

.

Source:

Default Theme Elements

sendEmailCompleted

Callback for when an email has successfully been sent. Updates email status in DB, logs a debug message, and marks job as done.

Source:

sendEmailFailed

Callback for when an email delivery attempt has failed. Updates email status in DB, logs an error message, and marks job as failed.

Source:

sendSMTPEmail

Responds to the "sendEmail" app event to send an email via SMTP

Source:

setupCdn

sets prefix for the user who wants to serve bundled js and css files from different URL

Source:

(constant) standardBorderRadius

Default Theme

.

Source:

Default Theme

startup

Called on startup. Initializes SMTP email handler.

Source:

tagsByIds

Finds all tags associated with the provided array of catalog products.

Source:

xformNavigationTreeItem

Loads full navigation items documents for items in a navigation tree

Source:

xformSurchargeAmount

Transforms amount from Float to Money type

Source:

Methods

accountMongoSchemaToGraphQL(mongoAccount) → {Object}

Source:
Parameters:
Name Type Description
mongoAccount Object

The Account document in MongoDB schema

Returns:

The Account document in GraphQL schema

Type
Object

addCartItems(context, input, optionsopt) → {Promise.<Object>}

Add one or more items to a cart

Source:
Parameters:
Name Type Attributes Description
context Object

an object containing the per-request state

input Object

mutation input

options Object <optional>

Options

Properties
Name Type Attributes Description
skipPriceCheck Boolean <optional>

For backwards compatibility, set to true to skip checking price. Skipping this is not recommended for new code.

Returns:

An object with cart, minOrderQuantityFailures, and incorrectPriceFailures properties. cart will always be the full updated cart document, but incorrectPriceFailures and minOrderQuantityFailures may still contain other failures that the caller should optionally retry with the corrected price or quantity.

Type
Promise.<Object>

addCleanupJobControlHook() → {undefined}

Adds a "jobServerStart" event consumer, which registers a job to remove stale jobs.

Source:
Returns:
Type
undefined

addInventoryAvailableToSellFieldToProduct(item, collections) → {Object}

Source:
Parameters:
Name Type Description
item Object

The catalog item to transform

collections Object

The catalog item to transform

Returns:

The converted item document

Type
Object

addOrderFulfillmentGroup(context, input) → {Promise.<Object>}

Use this mutation to add a new order fulfillment group to an order. It must have at least one item, which can be provided or moved from another existing group.

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input. See SimpleSchema

Returns:

Object with order property containing the updated order and a newFulfillmentGroupId property set to the ID of the added group

Type
Promise.<Object>

addressValidation(input, context) → {Promise.<Object>}

Returns address validation results for an address. Call the first registered function of type "addressValidation". If none registered, returns an object with no suggestions and no errors, indicating the address is

Source:
Parameters:
Name Type Description
input Object

Input object

Properties
Name Type Description
address Object

The AddressInput to validate

shopId Object

The shop to use for address validation settings

context Object

an object containing the per-request state

Returns:

Promise that resolves with an object with results

Type
Promise.<Object>

addressValidation(input) → {Object}

Creating an AddressValidationResults object the address.postal to grab a slices of mock validation data.

Source:
Parameters:
Name Type Description
input Object

Input object

Properties
Name Type Description
address Object

input address object

context Object

input GQL context

Returns:

AddressValidationResults

Type
Object

addressValidationServices() → {Promise.<Array.<Object>>}

Returns all registered address validation services

Source:
Returns:

Promise that resolves with an object with results

Type
Promise.<Array.<Object>>

addRoutePrefixToPackageRoutes(packageRoutes) → {Array}

allows overriding of prefix in route definitions

.

Source:

allows overriding of prefix in route definitions

Parameters:
Name Type Description
packageRoutes Array

package routes

Returns:

updatedRoutes

Type
Array

approvePayment(orderId, paymentId) → {Promise.<null>}

Source:
Parameters:
Name Type Description
orderId String

The order ID

paymentId String

The ID of the payment to approve

Returns:

null

Type
Promise.<null>

Apps(optionHash) → {Array.<Object>}

Source:
Parameters:
Name Type Description
optionHash optionHash

Option hash

Returns:

returns an array of filtered, structure reactionApps

Type
Array.<Object>

attributeDenyCheck(methodRestrictions, method, hydratedOrder) → {Bool}

Filter shipping methods based on per method deny attribute restrictions

Source:
Parameters:
Name Type Description
methodRestrictions Object

method restrictions from FlatRateFulfillmentRestrcitionsCollection

method Object

current method to check restrcictions against

hydratedOrder Object

hydrated order for current order

Returns:

true / false as to whether method is still valid after this check

Type
Bool

buildAccountSearch() → {undefined}

buildAccountSearch

Source:
Returns:
Type
undefined

buildOrderSearch() → {undefined}

buildOrderSearch

Source:
Returns:
Type
undefined

camelToSpace(str) → {String}

convert a camelcased string to spaces

Source:
Parameters:
Name Type Description
str String

camelcased string

Returns:

returns space formatted string

Type
String

cancelOrderItem(context, input) → {Promise.<Object>}

Use this mutation to cancel one item of an order, either for the full ordered quantity or for a partial quantity. If partial, the item will be split into two items and the original item will have a lower quantity and will be canceled.

If this results in all items in a fulfillment group being canceled, the group will also be canceled. If this results in all fulfillment groups being canceled, the full order will also be canceled.

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input. See SimpleSchema

Returns:

Object with order property containing the created order

Type
Promise.<Object>

captureOrderPayments(context, input) → {Promise.<Object>}

Attempt to capture one or more authorized payments for an order

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

CaptureOrderPaymentsInput

Properties
Name Type Description
orderId String

The order ID

paymentIds Array.<String>

An array of one or more payment IDs to capture

shopId String

The ID of the shop that owns this order

Returns:

CaptureOrderPaymentsResult

Type
Promise.<Object>

cartCleanupJob() → {undefined}

A background job for removing stale carts

Source:
Returns:
Type
undefined

check() → {Boolean}

Mock Meteor.check function for the Node app

Source:
Returns:

true

Type
Boolean

composer(props, onData)

Source:
Parameters:
Name Type Description
props *
onData *

composer(props, onData)

composer - reactive Tracker wrapped function

Source:
Since:
  • 1.1.12
Parameters:
Name Type Description
props Object
onData function

composer(props, onData) → {undefined}

Tracker reactive props

Source:
Parameters:
Name Type Description
props Object

Incoming props

onData function

Callback for more props

Returns:
Type
undefined

composer(props, onData) → {undefined}

Products composer

Source:
Parameters:
Name Type Description
props Object

Props from parent

onData function

Call with props changes

Returns:
Type
undefined

composer(props, onData) → {undefined}

Composer function

Source:
Parameters:
Name Type Description
props Object

Props from parent

onData function

Callback to pass more props

Returns:
Type
undefined

composer(props, onData) → {undefined}

Composer function to fetch variants and options

.

Source:

Composer function to fetch variants and options

Parameters:
Name Type Description
props Object

Props

onData function

Data callback

Returns:

no return

Type
undefined

composer(props, onData) → {undefined}

Composer function for product and variant data

.

Source:

Composer function for product and variant data

Parameters:
Name Type Description
props Object

Component props to compose

onData onData

Data callback

Returns:

No return

Type
undefined

composer(props, onData) → {undefined}

Composer

Source:
Parameters:
Name Type Description
props Object

Provided props

onData function

Call this with props

Returns:
Type
undefined

composer(props, onData) → {undefined}

Source:
Parameters:
Name Type Description
props Object

Passed props

onData function

Callback to call with data

Returns:
Type
undefined

composer(props, onData) → {undefined}

Source:
Parameters:
Name Type Description
props Object

Props from parent

onData function

Callback

Returns:
Type
undefined

composer(props, onData)

Source:
Parameters:
Name Type Description
props *
onData *

composeUrl(pathOrOptionsopt, optionalOptionsopt) → {String}

Generate an absolute URL pointing to the application. The server reads from the ROOT_URL environment variable to determine where it is running. This is taken care of automatically for apps deployed to Galaxy, but must be provided when using meteor build. (this code is based on Meteor.absoluteUrl)

Source:
Parameters:
Name Type Attributes Description
pathOrOptions String <optional>

A path to append to the root URL. Do not include a leading "/".

optionalOptions Object <optional>

URL composition options

Properties
Name Type Description
secure Boolean

Create an HTTPS URL.

replaceLocalhost Boolean

Replace localhost with 127.0.0.1. Useful for services that don't recognize localhost as a domain name.

options.rootUrl String

Override the default ROOT_URL from the server environment. For example: "http://foo.example.com"

Returns:

the crafted URL

Type
String

convertCart(cart) → {Object}

Source:
Parameters:
Name Type Description
cart Object

The cart document to transform

Returns:

The converted cart document

Type
Object

convertCartDown(cart) → {Object}

Migrate down one cart

Source:
Parameters:
Name Type Description
cart Object

The cart to convert

Returns:

The converted cart

Type
Object

convertCartDown(cart) → {Object}

Migrate down one cart

Source:
Parameters:
Name Type Description
cart Object

The cart to convert

Returns:

The converted cart

Type
Object

convertCartUp(cart) → {Object}

Migrate up one cart

Source:
Parameters:
Name Type Description
cart Object

The cart to convert

Returns:

The converted cart

Type
Object

convertCartUp(cart) → {Object}

Migrate up one cart

Source:
Parameters:
Name Type Description
cart Object

The cart to convert

Returns:

The converted cart

Type
Object

convertCatalogItemVariants(item, collections) → {Object}

Source:
Parameters:
Name Type Description
item Object

The catalog item to transform

collections Object

The catalog item to transform

Returns:

The converted item document

Type
Object

convertCatalogItemVariants(item, collections) → {Object}

Source:
Parameters:
Name Type Description
item Object

The catalog item to transform

collections Object

The catalog item to transform

Returns:

The converted item document

Type
Object

convertCatalogItemVariants(item, collections) → {Object}

Source:
Parameters:
Name Type Description
item Object

The catalog item to transform

collections Object

The catalog item to transform

Returns:

The converted item document

Type
Object

convertInvoice(invoice) → {Object}

Converts a single invoice object

Source:
Parameters:
Name Type Description
invoice Object

The invoice document to transform

Returns:

The converted invoice document

Type
Object

convertOrder(order, packages) → {Object}

Source:
Parameters:
Name Type Description
order Object

The order document to transform

packages Array.<Object>

Array of all Package docs from the database

Returns:

The converted order document

Type
Object

convertOrderFulfillmentGroup(group, order, packages) → {Object}

Converts a single order fulfillment group

Source:
Parameters:
Name Type Description
group Object

The order fulfillment group document to transform

order Object

The order document in which this group lives

packages Array.<Object>

Array of all Package docs from the database

Returns:

The converted order document

Type
Object

convertOrderGroupDown(group) → {Object}

Migrate down one order.shipping group

Source:
Parameters:
Name Type Description
group Object

The group to convert

Returns:

The converted group

Type
Object

convertOrderGroupUp(group) → {Object}

Migrate up one order.shipping group

Source:
Parameters:
Name Type Description
group Object

The group to convert

Returns:

The converted group

Type
Object

convertOrderItem(item) → {Object}

Converts a single order item

Source:
Parameters:
Name Type Description
item Object

The order item document to transform

Returns:

The converted order item document

Type
Object

CoreLayout() → {Node}

Core layout component This component has been re-commissioned as a login form for admins to redirect to operator 2.0

.

Source:

Core layout component This component has been re-commissioned as a login form for admins to redirect to operator 2.0

Returns:

React component

Type
Node

createCart(context, input) → {Promise.<Object>}

Create a new cart for a shop with an initial list of items in it.

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

mutation input

Properties
Name Type Attributes Description
items String

An array of cart items to add to the new cart. Must not be empty.

shopId String

The ID of the shop that will own this cart

shouldCreateWithoutItems Boolean <optional>

Create even if items is empty or becomes empty due to price mismatches? Default is false. This is for backwards compatibility with old Meteor code that creates the cart prior to adding items and should not be set to true in new code.

Returns:

An object with cart, minOrderQuantityFailures, and incorrectPriceFailures properties. cart will be null if all prices were incorrect. If at least one item could be added, then the cart will have been created and returned, but incorrectPriceFailures and minOrderQuantityFailures may still contain other failures that the caller should optionally retry with the correct price or quantity.

Type
Promise.<Object>

(async) createDefaultAdminUser(context) → {String}

Creates the default admin user on startup

Source:
Parameters:
Name Type Description
context Object

App context

Returns:

The new or existing "owner" user ID

Type
String

createFlatRateFulfillmentMethodMutation(context, input) → {Promise.<Object>}

Creates a flat rate fulfillment method

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a method property containing the created method

Type
Promise.<Object>

createFlatRateFulfillmentRestrictionMutation(context, input) → {Promise.<Object>}

Creates a flat rate fulfillment restriction

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a restriction property containing the created restriction

Type
Promise.<Object>

createNavigationItem(context, navigationItem) → {Promise.<Object>}

Creates a nav item

Source:
Parameters:
Name Type Description
context Object

An object containing the per-request state

navigationItem Object

Nav item to add. See schema.graphql

Returns:

The created navigation item

Type
Promise.<Object>

(async) createPayments(accountIdopt, billingAddressopt, currencyCode, currencyExchangeInfo, email, orderTotal, paymentsInput, shippingAddressopt, shopId) → {Array.<Object>}

Create all authorized payments for a potential order

Source:
Parameters:
Name Type Attributes Description
accountId String <optional>

The ID of the account placing the order

billingAddress Object <optional>

Billing address for the order as a whole

currencyCode String

Currency code for interpreting the amount of all payments

currencyExchangeInfo Object

Currency exchange info

email String

Email address for the order

orderTotal Number

Total due for the order

paymentsInput Array.<Object>

List of payment inputs

shippingAddress Object <optional>

Shipping address, if relevant, for fraud detection

shopId String

ID of shop that owns the order

Returns:

Array of created payments

Type
Array.<Object>

createSurchargeMutation(context, input) → {Promise.<Object>}

Creates a surcharge

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a surcharge property containing the created surcharge

Type
Promise.<Object>

decodeCartItemsOpaqueIds(items) → {Array.<Object>}

Source:
Parameters:
Name Type Description
items Array.<Object>

Array of CartItemInput

Returns:

Same array with all IDs transformed to internal

Type
Array.<Object>

defaultAddCallMethod(context) → {undefined}

A default addCallMeteorMethod function. Adds callMeteorMethod function to the context (mutates it)

Source:
Parameters:
Name Type Description
context Object

The application context

Returns:
Type
undefined

(async) defaultValidator(doc) → {Array.<Object>}

The default form validator

Source:
See:
Parameters:
Name Type Description
doc Object

The document to validate

Returns:

ReactoForm validation errors array

Type
Array.<Object>

deleteFlatRateFulfillmentMethodMutation(context, input) → {Promise.<Object>}

deletes a flat rate fulfillment method

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a method property containing the deleted method

Type
Promise.<Object>

deleteFlatRateFulfillmentRestriction(context, input) → {Promise.<Object>}

deletes a flat rate fulfillment restriction

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a restriction property containing the deleted restriction

Type
Promise.<Object>

deleteNavigationItem(context, _id) → {Promise.<Object>}

Deletes a navigation item

Source:
Parameters:
Name Type Description
context Object

An object containing the per-request state

_id String

_id of navigation item to delete

Returns:

Deleted navigation item

Type
Promise.<Object>

deleteSurcharge(context, input) → {Promise.<Object>}

deletes a surcharge

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a surcharge property containing the deleted surcharge

Type
Promise.<Object>

determineInitialGroupForItem(currentGroups, supportedFulfillmentTypes, shopId) → {Object|null}

Figures out which fulfillment group a cart item should initially be in

Source:
Parameters:
Name Type Description
currentGroups Array.<Object>

The current cart fulfillment groups array

supportedFulfillmentTypes Array.<String>

Array of fulfillment types supported by the item

shopId String

The ID of the shop that owns the item (product)

Returns:

The group or null if no viable group

Type
Object | null

enablePaymentMethodForShop(context, input) → {Promise.<Array.<Object>>}

Enables (or disables) payment method for a given shop

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

EnablePaymentMethodForShopInput

Properties
Name Type Attributes Description
isEnabled String

Whether to enable or disable specified payment method

paymentMethodName String

The name of the payment method to enable or disable

shopId String

The id of the shop to enable payment method on

clientMutationId String <optional>

An optional string identifying the mutation call

Returns:

Array

Type
Promise.<Array.<Object>>

expandAuthToken(token) → {Object}

Expands an Auth token

Source:

Given an Authorization Bearer token it returns a JSON object with user properties and claims found

Parameters:
Name Type Description
token String

Auth token

Returns:

JSON object

Type
Object

fetchRateJobs() → {undefined}

Set up workers for "shop/fetchCurrencyRates" and "shop/flushCurrencyRates" jobs

Source:
Returns:
Type
undefined

flattenCatalogProductVariants(product) → {Array}

Flatten variant tree from a Catalog Item Product document

.

Source:

Flatten variant tree from a Catalog Item Product document

Parameters:
Name Type Description
product Object

A Catalog Item Product document

Returns:

Variant array

Type
Array

flushCurrencyRate() → {undefined}

Removes exchange rates that are too old. Called by background job

Source:
Fires:
  • Collections.Shops#event:update
Returns:
Type
undefined

getAddressValidationService(context, shopId, countryCode) → {Array.<Object>}

Source:
Parameters:
Name Type Description
context Object

The app context

shopId String

The shop ID

countryCode String

The country code of the address to be validated

Returns:

The first enabled validation services for the shop with ID shopId that supports countryCode.

Type
Array.<Object>

getAnonymousCartsReactive() → {Array.<Object>}

Gets a reactive array of anonymous carts saved locally

Source:
Returns:

Cart objects with _id and token

Type
Array.<Object>

getCatalogProductMedia(productId, collections) → {Promise.<Array.<Object>>}

Get an array of ImageInfo objects by Product ID

Source:
Parameters:
Name Type Description
productId String

A product ID. Must be a top-level product.

collections Object

Raw mongo collections

Returns:

Array of ImageInfo objects sorted by priority

Type
Promise.<Array.<Object>>

(async) getCurrencyExchangeObject(collections, cartCurrencyCode, shopId, accountopt) → {Object}

Gets an object representing the exchange rate at the time of an order

Source:
Parameters:
Name Type Attributes Description
collections Object

Map of MongoDB collections

cartCurrencyCode String

The currency code of the cart

shopId String

The ID of the shop that owns the order

account Object <optional>

Current account for this request, if there is one

Returns:

Object with userCurrency and exchangeRate properties

Type
Object

(async) getCurrencyRates(collections, shopId, currencyCode) → {Number|null}

Gets currency rates from a shop

Source:
Parameters:
Name Type Description
collections Object

Map of MongoDB collections

shopId String

The ID of the shop to get rates from

currencyCode String

The currency code

Returns:

The rate, or null if there isn't one.

Type
Number | null

getCurrentCatalogPriceForProductConfigurations(productConfigurations, currencyCode) → {Promise.<Array.<Object>>}

"catalog/getCurrentCatalogPriceForProductConfigurations" Meteor method wrapped in Promise

Source:
Parameters:
Name Type Description
productConfigurations Array.<Object>

Array of product configurations

currencyCode String

Currency in which to get prices

Returns:

Same productConfigurations array, with price added

Type
Promise.<Array.<Object>>

getDisplayPrice(minPrice, maxPrice, currencyInfo) → {String}

Returns a price for front-end display in the given currency

Source:
Parameters:
Name Type Description
minPrice Number

Minimum price

maxPrice Number

Maximum price

currencyInfo Object

Currency object from Reaction shop schema

Returns:

Display price with currency symbol(s)

Type
String

getEditFocus()

get "edit/focus" value from current Reaction state

Source:
Since:
  • 1.1.12

getEnabledAddressValidationServices() → {Array.<Object>}

Source:
Returns:

The list of enabled address validation services for the current shop, from package settings, with each item having _id, createdAt, countryCodes, and serviceName props

Type
Array.<Object>

getEnabledAddressValidationServicesForShop(context, shopId) → {Array.<Object>}

Source:
Parameters:
Name Type Description
context Object

The app context

shopId String

The shop ID

Returns:

The enabled validation services for the shop with ID shopId

Type
Array.<Object>

getEnabledPackageRoutes(ReactionLayout, packages) → {Array}

get package registry route configurations

.

Source:

get package registry route configurations

Parameters:
Name Type Description
ReactionLayout function

ReactionLayout

packages Array

package routes

Returns:

enabled package routes

Type
Array

getFlatVariantsAndOptions(catalogProductVariants) → {Array.<Object>}

Source:
Parameters:
Name Type Description
catalogProductVariants Array.<Object>

The product.variants array from a catalog item

Returns:

All variants and their options flattened in one array

Type
Array.<Object>

getGraphQLContextInMeteorMethod(userId) → {Object}

Call this in a Meteor method that wraps a GraphQL mutation, to get a context to pass to the mutation.

Source:

Calls buildContext to build a GraphQL context object, after first looking up the user by userId in collections.users.

Usage in a Meteor method:

const context = Promise.await(getGraphQLContextInMeteorMethod(this.userId));
Parameters:
Name Type Description
userId String

The user ID for the current request

Returns:

A GraphQL context object

Type
Object

getItemSecondaryLabel(item) → {String}

Get the secondary label for the product item

.

Source:

Get the secondary label for the product item

Parameters:
Name Type Description
item Object

A product, variant or option

Returns:

A text label with status and price

Type
String

getPluginSettings() → {Object|null}

Source:
Returns:

Settings from Packages collection for the current shop

Type
Object | null

getPriceRange(prices, currencyInfoopt) → {Promise.<Object>}

Get Price object from array of Product prices

Source:
Parameters:
Name Type Attributes Description
prices Array

Array of Product price properties

currencyInfo Object <optional>

A currency object in Reaction schema

Returns:

PriceRange object

Type
Promise.<Object>

getProductInventoryAvailableToSellQuantity(productId, collections, variants) → {Promise.<number>}

Get the number of product variants still avalible to sell. This calculates based off of inventoryAvailableToSell. This function can take only a top product ID and a mongo collection as params to return the product inventoryAvailableToSell quantity, which is a calculation of the sum of all variant inventoryAvailableToSell quantities.

Source:
Parameters:
Name Type Description
productId Object

A top level product variant object.

collections Object

Raw mongo collections.

variants Array.<Object>

Array of product variant option objects.

Returns:

Variant quantity.

Type
Promise.<number>

getProductInventoryAvailableToSellQuantity(productId, collections, variants) → {Promise.<number>}

Get the number of product variants still avalible to sell. This calculates based off of inventoryAvailableToSell. This function can take only a top product ID and a mongo collection as params to return the product inventoryAvailableToSell quantity, which is a calculation of the sum of all variant inventoryAvailableToSell quantities.

Source:
Parameters:
Name Type Description
productId Object

A top level product variant object.

collections Object

Raw mongo collections.

variants Array.<Object>

Array of product variant option objects.

Returns:

Variant quantity.

Type
Promise.<number>

getProductInventoryInStockQuantity(productId, collections, variants) → {Promise.<number>}

Get the number of product variants still avalible to sell. This calculates based off of inventoryQuantity. This function can take only a top product ID and a mongo collection as params to return the product inventoryQuantity quantity, which is a calculation of the sum of all variant inventoryQuantity quantities.

Source:
Parameters:
Name Type Description
productId Object

A top level product variant object.

collections Object

Raw mongo collections.

variants Array.<Object>

Array of product variant option objects.

Returns:

Variant quantity.

Type
Promise.<number>

getProductInventoryInStockQuantity(productId, collections, variants) → {Promise.<number>}

Get the number of product variants still avalible to sell. This calculates based off of inventoryInStock. This function can take only a top product ID and a mongo collection as params to return the product inventoryInStock quantity, which is a calculation of the sum of all variant inventoryInStock quantities.

Source:
Parameters:
Name Type Description
productId Object

A top level product variant object.

collections Object

Raw mongo collections.

variants Array.<Object>

Array of product variant option objects.

Returns:

Variant quantity.

Type
Promise.<number>

getProductPriceRange(productId, collections) → {Promise.<Object>}

Get the PriceRange object for a Product by ID

Source:
Parameters:
Name Type Description
productId String

A product ID

collections Object

Raw mongo collections

Returns:

Product PriceRange object

Type
Promise.<Object>

getSelectedProducts() → {Array.<Object>}

Get the list of selected products

Source:
Returns:

Product documents

Type
Array.<Object>

getStripeShippingObject(address) → {Object|null}

Given a Reaction shipping address, returns a Stripe shipping object. Otherwise returns null.

Source:
Parameters:
Name Type Description
address Object

The shipping address

Returns:

The shipping object.

Type
Object | null

getStripeShippingObject(address) → {Object|null}

Given a Reaction shipping address, returns a Stripe shipping object. Otherwise returns null.

Source:
Parameters:
Name Type Description
address Object

The shipping address

Returns:

The shipping object.

Type
Object | null

getSuggestedAddress(postalCode) → {Array.<Object>}

Creating a array of suggested addresses by using the first number of the address.postal to grab a slice of faker created addresses. If the address.postal code starts with "9" we return an empty array.

Source:
Parameters:
Name Type Description
postalCode String

address postal code.

Returns:

SuggestedAddresses - array of suggested addresses.

Type
Array.<Object>

(async) getTaxesForShop(collections, order) → {Array.<Object>}

Gets all applicable tax definitions based on shop ID and shipping address of a fulfillment group

Source:
Parameters:
Name Type Description
collections Object

Map of MongoDB collections

order Object

The order

Returns:

Array of tax definition docs

Type
Array.<Object>

getTaxServicesForShop(context, shopId) → {Object}

Source:
Parameters:
Name Type Description
context Object

The app context

shopId String

The shop ID

Returns:

An object containing the definitions from registerPackage for the primary and fallback tax services currently enabled for the shop with ID shopId.

Type
Object

getTopLevelProduct(productOrVariantId, collections) → {Promise.<Array.<Object>>}

Get a top level product based on provided ID

Source:
Parameters:
Name Type Description
productOrVariantId String

A variant or top level Product Variant ID.

collections Object

Raw mongo collections.

Returns:

Top level product object.

Type
Promise.<Array.<Object>>

getTopLevelProduct(productOrVariantId, collections) → {Promise.<Array.<Object>>}

Get a top level product based on provided ID

Source:
Parameters:
Name Type Description
productOrVariantId String

A variant or top level Product Variant ID.

collections Object

Raw mongo collections.

Returns:

Top level product object.

Type
Promise.<Array.<Object>>

getTopLevelVariant(productOrVariantId, collections) → {Promise.<Array.<Object>>}

Get a top level variant based on provided ID

Source:
Parameters:
Name Type Description
productOrVariantId String

A variant or top level Product Variant ID.

collections Object

Raw mongo collections.

Returns:

Top level product object.

Type
Promise.<Array.<Object>>

getTopLevelVariant(productOrVariantId, collections) → {Promise.<Array.<Object>>}

Get a top level variant based on provided ID

Source:
Parameters:
Name Type Description
productOrVariantId String

A variant or top level Product Variant ID.

collections Object

Raw mongo collections.

Returns:

Top level product object.

Type
Promise.<Array.<Object>>

getTopVariants()

Source:

getTopVariants() → {Array.<Object>}

Get top level variants

.

Source:

Get top level variants

Returns:

Array of variant objects

Type
Array.<Object>

getTopVariants()

Source:

getURL(item) → {String}

Get url for product, variant or option

.

Source:

Get url for product, variant or option

Parameters:
Name Type Description
item Object

Product, variant or option

Returns:

URL

Type
String

getURL(item) → {String}

Get url for product, variant or option

.

Source:

Get url for product, variant or option

Parameters:
Name Type Description
item Object

Product, variant or option

Returns:

URL

Type
String

getUserId() → {String}

returns the userId of logged in user (e.g Meteor.userId())

Source:
Returns:

String

Type
String

getUserId() → {String}

returns the userId of logged in user (e.g Meteor.userId())

Source:
Returns:

String

Type
String

getValidationErrors(postalCode) → {Array.<Object>}

Creating a array of validation errors by using the second number of the address.postal to grab a slice of mock validation errors. If the address.postal code starts with "9" we return an empty array.

Source:
Parameters:
Name Type Description
postalCode String

address postal code.

Returns:

ValidationErrors - array of address validation errors.

Type
Array.<Object>

getVariantInventoryAvailableToSellQuantity(variant, collections, variants) → {Promise.<number>}

Get the number of product variants still avalible to sell. This calculates based off of inventoryAvailableToSell. This function can take only a top level variant object and a mongo collection as params to return the product variant quantity. This method can also take a top level variant, mongo collection and an array of product variant options as params to skip the db lookup and return the variant quantity based on the provided options.

Source:
Parameters:
Name Type Description
variant Object

A top level product variant object.

collections Object

Raw mongo collections.

variants Array.<Object>

Array of product variant option objects.

Returns:

Variant quantity.

Type
Promise.<number>

getVariantInventoryAvailableToSellQuantity(variant, collections, variants) → {Promise.<number>}

Get the number of product variants still avalible to sell. This calculates based off of inventoryAvailableToSell. This function can take only a top level variant object and a mongo collection as params to return the product variant quantity. This method can also take a top level variant, mongo collection and an array of product variant options as params to skip the db lookup and return the variant quantity based on the provided options.

Source:
Parameters:
Name Type Description
variant Object

A top level product variant object.

collections Object

Raw mongo collections.

variants Array.<Object>

Array of product variant option objects.

Returns:

Variant quantity.

Type
Promise.<number>

getVariantInventoryInStockQuantity(variant, collections, variants) → {Promise.<number>}

Get the number of product variants in stock. This calculates based off of inventoryInStock. This function can take only a top level variant object and a mongo collection as params to return the product variant quantity. This method can also take a top level variant, mongo collection and an array of product variant options as params to skip the db lookup and return the variant quantity based on the provided options.

Source:
Parameters:
Name Type Description
variant Object

A top level product variant object.

collections Object

Raw mongo collections.

variants Array.<Object>

Array of product variant option objects.

Returns:

Variant quantity.

Type
Promise.<number>

getVariantInventoryInStockQuantity(variant, collections, variants) → {Promise.<number>}

Get the number of product variants in stock. This calculates based off of inventoryQuantity. This function can take only a top level variant object and a mongo collection as params to return the product variant quantity. This method can also take a top level variant, mongo collection and an array of product variant options as params to skip the db lookup and return the variant quantity based on the provided options.

Source:
Parameters:
Name Type Description
variant Object

A top level product variant object.

collections Object

Raw mongo collections.

variants Array.<Object>

Array of product variant option objects.

Returns:

Variant quantity.

Type
Promise.<number>

getVariantInventoryNotAvailableToSellQuantity(variant, collections) → {Promise.<number>}

Get the number of product variants that are currently reserved in an order. This function can take any variant object.

Source:
Parameters:
Name Type Description
variant Object

A product variant object.

collections Object

Raw mongo collections.

Returns:

Reserved variant quantity.

Type
Promise.<number>

getVariantInventoryNotAvailableToSellQuantity(variant, collections) → {Promise.<number>}

Get the number of product variants that are currently reserved in an order. This function can take any variant object.

Source:
Parameters:
Name Type Description
variant Object

A product variant object.

collections Object

Raw mongo collections.

Returns:

Reserved variant quantity.

Type
Promise.<number>

getVariantPrice(context, catalogVariant, currencyCode) → {Object}

This method returns the applicable price and currency code for a selected product.

Source:
Parameters:
Name Type Description
context Object

App context

catalogVariant Object

A selected product variant.

currencyCode String

The currency code in which to get price

Returns:
  • A cart item price value.
Type
Object

getVariantPriceRange(variantId, collections) → {Promise.<Object>}

Create a Product PriceRange object by taking the lowest variant price and the highest variant price to create the PriceRange. If only one variant use that variant's price to create the PriceRange

Source:
Parameters:
Name Type Description
variantId string

A product variant ID.

collections Object

Raw mongo collections

Returns:

Product PriceRange object

Type
Promise.<Object>

getVariants(productOrVariantId, collections, topOnly) → {Promise.<Array.<Object>>}

Get all of a Product's Variants or only a Product's top level Variants.

Source:
Parameters:
Name Type Description
productOrVariantId string

A Product or top level Product Variant ID.

collections Object

Raw mongo collections.

topOnly boolean

True to return only a products top level variants.

Returns:

Array of Product Variant objects.

Type
Promise.<Array.<Object>>

getVariants(productOrVariantId, collections, topOnly) → {Promise.<Array.<Object>>}

Get all of a Product's Variants or only a Product's top level Variants.

Source:
Parameters:
Name Type Description
productOrVariantId string

A Product or top level Product Variant ID.

collections Object

Raw mongo collections.

topOnly boolean

True to return only a products top level variants.

Returns:

Array of Product Variant objects.

Type
Promise.<Array.<Object>>

groupMongoSchemaToGraphQL(mongoGroup) → {Object}

Source:
Parameters:
Name Type Description
mongoGroup Object

The Group document in MongoDB schema

Returns:

The Group document in GraphQL schema

Type
Object

groupMongoSchemaToGraphQL(mongoGroup) → {Object}

Source:
Parameters:
Name Type Description
mongoGroup Object

The Group document in MongoDB schema

Returns:

The Group document in GraphQL schema

Type
Object

handleArchiveProduct(product) → {undefined}

Archive (soft delete) product

.

Source:

Archive (soft delete) product

Parameters:
Name Type Description
product Object

Product object

Returns:

No return

Type
undefined

handleCloneProduct(product) → {undefined}

Clone a product with all variants, options and media in tact

.

Source:

Clone a product with all variants, options and media in tact

Parameters:
Name Type Description
product Object

Product object

Returns:

No return

Type
undefined

handleCreateOption(variant) → {Promise}

Create a new option from a supplied variant

.

Source:

Create a new option from a supplied variant

Parameters:
Name Type Description
variant Object

Variant object

Returns:

A promise that resolves to and object of shape { newVariantId }

Type
Promise

handleCreateProduct() → {undefined}

Create a new product

.

Source:

Create a new product

Returns:

No return

Type
undefined

handleCreateVariant(product) → {Promise}

Create a new variant from a supplied product

.

Source:

Create a new variant from a supplied product

Parameters:
Name Type Description
product Object

Product object

Returns:

A promise that resolves to the new variant id

Type
Promise

handleMetaRemove(productId, metafield) → {undefined}

Metafield to remove

.

Source:

Metafield to remove

Parameters:
Name Type Description
productId String

Product ID

metafield Object

Metafield object

Properties
Name Type Description
key String

Key

value String

Value

Returns:

No return

Type
undefined

handleProductFieldSave(productId, fieldName, value) → {undefined}

Save a product field

.

Source:

Save a product field

Parameters:
Name Type Description
productId String

Product ID

fieldName String

Field name to save

value Any

Value for that field

Returns:

No return

Type
undefined

handleProductRestore(product) → {undefined}

Restore an archived product

.

Source:

Restore an archived product

Parameters:
Name Type Description
product Object

Product object

Returns:

No return

Type
undefined

handleProductVariantFieldSave(variantId, fieldName, value) → {undefined}

Handle save of a product variant field

.

Source:

Handle save of a product variant field

Parameters:
Name Type Description
variantId String

Variant id

fieldName String

Field name

value Any

Any value supported by the variant schema

Returns:

No return

Type
undefined

handleToggleProductVisibility(product) → {undefined}

Toggle product visibility

.

Source:

Toggle product visibility

Parameters:
Name Type Description
product String

Product

Returns:

No return

Type
undefined

hasChildVariant(productOrVariantId, collections) → {Promise.<boolean>}

Return true if a Product or Variant has at least 1 child Product that is visible and not deleted.

Source:
Parameters:
Name Type Description
productOrVariantId string

A Product or Product Variant ID.

collections Object

Raw mongo collections.

Returns:

True if Product has a child.

Type
Promise.<boolean>

hasChildVariant(productOrVariantId, collections) → {Promise.<boolean>}

Return true if a Product or Variant has at least 1 child Product that is visible and not deleted.

Source:
Parameters:
Name Type Description
productOrVariantId string

A Product or Product Variant ID.

collections Object

Raw mongo collections.

Returns:

True if Product has a child.

Type
Promise.<boolean>

(async) hashRelatedProduct(media, collections) → {Promise.<null>}

Recalculate the currentProductHash for the related product

Source:
Parameters:
Name Type Description
media Object

The media document

collections Object

Map of MongoDB collections

Returns:

Null

Type
Promise.<null>

isDescendant(older, younger) → {Boolean}

Check if node is a descendant

.

Source:

Check if node is a descendant

Parameters:
Name Type Description
older Object

Parent

younger Object

Child

Returns:

Boolean value

Type
Boolean

isSoldOut(variant)

Source:
Parameters:
Name Type Description
variant *

locationAllowCheck(methodRestrictions, method, hydratedOrder) → {Bool}

Filter shipping methods based on per method allow location restrictions

Source:
Parameters:
Name Type Description
methodRestrictions Object

method restrictions from FlatRateFulfillmentRestrcitionsCollection

method Object

current method to check restrcictions against

hydratedOrder Object

hydrated order for current order

Returns:

true / false as to whether method is still valid after this check

Type
Bool

locationDenyCheck(methodRestrictions, method, hydratedOrder) → {Bool}

Filter shipping methods based on per method deny location restrictions

Source:
Parameters:
Name Type Description
methodRestrictions Object

method restrictions from FlatRateFulfillmentRestrcitionsCollection

method Object

current method to check restrcictions against

hydratedOrder Object

hydrated order for current order

Returns:

true / false as to whether method is still valid after this check

Type
Bool

mockCollection(collectionName) → {Object}

Returns a mock collection instance with the given name

Source:
Parameters:
Name Type Description
collectionName String

The collection name

Returns:

Mock collection instance

Type
Object

moveOrderItems(context, input) → {Promise.<Object>}

Use this mutation to move one or more items between existing order fulfillment groups.

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input. See SimpleSchema

Returns:

Object with order property containing the updated order

Type
Promise.<Object>

oauthLogin(options) → {String}

Source:
Parameters:
Name Type Description
options Object

options passed from client call

Properties
Name Type Description
challenge String

Used to fetch information about the login request from Hydra.

remember Boolean

tells hydra to remember the browser and automatically authenticate the user in future requests

Returns:

redirectUrl

Type
String

onCardExpand(cardName) → {function}

set "edit/focus" in current Reaction state

Source:
Since:
  • 1.1.12
Parameters:
Name Type Description
cardName String

card name to be set

Returns:

callback

Type
function

packageData() → {Object}

get Stripe Package record

Source:
Returns:

Package data

Type
Object

packageData() → {Object}

get Stripe Package record

Source:
Returns:

Package data

Type
Object

placeOrder(context, input) → {Promise.<Object>}

Places an order, authorizing all payments first

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input. See SimpleSchema

Returns:

Object with order property containing the created order

Type
Promise.<Object>

ProductDetail(props) → {Node}

ProductDetail component

.

Source:

ProductDetail component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

ProductHeader(props) → {Node}

Header component for various product admin forms

.

Source:

Header component for various product admin forms

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

ProductList(props) → {Node}

Product list

.

Source:

Product list

Parameters:
Name Type Description
props Object

Component props

Returns:

Component representing a list of products, variants, or options

Type
Node

ProductMediaGallery(props) → {Node}

ProductMediaGallery

.

Source:

ProductMediaGallery

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

ProductMediaItem(props) → {Node}

ProductMediaItem

.

Source:

ProductMediaItem

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

ProductTable(props) → {Node}

ProductTable component

.

Source:

ProductTable component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

publishNavigationChanges(context, _id) → {Promise.<Object>}

Publishes changes for a navigation tree and its items

Source:
Parameters:
Name Type Description
context Object

An object containing the per-request state

_id String

_id of navigation tree to publish

Returns:

Updated navigation tree

Type
Promise.<Object>

publishProducts(context, productIds) → {Promise.<Array.<Object>>}

Publish an array of products to the Catalog collection by Product ID

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

productIds Array

An array of product IDs

Returns:

Array of CatalogItemProduct objects

Type
Promise.<Array.<Object>>

publishProductsToCatalog(_, context) → {Promise.<Object>}

Publish Products to the Catalog collection by Product ID

Source:
Parameters:
Name Type Description
_ Object

unused

args.productIds Array.<String>

an array of Product IDs

context Object

an object containing the per-request state

Returns:

TODO: make sure this is the correct return type and this function needs to be async

Type
Promise.<Object>

reconcileCarts(context, input) → {Promise.<Object>}

Call this with account credentials, passing in an anonymous cart, and the anonymous cart will be merged into the account cart. The "mode" argument allows you to specify whether the items should be merged, or if items should be kept from just one of the carts. If this mutation does not throw an error, the anonymous cart will be destroyed by the time this function returns.

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

mutation input

Properties
Name Type Attributes Description
anonymousCartId String

The anonymous cart ID

anonymousCartToken String

The anonymous cart token

mode String <optional>

The reconciliation mode, "merge", "keepAccountCart", or "keepAnonymousCart". Default "merge"

Returns:

Object in which cart property is set to the updated account cart

Type
Promise.<Object>

registerPluginHandler(options) → {undefined}

Will be called for every plugin

Source:
Parameters:
Name Type Description
options Object

The options object that the plugin passed to registerPackage

Returns:
Type
undefined

registerPluginHandler(options) → {undefined}

Will be called for every plugin

Source:
Parameters:
Name Type Description
options Object

The options object that the plugin passed to registerPackage

Returns:
Type
undefined

registerPluginHandler(options) → {undefined}

Will be called for every plugin

Source:
Parameters:
Name Type Description
options Object

The options object that the plugin passed to registerPackage

Returns:
Type
undefined

registerPluginHandler(options) → {undefined}

Will be called for every plugin

Source:
Parameters:
Name Type Description
options Object

The options object that the plugin passed to registerPackage

Returns:
Type
undefined

removeCartItems(context, input) → {Promise.<Object>}

Removes one or more items from a cart

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input

Properties
Name Type Description
cartId String

The ID of the cart in which all of the items exist

cartItemIds Array.<String>

Array of cart item IDs to remove

token String

The token if the cart is an anonymous cart

Returns:

An object containing the updated cart in a cart property

Type
Promise.<Object>

saveDefaultSize(size) → {function}

call "shop/updateDefaultParcelSize" method

Source:
Since:
  • 1.1.12
Parameters:
Name Type Description
size Object

size object to be saved

Returns:

callback

Type
function

selectFulfillmentOptionForGroup(context, input) → {Promise.<Object>}

Selects a fulfillment option for a fulfillment group

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
cartId String

The ID of the cart to select a fulfillment option for

cartToken String <optional>

The token for the cart, required if it is an anonymous cart

fulfillmentGroupId String

The group to select a fulfillment option for

fulfillmentMethodId String

The fulfillment method ID from the option the shopper selected

Returns:

An object with a cart property containing the updated cart

Type
Promise.<Object>

(async) sendNotificationToAdmin(collections, adminUserId, shopId) → {undefined}

Sends a new order notification to an admin

Source:
Parameters:
Name Type Description
collections Object

Map of MongoDB collections

adminUserId String

User ID (not account ID)

shopId String

The ID of the shop this person is admin for

Returns:
Type
undefined

sendVerificationEmail(input) → {Job}

Send an email with a link the user can use verify their email address.

Source:
Parameters:
Name Type Description
input Object

Input options

Properties
Name Type Attributes Description
userId String

The id of the user to send email to.

email String <optional>

Optional. Address to send the email to. This address must be in the user's emails list. Defaults to the first unverified email in the list.

bodyTemplate String <optional>

Template name for rendering the email body

subjectTemplate String <optional>

Template name for rendering the email subject

Returns:
  • returns a sendEmail Job instance
Type
Job

sendWelcomeEmail(shopId, userId, token) → {Boolean}

Send an email to consumers on sign up

Source:
Parameters:
Name Type Description
shopId String

shopId of new User

userId String

new userId to welcome

token String

the token for the verification URL

Returns:

returns true on success

Type
Boolean

setAnonymousCarts(carts) → {undefined}

Sets an array of anonymous carts saved locally

Source:
Parameters:
Name Type Description
carts Array.<Object>

objects with _id and token

Returns:
Type
undefined

setBaseContext(context) → {undefined}

Sets the baseContext used by getGraphQLContextInMeteorMethod

Source:
Parameters:
Name Type Description
context Object

The context object

Returns:
Type
undefined

setEmailOnAnonymousCart(context, input) → {Promise.<Object>}

Assigns email to anonymous user's cart instance

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Description
cartId String

An anonymous cart ID

token String

The token for accessing the anonymous cart

email String

The email address to associate with this cart

Returns:

An object with cart property containing the updated cart

Type
Promise.<Object>

setShippingAddressOnCart(context, input) → {Promise.<Object>}

Sets the shippingAddress data for all fulfillment groups on a cart that have a type of "shipping"

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a cart property containing the updated cart

Type
Promise.<Object>

setupFetchFlushCurrencyHooks() → {undefined}

Schedule fetching and flushing jobs

Source:
Returns:
Type
undefined

setupStaleCartHook() → {undefined}

Adds an afterCoreInit hook for removing stale carts

Source:
Returns:
Type
undefined

shop/updateDefaultParcelSize(parcel) → {Object}

update defaultParcelSize for a shop

Source:
Since:
  • 1.1.12
Parameters:
Name Type Description
parcel Object

size to be updated

Returns:

The update call result

Type
Object

ShopLogoWithData() → {Node}

ShopLogoWithData

.

Source:

ShopLogoWithData

Returns:

React component

Type
Node

showItemLowInventoryWarning(variant) → {Boolean}

showLowInventoryWarning

.

Source:

showLowInventoryWarning

Parameters:
Name Type Description
variant Object

variant object to check inventory levels on

Returns:

return true if low inventory on variant

Type
Boolean

sitemapQuery(_, params, context) → {String}

Source:
Parameters:
Name Type Description
_ Object

unused

params Object

an object of all arguments that were sent by the client

Properties
Name Type Description
handle String

Sitemap's handle, as set in Sitemaps collection

shopUrl String

URL of the shop the sitemap belongs to. The URL is used to find the shop with the domain of the URL

context Object

an object containing the per-request state

Returns:
  • Sitemap object containing XML with placeholders replaced (BASE_URL, LAST_MOD)
Type
String

sortCartItems(cartItems, connectionArgs) → {Array.<Object>}

Sorts the provided cart items according to the connectionArgs.

Source:
Parameters:
Name Type Description
cartItems Array.<Object>

Array of cart items

connectionArgs ConnectionArgs

An object of all arguments that were sent by the client

Returns:

Sorted list of cart items

Type
Array.<Object>

sortMedia(media) → {Array.<Object>}

resort the media in

.

Source:

resort the media in

Parameters:
Name Type Description
media Array.<Object>

media to sort by priority

Returns:

sorted media

Type
Array.<Object>

sortOrderItems(orderItems, connectionArgs) → {Array.<Object>}

Sorts the provided order items according to the connectionArgs.

Source:
Parameters:
Name Type Description
orderItems Array.<Object>

Array of order items

connectionArgs ConnectionArgs

An object of all arguments that were sent by the client

Returns:

Sorted list of order items

Type
Array.<Object>

sourceCollect(connect, monitor) → {Object}

Specifies which props to inject into your component.

Source:

Specifies which props to inject into your component.

Parameters:
Name Type Description
connect Object

DnD connect

monitor Object

DnD monitor

Returns:

DnD connection source

Type
Object

splitOrderItem(context, input) → {Promise.<Object>}

Use this mutation to reduce the quantity of one item of an order and create a new item for the remaining quantity in the same fulfillment group, and with the same item status. You may want to do this if you are only able to partially fulfill the item order right now.

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input. See SimpleSchema

Returns:

Object with order property containing the created order and newItemId property set to the ID of the new item

Type
Promise.<Object>

startup(context) → {undefin}

Simple pricing startup function.

Source:
Parameters:
Name Type Description
context Object

App context.

Returns:
  • void, no return.
Type
undefin

storeAnonymousCart(cart) → {undefined}

Saves a single anonymous cart locally

Source:
Parameters:
Name Type Description
cart Object

Object with _id and token

Returns:
Type
undefined

surchargeCheck(surcharge, extendCommonOrder) → {Bool}

Filter surcharges based on surcharge restriction data

Source:
Parameters:
Name Type Description
surcharge Object

surcharge to check attributes and destination against

extendCommonOrder Object

details about the purchase a user wants to make.

Returns:

true / false as to whether method is still valid after this check

Type
Bool

(async) synchronousPromiseLoop(name, funcs, args) → {undefined}

calls each function in an array with args, one at a time

Source:
Parameters:
Name Type Description
name String

Event name

funcs Array.<function()>

List of functions to call

args Array

Arguments to pass to each function

Returns:

Promise that resolves with undefined after all functions in the list have been called

Type
undefined

TagTableSelect(props) → {Node}

Tag table select component, compatible with react table

Source:
Parameters:
Name Type Description
props Object

Props

Returns:

React component

Type
Node

transform(results) → {Array.<Object>}

filter and extract shipping methods from flat rate shipping provider

Source:
Parameters:
Name Type Description
results Array.<Object>

The find results

Returns:

The methods from the flatRates record

Type
Array.<Object>

unstoreAnonymousCart(cartId) → {undefined}

Removes a single anonymous cart from local save list

Source:
Parameters:
Name Type Description
cartId String

The cart ID

Returns:
Type
undefined

(async) updateAllCartsForVariant(Cart, context, variant) → {Promise.<null>}

Source:
Parameters:
Name Type Description
Cart Object

Cart collection

context Object

App context

variant String

The catalog product variant or option

Returns:

Promise that resolves with null

Type
Promise.<null>

updateCartAddresses(updatedAddress) → {Promise.<Array.<Boolean>>}

Update shipping or billing address for cart

Source:
Parameters:
Name Type Description
updatedAddress Object

Address

Returns:

Resolves with 0 or more results

Type
Promise.<Array.<Boolean>>

updateCartItemsQuantity(context, input) → {Promise.<Object>}

Sets a new quantity for one or more items in a cart

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input

Properties
Name Type Description
cartId String

The ID of the cart in which all of the items exist

items String

Array of items to update

Properties
Name Type Description
cartItemId Number

The cart item ID

quantity Object

The new quantity, which must be an integer of 0 or greater

token String

The token if the cart is an anonymous cart

Returns:

An object containing the updated cart in a cart property

Type
Promise.<Object>

updateCatalogProduct(userId, selector, modifier, validation) → {String}

Updates a product document.

Source:
Parameters:
Name Type Description
userId String

currently logged in user

selector Object

selector for product to update

modifier Object

Object describing what parts of the document to update.

validation Object

simple schema validation options

Returns:

_id of updated document

Type
String

updateEnabledServices(enabledServices) → {Promise.<Object>}

Source:
Parameters:
Name Type Description
enabledServices Array.<Object>

Updated enabledServices array, to store in package settings

Returns:

Method result

Type
Promise.<Object>

updateFlatRateFulfillmentMethodMutation(context, input) → {Promise.<Object>}

updates a flat rate fulfillment method

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a method property containing the updated method

Type
Promise.<Object>

updateFlatRateFulfillmentRestrictionMutation(context, input) → {Promise.<Object>}

updates a flat rate fulfillment method

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a restriction property containing the updated method

Type
Promise.<Object>

updateFulfillmentOptionsForGroup(context, input) → {Promise.<Object>}

Updates the fulfillment quotes for a fulfillment group

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

an object of all mutation arguments that were sent by the client

Properties
Name Type Attributes Description
cartId String

The ID of the cart to update fulfillment options for

cartToken String <optional>

The token for the cart, required if it is an anonymous cart

fulfillmentGroupId String

The group to update fulfillment options for

Returns:

An object with a cart property containing the updated cart

Type
Promise.<Object>

updateNavigationItem(context, _id, navigationItem) → {Promise.<Object>}

Updates a navigation item

Source:
Parameters:
Name Type Description
context Object

An object containing the per-request state

_id String

_id of navigation item to update

navigationItem Object

Updated navigation item

Returns:

Updated navigation item

Type
Promise.<Object>

updateNavigationTree(context, _id, navigationTree) → {Promise.<Object>}

Updates a navigation tree

Source:
Parameters:
Name Type Description
context Object

An object containing the per-request state

_id String

_id of navigation tree to update

navigationTree Object

Updated navigation tree

Returns:

Updated navigation tree

Type
Promise.<Object>

updateOrder(context, input) → {Promise.<Object>}

Use this mutation to update order status, email, and other properties

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input. See SimpleSchema

Returns:

Object with order property containing the updated order

Type
Promise.<Object>

updateOrderFulfillmentGroup(context, input) → {Promise.<Object>}

Use this mutation to update an order fulfillment group status and tracking information

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input. See SimpleSchema

Returns:

Object with order property containing the updated order

Type
Promise.<Object>

updateParentVariantsInventoryAvailableToSellQuantity(item, collections) → {Promise.<number>}

Get the number of product variants that are currently reserved in an order. This function can take any variant object.

Source:
Parameters:
Name Type Description
item Object

A product item object, either from the cart or the products catalog

collections Object

Raw mongo collections.

Returns:

Reserved variant quantity.

Type
Promise.<number>

updateParentVariantsInventoryAvailableToSellQuantity(item, collections) → {Promise.<number>}

Get the number of product variants that are currently reserved in an order. This function can take any variant object.

Source:
Parameters:
Name Type Description
item Object

A product item object, either from the cart or the products catalog

collections Object

Raw mongo collections.

Returns:

Reserved variant quantity.

Type
Promise.<number>

updateParentVariantsInventoryInStockQuantity(item, collections) → {Promise.<number>}

Get the number of product variants that are currently in stock. This function can take any variant object.

Source:
Parameters:
Name Type Description
item Object

A product item object, either from the cart or the products catalog

collections Object

Raw mongo collections.

Returns:

Reserved variant quantity.

Type
Promise.<number>

updatePluginSettings(newSettings) → {Promise.<Object>}

Updates settings for this plugin for the current shop

Source:
Parameters:
Name Type Description
newSettings Object

The updated settings object

Returns:

Result

Type
Promise.<Object>

updateSurchargeMutation(context, input) → {Promise.<Object>}

updates a surcharge

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input (see SimpleSchema)

Returns:

An object with a surcharge property containing the updated surcharge

Type
Promise.<Object>

VariantDetail(props) → {Node}

VariantDetail component

.

Source:

VariantDetail component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

variantIsInActionView(variantId)

Source:
Parameters:
Name Type Description
variantId *

variantIsSelected(variantId)

Source:
Parameters:
Name Type Description
variantId *

VariantTable(props) → {Node}

Product list

.

Source:

Product list

Parameters:
Name Type Description
props Object

Component props

Returns:

Component representing a list of products, variants, or options

Type
Node

xformCartCheckout(collections, cart) → {Object}

Source:
Parameters:
Name Type Description
collections Object

Map of Mongo collections

cart Object

Cart document

Returns:

Checkout object

Type
Object

xformCartFulfillmentGroup(fulfillmentGroup, cart) → {Object}

Transform a single fulfillment group

Source:
Parameters:
Name Type Description
fulfillmentGroup Object

Fulfillment group

cart Object

Full cart document, with items already transformed

Returns:

Transformed group

Type
Object

(async) xformCartItem(context, catalogItems, products, cartItem) → {Object}

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

catalogItems Array.<Object>

Array of CatalogItem docs from the db

products Array.<Object>

Array of Product docs from the db

cartItem Object

CartItem

Returns:

Same object with GraphQL-only props added

Type
Object

xformCartItems(context, items) → {Array.<Object>}

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

items Array.<Object>

Array of CartItem

Returns:

Same array with GraphQL-only props added

Type
Array.<Object>

xformOrderFulfillmentGroupSelectedOption(fulfillmentOption) → {Object}

Transform a single fulfillment group fulfillment option

Source:
Parameters:
Name Type Description
fulfillmentOption Object

The group.shipmentMethod

Returns:

Transformed fulfillment option

Type
Object

(async) xformOrderItem(context, item, catalogItems, products) → {Object}

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

item Object

The order fulfillment group item in DB format

catalogItems Array.<Object>

Array of CatalogItem docs from the db

products Array.<Object>

Array of Product docs from the db

Returns:

Same object with GraphQL-only props added

Type
Object

xformOrderItems(context, items) → {Array.<Object>}

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

items Array.<Object>

Array of order fulfillment group items

Returns:

Same array with GraphQL-only props added

Type
Array.<Object>

xformOrderPayment(payment) → {Object}

Transform a single order payment

Source:
Parameters:
Name Type Description
payment Object

A payment object

Returns:

Transformed payment

Type
Object

xformProduct(data) → {Object}

The core function for transforming a Product to a CatalogProduct

Source:
Parameters:
Name Type Description
data Object

Data obj

Properties
Name Type Description
collections Object

Map of MongoDB collections by name

product Object

The source product

shop Object

The Shop document for the shop that owns the product

variants Array.<Object>

The Product documents for all variants of this product

Returns:

The CatalogProduct document

Type
Object

xformTotalItemQuantity(collections, items) → {Number}

Source:
Parameters:
Name Type Description
collections Object

Map of Mongo collections

items Object

Cart items

Returns:

Total quantity of all items in the cart

Type
Number

Type Definitions

MongoCollection

Meteor Mongo.Collection instance

.

Source:

Meteor Mongo.Collection instance

Type:
  • Object

optionHash

Source:
Properties:
Name Type Description
name String

name of a package.

provides String

purpose of this package as identified to the registry

container String

filter registry entries for matching container.

shopId String

filter to only display results matching shopId, not returned

template String

filter registry entries for matching template

Type:
  • Object