Global

Members

accounts/sendResetAccountPasswordEmail

Checks to see if a user exists for a given email, and sends a password password if user exists

Source:

ActionViewContainer

Source:

Button

Source:

(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

composer

Builds productMediaById object and passes to child component

Source:

CompositeComponent

Source:

CompositeComponent

Source:

CompositeComponent

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:

createDefaultNavigationTreeForShop

Creates a default navigation tree for a shop

Source:

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

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.

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.

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.

DangerChip

Source:

decodeNavigationTreeItemIds

Recursively decodes opaque _ids for items in a navigation tree

Source:

(constant) depth0

Default Theme Shadows

.

Source:

Default Theme Shadows

ensureRoles

Ensure a list of roles exist in the roles collection

Source:

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>

filterNavigationTreeItems

Recursively navigation and filters out navigation items based on options provided

Source:

findCatalogProductsAndVariants

Returns products in the Catalog collection that correspond to multiple variants. This is the same as the findProductAndVariant query, but this is more efficient when you need to look up multiple variants at the same time.

Source:

findCurrency

Return user currency

Source:

formatPhoneNumber

prepends country code to phone no. if required

Source:

generateSitemaps

Generates & stores sitemap documents for one or more shops

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:

getSitemapRouteHandler

Returns a route handler/middleware for generated sitemap XML files

Source:

getSitemapXML

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

Source:

getStripeApi

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

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:

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

Mutation/recalculateReservedSimpleInventory

Force recalculation of the system-managed inventoryReserved field based on current order statuses.

Source:

Mutation/sendResetAccountPasswordEmail

resolver for the sendResetAccountPasswordEmail GraphQL mutation

Source:

Mutation/updateSimpleInventory

Updates SimpleInventory data for a product configuration. Pass only those arguments you want to update.

Source:

Order

Source:

OrderAppBar

Source:

OrderCardFulfillmentGroupStatusButton

Source:

OrderCardSummary

Source:

OrderContainer

Source:

OrderContainer

Source:

OrderCustomerDetails

Source:

OrderDateCell

Source:

OrderHeader

Source:

OrderIdCell

Source:

OrderPayment

Source:

OrderPayments

Source:

OrderPreviousRefunds

Source:

OrderPrint

Source:

OrderRefunds

Source:

OrdersTable

Source:

OrderStatusChip

Source:

PackageListContainer

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

Query/simpleInventory

Gets SimpleInventory data for a product configuration

Source:

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:

sendOrderEmail

A mutation that compiles and server-side renders the email template with order data, and sends the email

Source:

sendSMTPEmail

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

Source:

setDefaultsForNavigationTreeItems

Recursively sets any optional values in the navigation tree with sane defaults

Source:

setDefaultsForNavigationTreeItems

Recursively sets any optional values in the navigation tree with sane defaults

Source:

shutdown

Called on shutdown

Source:

simpleInventory

Gets SimpleInventory data for a product configuration

Source:

(constant) standardBorderRadius

Default Theme

.

Source:

Default Theme

startup

Called on startup. Initializes SMTP email handler.

Source:

startup

Called on startup

Source:

startup

Called on startup

Source:

tagsByIds

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

Source:

ToolbarContainer

Source:

verifySMTPEmailSettings

Verify the current email configuration

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

addAnonymousOrderToken(context, orderId) → {String}

Create a new anonymous access token and add it to an order

.

Source:

Create a new anonymous access token and add it to an order

Parameters:
Name Type Description
context Object

app context

orderId String

order id

Returns:

raw token secret

Type
String

addAnonymousOrderToken(context, orderId) → {String}

Create a new anonymous access token and add it to an order

.

Source:

Create a new anonymous access token and add it to an order

Parameters:
Name Type Description
context Object

app context

orderId String

order id

Returns:

raw token secret

Type
String

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>

addGlobalSettingDefaults(settings) → {Object}

Source:
Parameters:
Name Type Description
settings Object

The settings object

Returns:

Settings object with default values added

Type
Object

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

addShopSettingDefaults(settings) → {Object}

Source:
Parameters:
Name Type Description
settings Object

The settings object

Returns:

Settings object with default values added

Type
Object

addTagsToProducts(context, input) → {Object}

Adds an array of tag ids to an array of products looked up by product id.

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input arguments for the bulk operation

Properties
Name Type Description
productIds Array.<String>

an array of Product IDs

tagIds Array.<String>

an array of Tag IDs

Returns:

Object with information of results of bulk the operation

Type
Object

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

Takes an array of productsIds and tagsIds and performs a bulk operation to add an array of tag ids to an array of products

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

The input arguments

Properties
Name Type Description
input Object

mutation input object

Properties
Name Type Description
clientMutationId String

The mutation id

productIds Array.<String>

an array of Product IDs

tagIds Array.<String>

an array of Tag IDs

context Object

an object containing the per-request state

Returns:

Returns an object with information about the results of the bulk operation

Type
Promise.<Object>

addTranslationRoutes(expressApp) → {undefined}

Adds i18next translation routes to an Express app

Source:
Parameters:
Name Type Description
expressApp Object

Express app instance

Returns:
Type
undefined

addWorker(options) → {Promise.<Job>}

Add a worker for a background job type

Source:
Parameters:
Name Type Description
options Object

Worker options

Properties
Name Type Attributes Description
pollInterval Number <optional>

How frequently to poll for work. Default 5 minutes.

type String

The job type to work.

worker function

The worker function. This is passed a single argument, the job instance. You must call job.done() when done or call job.fail(msg) if there is an error.

workTimeout Number <optional>

Milliseconds after which to fail the job if job.done has not yet been called. Default 1 minute.

Returns:

A promise that resolves with the worker instance

Type
Promise.<Job>

alertConfirmChangeOwner() → {Object}

Show confirmation alert to verify the user wants to change the shop owner

Source:
Returns:

Object with value prop that is truthy if they want to continue

Type
Object

alertConfirmRemoveUser() → {Object}

Show confirmation alert to verify the user wants to remove the user from the group

Source:
Returns:

Object with value prop that is truthy if they want to continue

Type
Object

applyCustomPublisherTransforms(context, catalogProduct, optionsopt) → {undefined}

Applies all catalog product transformations registered by other plugins.

Source:
Parameters:
Name Type Attributes Description
context Object

App context

catalogProduct Object

A CatalogProduct entity, which this function may mutate.

options Object <optional>

Options

Properties
Name Type Attributes Description
startFrom String <optional>

Not yet implemented, but a custom plugin that overrides this function may choose to use this to start from a certain step in the transformation pipeline.

Returns:
Type
undefined

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

Applies a discount code to a cart

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 Object

Cart to add discount to

discountCode Object

Discount code to add to cart

shopId String

Shop cart belongs to

token String <optional>

Cart token, if anonymous

Returns:

An object with the updated cart with the applied discount

Type
Promise.<Object>

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

Attempt to approve one or more authorized payments for an order

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

ApproveOrderPaymentsInput

Properties
Name Type Description
orderId String

The order ID

paymentIds Array.<String>

An array of one or more payment IDs to approve

shopId String

The ID of the shop that owns this order

Returns:

ApproveOrderPaymentsResult

Type
Promise.<Object>

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

Source:
Parameters:
Name Type Description
optionHash optionHash

Option hash

Returns:

returns an array of filtered, structure reactionApps

Type
Array.<Object>

archiveProducts(_, args, context) → {Array}

Takes an array of product IDs and archives products

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

The input arguments

Properties
Name Type Description
input Object

mutation input object

Properties
Name Type Description
productIds String

an array of decoded product IDs to archive

shopId String

shop these products belong to

context Object

an object containing the per-request state

Returns:

array with archived products

Type
Array

archiveProducts(context, input) → {Array}

archives a product

Source:

the method archives products, but will also archive child variants and options

Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input arguments for the bulk operation

Properties
Name Type Description
productIds String

an array of decoded product IDs to archive

shopId String

shop these products belong to

Returns:

array with archived products

Type
Array

archiveProductVariants(_, args, context) → {Array}

Takes an array of variant IDs and archives variants

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

The input arguments

Properties
Name Type Description
input Object

mutation input object

Properties
Name Type Description
shopId String

shop these variants belong to

variantIds String

an array of variant IDs to archive

context Object

an object containing the per-request state

Returns:

array with archived variants

Type
Array

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

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

cancelJobs(filter) → {Promise.<undefined>}

Cancel one or more repeating jobs that match a filter and are not yet completed, canceled, or failed.

Source:
Parameters:
Name Type Description
filter Object

Object with type and optionally data to filter which jobs should be canceled.

Returns:

Nothing

Type
Promise.<undefined>

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>

capitalize(str) → {String}

Source:
Parameters:
Name Type Description
str String

string to capitalize

Returns:

capitalized string

Type
String

capitalize(str) → {String}

Source:
Parameters:
Name Type Description
str String

string to capitalize

Returns:

capitalized string

Type
String

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>

check() → {Boolean}

Mock Meteor.check function for the Node app

Source:
Returns:

true

Type
Boolean

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

Takes an array of product IDs and clones products

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

The input arguments

Properties
Name Type Description
input Object

mutation input object

Properties
Name Type Description
clientMutationId String

The mutation id

productIds Array.<String>

an array of product IDs to clone

context Object

an object containing the per-request state

Returns:

cloneProducts payload

Type
Promise.<Object>

cloneProducts(context, input) → {Array}

clones a product into a new product

Source:

the method copies products, but will also create and clone child variants and options

Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input arguments for the bulk operation

Properties
Name Type Description
productIds String

an array of decoded product IDs to clone

shopId String

shop these products belong to

Returns:

list with cloned product Ids

Type
Array

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

Takes an array of product variant IDs and clones variants

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

The input arguments

Properties
Name Type Description
input Object

mutation input object

Properties
Name Type Description
clientMutationId String

The mutation id

variantIds Array.<String>

an array of variant IDs to clone

context Object

an object containing the per-request state

Returns:

cloneProductVariants payload

Type
Promise.<Object>

cloneProductVariants(context, input) → {Array}

clones a product variant into a new variant

Source:

the method copies variants, but will also create and clone child variants (options)

Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input arguments for the bulk operation

Properties
Name Type Description
shopId String

shop these variants belong to

variantIds String

an array of decoded variant IDs to clone

Returns:

list with cloned variant Ids

Type
Array

collectDropTarget(connect) → {undefined}

collectDropTarget

.

Source:

collectDropTarget

Parameters:
Name Type Description
connect Object

connect object

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}

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 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}

Source:
Parameters:
Name Type Description
props Object

Props from parent

onData function

Callback

Returns:
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}

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

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

(async) connect(parsedUrl) → {Promise}

Connect to mongodb

.

Source:

Connect to mongodb

Parameters:
Name Type Description
parsedUrl Object

URL to mongodb server and database name, parsed

Returns:

a promise resolving to the mongodb db instance

Type
Promise

connectionData() → {Object}

Source:
Returns:

connection data store or in memory cache

Type
Object

(async) connectToMongo(options) → {Promise.<undefined>}

Given a MongoDB URL, creates a connection to it, sets this.mongoClient, calls this.setMongoDatabase with the database instance, and then resolves the Promise.

Source:
Parameters:
Name Type Description
options Object

Options object

Properties
Name Type Description
mongoUrl String

MongoDB connection URL

Returns:

Nothing

Type
Promise.<undefined>

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>

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, context, 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

context Object

The application context

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>

createProduct(context, props, info) → {Object}

creates a product

.

Source:

creates a product

Parameters:
Name Type Description
context Object

an object containing the per-request state

props Object

initial product properties

info Object

Other info

Returns:

product - new product

Type
Object

createProduct(context, input) → {String}

creates an empty product, with an empty variant

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input arguments for the operation

Properties
Name Type Description
shopId String

the shop to create the product for

Returns:

created productId

Type
String

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

initializes empty product template, with empty variant

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

The input arguments

Properties
Name Type Description
input Object

mutation input object

Properties
Name Type Description
clientMutationId String

The mutation id

shopId String

shopId of shop to create product for

context Object

an object containing the per-request state

Returns:

createProduct payload

Type
Promise.<Object>

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

initializes empty variant template

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

The input arguments

Properties
Name Type Description
input Object

mutation input object

Properties
Name Type Description
clientMutationId String

The mutation id

productId Array.<String>

the product or variant ID which we create new variant on

shopId Array.<String>

the shop to create the variant for

context Object

an object containing the per-request state

Returns:

createProductVariant payload

Type
Promise.<Object>

createProductVariant(context, input) → {String}

creates an empty variant on the product supplied

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input arguments for the bulk operation

Properties
Name Type Description
productId String

the product or variant ID which we create new variant on

shopId String

the shop to create the variant for

Returns:

created variantId

Type
String

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

Use this mutation to create a refund on an order payment

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Necessary input. See SimpleSchema

Properties
Name Type Description
amount Object

amount to refund

orderId Object

order ID of order where payment was applied

paymentId Object

ID of payment to refund

reason Object

reason for refund

Returns:

Object with order property containing the updated order

Type
Promise.<Object>

createSaveImageJob(context, doc, collectionName, isRemote) → {undefined}

Creates a new Job to convert an image

Source:
Parameters:
Name Type Description
context Object

App context

doc Object

The inserted doc containing the relevant data.

collectionName String

The reference to the FileCollection that document was inserted in.

isRemote Boolean

The reference to the FileCollection that document was inserted in.

Returns:
Type
undefined

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>

decodeOpaqueIdForNamespace(namespace, opaqueId) → {String}

Transforms an opaque ID to an internal ID, throwing an error if the namespace is wrong

Source:
Parameters:
Name Type Description
namespace String

The namespace that you expect the decoded ID to have

opaqueId String

The ID to transform

Returns:

An internal ID

Type
String

(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>

DetailDrawer(props) → {React.Component}

Detail drawer used for displaying supplementary info and actions for a view.

Source:

Detail drawer used for displaying supplementary info and actions for a view.

Parameters:
Name Type Description
props Object

Component props

Returns:

Sidebar component

Type
React.Component

DetailDrawerButton(props) → {React.Component}

Detail drawer open button

.

Source:

Detail drawer open button

Parameters:
Name Type Description
props Object

Component props

Returns:

Sidebar component

Type
React.Component

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

disableReactionPackage(reactionPackage) → {undefined}

disables a reaction package

.

Source:

disables a reaction package

Parameters:
Name Type Description
reactionPackage Object

package to disable

Returns:
Type
undefined

displayName(displayUseropt) → {String}

Returns the display name for a user

Source:
Parameters:
Name Type Attributes Description
displayUser Object <optional>

The user object. Defaults to logged in user.

Returns:

Display name for a user

Type
String

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>>

enableReactionPackage(reactionPackage) → {String|null}

enables a reaction package

.

Source:

enables a reaction package

Parameters:
Name Type Description
reactionPackage Object

package to enable

Returns:

alert or redirect to a package

Type
String | null

executeBulkOperation(collection, operations, totalProducts) → {Object}

Executes an array of operations in bulk

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

Mongo collection

operations Array.<Object>

bulk operations to perform

totalProducts Int

total number of products to operate on

Returns:

Object with information of results of bulk the operations

Type
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

extendInventorySchemas(schemas) → {undefined}

Extend SimpleSchemas with inventory fields

Source:
Parameters:
Name Type Description
schemas Object

Simple schemas

Returns:
Type
undefined

extendOrdersSchemas(schemas) → {undefined}

Extend schemas from other plugins

Source:
Parameters:
Name Type Description
schemas Object

Schema map from context

Returns:
Type
undefined

extendSimplePricingSchemas(schemas) → {undefined}

Extend SimpleSchemas from other plugins

Source:
Parameters:
Name Type Description
schemas Object

SimpleSchema map from context

Returns:
Type
undefined

extendTaxesSchemas(schemas) → {undefined}

Extend schemas before startup

Source:
Parameters:
Name Type Description
schemas Object

SimpleSchema map

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

fromArray(order) → {Object}

Source:
Parameters:
Name Type Description
order Object

The order document to transform

Returns:

The converted order document

Type
Object

gc(address, options, callback) → {undefined}

Source:
Parameters:
Name Type Description
address String

ip address

options Object

options to pass

callback function

callback

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>

getAdminShortcutIcons() → {Object}

get shortcuts with audience permissions based on user roles

Source:
Returns:

Object with provides, enabled, and audience fields

Type
Object

getAllComponents() → {Array.<Component>}

Source:
Returns:

all components

Type
Array.<Component>

getAllOrderItems(order) → {Array.<Object>}

Get all order items

Source:
Parameters:
Name Type Description
order Object

The order

Returns:

Order items from all fulfillment groups in a single array

Type
Array.<Object>

getAnonymousAccessToken() → {Object|Date|String|String}

Generate a new secret token for the purpose of controlled access to anonymous-user-specific data.

Source:

Generate a new secret token for the purpose of controlled access to anonymous-user-specific data.

Returns:
  • token object with associated token properties

    Type
    Object
  • token.createdAt creation date, could potentially be useful for implementing expiration, but these do not currently expire.

    Type
    Date
  • token.hashedToken used to locate this token in the database

    Type
    String
  • token.token raw token for use in URLs, email, etc. Do not store in the DB.

    Type
    String

getBaseContext() → {Object}

Gets the baseContext used by getGraphQLContextInMeteorMethod

Source:
Returns:

The context object

Type
Object

getCatalogProduct() → {Object}

Returns a mock catalogProduct for these tests

Source:
Returns:

CatalogProduct

Type
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>>

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>>

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>>

getComponent(name) → {Component}

Source:
Parameters:
Name Type Description
name String

name of component to get

Returns:

component to get

Type
Component

getConfigFromMailUrl(logger, mailUrl) → {Object}

get email sending config for Nodemailer based on parsing a mail URL

Source:
Parameters:
Name Type Description
logger Boolean

Whether to log debug messages

mailUrl String

The mail URL

Returns:

A mail config object

Type
Object

getCurrencyDefinitionByCode(code) → {Object}

Get the currency definition for a currency code

Source:
Parameters:
Name Type Description
code String

The code that must match the currency.code

Returns:

A Currency object

Type
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

getCustomServiceConfig(host, logger, passwordopt, port, useropt) → {Object}

get email sending config for Nodemailer based on custom host and port

Source:
Parameters:
Name Type Attributes Description
host String

The mail server host

logger Boolean

Whether to log debug messages

password String <optional>

The service password

port Number

The port number

user String <optional>

The service user

Returns:

A mail config object

Type
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

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

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() → {String}

get "edit/focus" value from current Reaction state

Source:
Since:
  • 1.1.12
Returns:

focus value

Type
String

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

getHasPermissionFunctionForUser(context) → {function}

Get a hasPermission function bound to the current user context

Source:
Parameters:
Name Type Description
context Object

App context

Returns:

hasPermission function for context.user

Type
function

getHasPermissionFunctionForUser(context) → {function}

Get a shopsUserHasPermissionFor function bound to the current user context

Source:
Parameters:
Name Type Description
context Object

App context

Returns:

shopsUserHasPermissionFor function for context.user

Type
function

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

getJob(id) → {Promise.<undefined>}

Get a single job instance.

Source:
Parameters:
Name Type Description
id String

Job ID

Returns:

Nothing

Type
Promise.<undefined>

(async) getLanguageForOrder(context, order) → {String}

Returns language to be used for order emails. If cart is account based and has set language then returns that language, else order language.

Source:
Parameters:
Name Type Description
context Object

App context

order Object

The order document

Returns:

i18n language code

Type
String

getPermissionMap(permissions) → {Array}

Source:
Parameters:
Name Type Description
permissions Array

permissions

Returns:

permissions mapped by label

Type
Array

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>

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>

getPricingObject(doc, priceInfo) → {Object}

Get the pricing object

Source:
Parameters:
Name Type Description
doc Object

The Products collection document

priceInfo Object

A price range object, with range, min, and max fields

Returns:

Object for pricing field for product, variant, or option

Type
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>

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>

getProductPriceRange(productId, variants) → {Object}

Get the PriceRange object for a Product by ID

Source:
Parameters:
Name Type Description
productId String

A product ID

variants Array.<Object>

A list of documents from a Products.find call

Returns:

Product PriceRange object

Type
Object

getReactComponentOrBlazeTemplate(name) → {Node}

Source:
Parameters:
Name Type Description
name name

name of component

Returns:

React component or Blaze template

Type
Node

getReservedQuantity(context, productConfiguration) → {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
context Object

App context

productConfiguration Object

Product configuration

Returns:

Reserved variant quantity

Type
Promise.<Number>

Get absolute URL for shop logo, if available. If not, use default logo URL.

Source:
Parameters:
Name Type Description
context Object

App context

shop Object

The shop document

Returns:

Absolute image URL

Type
String

getStandardServiceConfig(logger, passwordopt, service, useropt) → {Object}

get email sending config for Nodemailer based on well-known service name https://github.com/nodemailer/nodemailer-wellknown

Source:
Parameters:
Name Type Attributes Description
logger Boolean

Whether to log debug messages

password String <optional>

The service password

service String

The service name

user String <optional>

The service user

Returns:

A mail config object

Type
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>

getTags(apolloClient, query) → {Array}

Queries for tags the match the provided user query

Source:
Parameters:
Name Type Description
apolloClient Object

The apolloClient

query String

Query provided by the user

Returns:

An array of options formatted for use with react-select

Type
Array

(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>>

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>>

getTopVariants() → {Array.<Object>}

Get top level variants

.

Source:

Get top level variants

Returns:

Array of variant objects

Type
Array.<Object>

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>

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>

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, variants) → {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.

variants Array.<Object>

A list of documents from a Products.find call

Returns:

Product PriceRange object

Type
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>>

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

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

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

productOrVariantId String

A Product or top level Product Variant ID.

topOnly Boolean

True to return only a products top level variants.

Returns:

Array of Product Variant objects.

Type
Promise.<Array.<Object>>

gi(address, callback) → {undefined}

Source:
Parameters:
Name Type Description
address String

ip address

callback function

callback

Returns:
Type
undefined

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

handleActionViewBack() → {undefined}

function to handle back button on action view

.

Source:

function to handle back button on action view

Returns:
Type
undefined

handleActionViewClose() → {undefined}

function to handle close button on action view

.

Source:

function to handle close button on action view

Returns:
Type
undefined

handleActionViewDetailBack() → {undefined}

function to handle back button on action view detail

.

Source:

function to handle back button on action view detail

Returns:
Type
undefined

handleActionViewDetailClose() → {undefined}

function to handle close button on action view detail

.

Source:

function to handle close button on action view detail

Returns:
Type
undefined

handleChange(event, value) → {undefined}

Selection change handler

Source:
Parameters:
Name Type Description
event Event

Event

value String

New selected value

Returns:
Type
undefined

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>

Hint(props) → {Node}

Source:
See:
  • link Modification of https://github.com/ethanselzer/react-image-magnify/blob/master/src/hint/DefaultHint.js
Parameters:
Name Type Description
props Object

props to pass

Returns:

react node of Hint component

Type
Node

(async) initializeI18n(fallbackLng) → {undefined}

Async function to initialize i18next after we have a fallback (shop) language.

Source:
Parameters:
Name Type Description
fallbackLng String

Language code to use if i18nextBrowserLanguageDetector fails

Returns:
Type
undefined

initServer() → {undefined}

Creates the Apollo server and the Express app

Source:
Returns:
Type
undefined

InventorySettings(props) → {Node}

Inventory settings form block component

.

Source:

Inventory settings form block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

isAncestorDeleted(context, product, includeSelf) → {Boolean}

Verify there are no deleted ancestors Variants cannot be created / restored if their parent product / variant is deleted

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

product Object

the product object to check for ancestors

includeSelf Boolean

include supplied product

Returns:

true or false

Type
Boolean

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

isLanguageEnabled(languages, language) → {Boolean}

Checks whether language is in languages and is enabled

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

shop languages

Properties
Name Type Description
enabled Boolean

true if enabled false if disabled

i18n String

code of language

language String

i18n code of language

Returns:
  • true if language is enabled exists in languages array
Type
Boolean

isValidObjectId(id) → {boolean}

Checks if a value is a valid bson ObjectId

Source:
Parameters:
Name Type Description
id Any

ID to check

Returns:

return true if the value is a valid bson ObjectId, return false otherwise.

Type
boolean

loadTranslations(translations) → {undefined}

Load an array of translation arrays

Source:
Deprecated:
  • Use new method of passing `i18n.translations` array to `registerPlugin`
Parameters:
Name Type Description
translations Array.<Array.<Object>>

Array of arrays of i18next translation objects

Returns:
Type
undefined

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

marketplaceUpdateShopWorkflow(shopId, workflowStatus) → {undefined}

Source:
Parameters:
Name Type Description
shopId String

shopId

workflowStatus String

workflow Status

Returns:
Type
undefined

(async) markNotificationRead(id) → {undefined}

Update a notification's status to "read"

Source:
Parameters:
Name Type Description
id String

The notification ID

Returns:
Type
undefined

MediaUploader(props) → {Node}

MediaUploader

.

Source:

MediaUploader

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

mergeResource(translation) → {undefined}

Call this to add translation objects. Mutates resources and namespaces.

Source:
Parameters:
Name Type Description
translation Object

Object with i18n, ns, and translation keys

Returns:
Type
undefined

methodAlertCallback(erroropt) → {undefined}

Use this as a Meteor.call callback to show a toast alert with the error reason/message.

Source:
Parameters:
Name Type Attributes Description
error Error | null <optional>

Error

Returns:
Type
undefined

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>

Mutation/verifySMTPEmailSettings(_, context) → {Promise.<Object>}

resolver for the verifySMTPEmailSettings GraphQL mutation

Source:
Parameters:
Name Type Attributes Description
_ Object

unused

args.input Object

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

input.host String <optional>

The host of the SMTP email service. Automatically provided if service !== custom.

input.password String

password of SMTP email service account.

input.port String <optional>

The port of the SMTP email service. Automatically provided if service !== custom.

input.service String

SMTP email service to use.

input.shopId String

ShopID this setting belongs to.

input.user String

username of SMTP email service account.

args.input.clientMutationId String <optional>

An optional string identifying the mutation call

context Object

an object containing the per-request state

Returns:

verifySMTPEmailSettingsPayload

Type
Promise.<Object>

Notifications(props) → {React.Component}

Notifications component

.

Source:

Notifications component

Parameters:
Name Type Description
props Object

Component props

Returns:

A React component

Type
React.Component

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

OperatorLanding(props) → {Node}

OperatorLanding

.

Source:

OperatorLanding

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

OptionTable(props) → {Node}

Variant Option table block component

.

Source:

Variant Option table block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

packageData() → {Object}

get Stripe Package record

Source:
Returns:

Package data

Type
Object

packageData() → {Object}

get Stripe Package record

Source:
Returns:

Package data

Type
Object

parentTemplateName() → {String}

Gets the name of the template inside of which this instance of {{> React ...}} is being used.

Source:

Gets the name of the template inside of which this instance of {{> React ...}} is being used. Used to print more explicit error messages

Returns:

name of template

Type
String

pkgPermissions(pkg) → {Boolean}

checks to see if user has permissions to enable / disable package

.

Source:

checks to see if user has permissions to enable / disable package

Parameters:
Name Type Description
pkg Object

package to disable

Returns:

does the user have permission to enable / disable this package

Type
Boolean

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>

PluginVersions(props) → {Node}

PluginVersions

.

Source:

PluginVersions

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

preStartup(context) → {undefined}

Simple pricing preStartup function.

Source:
Parameters:
Name Type Description
context Object

App context.

Returns:
  • void, no return.
Type
undefined

PrimaryAppBar(props) → {React.Component}

An AppBar for the main content area that provides a place for a title, actions to the right, and a menu button for opening and closing the sidebar drawer menu

.

Source:

An AppBar for the main content area that provides a place for a title, actions to the right, and a menu button for opening and closing the sidebar drawer menu

Parameters:
Name Type Description
props Object

Component props

Returns:

A react component

Type
React.Component

ProductDetail(props) → {Node}

ProductDetail layout component

.

Source:

ProductDetail layout 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

ProductHeader(props) → {Node}

Product header block component

.

Source:

Product header block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

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

ProductMediaForm(props) → {React.Component}

Product media form block component

.

Source:

Product media form block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
React.Component

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

ProductMetadataForm(props) → {Node}

Product metadata form block component

.

Source:

Product metadata form block component

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

ProductTagForm(props) → {React.Component}

Tag form block component

.

Source:

Tag form block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
React.Component

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(_, args, context) → {Promise.<Object>}

Publish Products to the Catalog collection by Product ID

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

an object of all arguments that were sent by the previous resolver

Properties
Name Type Description
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>

reactionLogger(opts) → {undefined}

Source:
Parameters:
Name Type Description
opts Object

Logger options

Returns:
Type
undefined

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>

registerComponent(componentInfo) → {undefined}

Source:
Parameters:
Name Type Description
componentInfo Object

name and component to register

Returns:
Type
undefined

registerMethod(root, method, fn) → {undefined}

Registers a method. This isn't an elegant way to do this, but it simulates the Meteor.methods that were used in the previous version of this package, did not require a larger rewrite, and works fine.

Source:
Parameters:
Name Type Description
root String

Name of collection

method String

Name of method

fn function

Function to run when this method is called

Returns:
Type
undefined

(async) registerPlugin(plugin) → {Promise.<undefined>}

Plugins should call this to register everything they provide. This is a non-Meteor replacement for the old Reaction.registerPackage.

Source:
Parameters:
Name Type Description
plugin Object

Plugin configuration object

Returns:

Nothing

Type
Promise.<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

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() → {undefined}

Reads and merges appSettingsConfig from all plugin registration.

Source:
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

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>

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

Applies a discount code to a cart

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 Object

Cart to remove discount from

discountId Object

Discount code to remove from cart

shopId String

Shop cart belongs to

token String <optional>

Cart token, if anonymous

Returns:

An object with the updated cart with the removed discount

Type
Promise.<Object>

removePermissions(current, old) → {Array}

helper to remove all array items in "old" from "current"

.

Source:

helper to remove all array items in "old" from "current"

Parameters:
Name Type Description
current Array

current array items

old Array

older array items

Returns:

updated permissions array

Type
Array

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

Takes an array of productsIds and tagsIds and removes provided tags from the array of products.

Source:
Parameters:
Name Type Description
_ Object

unused

args Object

The input arguments

Properties
Name Type Description
input Object

mutation input object

Properties
Name Type Description
clientMutationId String

The mutation id

productIds Array.<String>

an array of Product IDs

tagIds Array.<String>

an array of Tag IDs

context Object

an object containing the per-request state

Returns:

Returns an object with information about the results of the bulk operation

Type
Promise.<Object>

removeTagsFromProducts(context, input) → {Object}

Removes an array of tag ids to an array of products looked up by product id.

Source:
Parameters:
Name Type Description
context Object

an object containing the per-request state

input Object

Input arguments for the bulk operation

Properties
Name Type Description
productIds Array.<String>

an array of Product IDs

tagIds Array.<String>

an array of Tag IDs

Returns:

Object with information of results of bulk the operation

Type
Object

resolvePermissions(permission) → {Array}

helper to resolve toggled permissions

.

Source:

helper to resolve toggled permissions

Parameters:
Name Type Description
permission Object

permission to check

Returns:

list of all parent and child permissions when a parent permission is toggled

Type
Array

rolesThatCanEditGlobalSetting(field) → {Array.<String>}

Source:
Parameters:
Name Type Description
field String

The setting field name

Returns:

List of roles that can edit this setting.

Type
Array.<String>

rolesThatCanEditShopSetting(field) → {Array.<String>}

Source:
Parameters:
Name Type Description
field String

The setting field name

Returns:

List of roles that can edit this setting.

Type
Array.<String>

runAfterUpdateHooks(context, updates, shopIdopt) → {undefined}

Run all afterUpdate hooks that were registered for each updated setting

Source:
Parameters:
Name Type Attributes Description
context Object

App context

updates Object

Object with setting name as key and new setting value as value

shopId String <optional>

Shop ID. Pass null for global settings.

Returns:
Type
undefined

(async) runServiceStartup() → {Promise.<undefined>}

Calls all registerPluginHandler type functions from all registered plugins, and then calls all startup type functions in series, in the order in which they were registered.

Source:
Returns:

Nothing

Type
Promise.<undefined>

rv(lat, lng, options, callback) → {undefined}

Source:
Parameters:
Name Type Description
lat String

latitude

lng String

longitude

options Object

geocoder options

callback function

callback

Returns:
Type
undefined

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

saveRemoteImages(context, remoteUrlWorker) → {undefined}

Processes the Jobs to convert a remote image

Source:
Parameters:
Name Type Description
context Object

App context

remoteUrlWorker Object

The created instance of RemoteUrlWorker

Returns:
Type
undefined

saveTempImages(context, fileWorker) → {undefined}

Processes the Jobs to convert a local image

Source:
Parameters:
Name Type Description
context Object

App context

fileWorker Object

The created instance of TempFileStoreWorker

Returns:
Type
undefined

scheduleJob(options) → {Promise.<Job>}

Schedule a background job

Source:
Parameters:
Name Type Description
options Object

Job options

Properties
Name Type Attributes Default Description
cancelRepeats Boolean <optional>
false

Upon scheduling, cancel all jobs with the same type that aren't complete or failed yet.

priority String <optional>

Priority

retry Object <optional>

Retry options

schedule String <optional>

A schedule string that later.js understands

type String

The job type. Determines which worker will work the job.

Returns:

A promise that resolves with the job instance

Type
Promise.<Job>

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(context, adminUserId) → {undefined}

Sends a new order notification to an admin

Source:
Parameters:
Name Type Description
context Object

App context

Properties
Name Type Description
collections Object

Map of MongoDB collections

adminUserId String

User ID (not account ID)

Returns:
Type
undefined

sendVerificationEmail(context, input) → {Job}

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

Source:
Parameters:
Name Type Description
context Object

Startup context

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

Returns:
  • returns a sendEmail Job instance
Type
Job

sendWelcomeEmail(context, input) → {Boolean}

Send an email to consumers on sign up

Source:
Parameters:
Name Type Description
context Object

GraphQL execution context

input Object

Necessary input for mutation. See SimpleSchema.

Properties
Name Type Description
shopId String

shopId of new User

token String

the token for the verification URL

userId String

new userId to welcome

Returns:

returns true on success

Type
Boolean

setBaseContext(context) → {undefined}

Sets the baseContext used by getGraphQLContextInMeteorMethod

Source:
Parameters:
Name Type Description
context Object

The context object

Returns:
Type
undefined

setCollections(registeredCollections) → {undefined}

Use this to set the raw collections after all plugins have been registered.

Source:
Parameters:
Name Type Description
registeredCollections Object

Collections map

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>

setMongoDatabase(db) → {undefined}

Use this method to provide the MongoDB database instance. A side effect is that this.collections/this.context.collections will have all collections available on it after this is called.

Source:
Parameters:
Name Type Description
db Database

MongoDB library database instance

Returns:
Type
undefined

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>

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

ShopBrandImageOption(props) → {Node}

ShopBrandImageOption

.

Source:

ShopBrandImageOption

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

ShopBrandMediaManager(props) → {Node}

ShopBrandMediaManager

.

Source:

ShopBrandMediaManager

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

ShopLogoWithData(props) → {Node}

ShopLogoWithData

.

Source:

ShopLogoWithData

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

Main sidebar navigation

.

Source:

Main sidebar navigation

Parameters:
Name Type Description
props Object

Component props

Returns:

Sidebar component

Type
React.Component

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

SitemapSettings(props) → {Node}

Sitemap settings form block component

.

Source:

Sitemap settings form block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

sleep(ms) → {Promise.<undefined>}

Sleep for some milliseconds

Source:
Parameters:
Name Type Description
ms Number

Milliseconds to sleep for

Returns:

Returns a promise that resolves after the specified number of milliseconds

Type
Promise.<undefined>

SortableNodeContentRenderer(props) → {React.Component}

SortableNodeContentRenderer

.

Source:

SortableNodeContentRenderer

Parameters:
Name Type Description
props Object

Component props

Returns:

A react component

Type
React.Component

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>

(async) start(options) → {Promise.<undefined>}

Starts the entire app. Connects to mongoUrl, builds the context.collections, runs plugin startup code, creates the Apollo server and the Express app as necessary, and then starts the server listening on port if port is provided.

Source:
Parameters:
Name Type Description
options Object

Options object

Properties
Name Type Attributes Description
mongoUrl String

MongoDB connection URL

port Number <optional>

Port to listen on. If not provided, the server will be created but will not listen.

Returns:

Nothing

Type
Promise.<undefined>

(async) startServer(options) → {Promise.<undefined>}

Creates the Apollo server and the Express app, if necessary, and then starts it listening on port.

Source:
Parameters:
Name Type Description
options Object

Options object

Properties
Name Type Attributes Description
port Number <optional>

Port to listen on. If not provided, the server will be created but will not listen.

Returns:

Nothing

Type
Promise.<undefined>

startup(context) → {undefined}

Simple pricing startup function.

Source:
Parameters:
Name Type Description
context Object

App context.

Returns:
  • void, no return.
Type
undefined

(async) stop() → {Promise.<undefined>}

Stops the entire app. Closes the MongoDB connection and stops the Express server listening.

Source:
Returns:

Nothing

Type
Promise.<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

TagDropzone() → {React.Component}

Extra component to use Dropzone v10 with the TagForm class component

.

Source:

Extra component to use Dropzone v10 with the TagForm class component

Returns:

Dropzone Component

Type
React.Component

TagSelector(props) → {React.Component}

TagSelector component

.

Source:

TagSelector component

Parameters:
Name Type Description
props Object

Component props

Returns:

A React component

Type
React.Component

TagTableSelect(props) → {Node}

Tag table select component, compatible with react table

Source:
Parameters:
Name Type Description
props Object

Props

Returns:

React component

Type
Node

TagToolbar(props) → {React.Component}

Tag toolbar component

.

Source:

Tag toolbar component

Parameters:
Name Type Description
props Object

Component props

Returns:

Tag toolbar component

Type
React.Component

toArray(order) → {Object}

Source:
Parameters:
Name Type Description
order Object

The order document to transform

Returns:

The converted order document

Type
Object

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>

transformInventoryOnCatalog(catalogProduct, input) → {undefined}

Publishes our plugin-specific product fields to the catalog

Source:
Parameters:
Name Type Description
catalogProduct Object

The catalog product that is being built. Should mutate this.

input Object

Input data

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>

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>

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 layout component

.

Source:

VariantDetail layout component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

VariantDetailForm(props) → {React.Component}

Variant detail block

.

Source:

Variant detail block

Parameters:
Name Type Description
props Object

Component props

Returns:

A React component

Type
React.Component

VariantHeader(props) → {Node}

Variant table block component

.

Source:

Variant table block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

VariantInventoryForm(props) → {Node}

Variant inventory form block component

.

Source:

Variant inventory form block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

VariantList(props) → {Node}

A list component for variant and option depending on passed in props

Source:

Variant and Option list component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

VariantMediaForm(props) → {Node}

Variant media form block component

.

Source:

Variant media form block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React component

Type
Node

VariantTable(props) → {Node}

Variant table block component

.

Source:

Variant table block component

Parameters:
Name Type Description
props Object

Component props

Returns:

React node

Type
Node

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

VariantTaxForm(props) → {React.Component}

Variant tax block component

.

Source:

Variant tax block component

Parameters:
Name Type Description
props Object

Component props

Returns:

A React component

Type
React.Component

wrapWithDb(mongoConn) → {Object}

Provides a way to get at the underlying instance of the DB connection

.

Source:

Provides a way to get at the underlying instance of the DB connection

Parameters:
Name Type Description
mongoConn Object

mongo connection

Returns:

The underlying Mongo connection database

Type
Object

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
context Object

App context

product Object

The source 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