This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fs = require('fs'); | |
let FiddlerProxy = require('mozu-node-sdk/plugins/fiddler-proxy'); | |
let apiContext = require('mozu-node-sdk/clients/platform/application')(); | |
apiContext.plugins = [FiddlerProxy()]; | |
const documentResource = require('mozu-node-sdk/clients/content/documentlists/document')(apiContext); | |
let filePath = __dirname + "\\bobafett.jpg"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"template": "<path>", | |
"defaults": {}, | |
"internalRoute": "Arcjs", | |
"functionId": "<Arc function name>", | |
"mappings": {}, | |
"validators": {} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<startup> | |
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> | |
</startup> | |
<appSettings> | |
<add key="TenantId" value="TenantIdValue" /> | |
<add key="SiteId" value="SiteIdValue" /> | |
<add key="ApplicationId" value="AppKeyValue" /> | |
<add key="SharedSecret" value="SharedSecretValue" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.amsxbg; | |
import com.mozu.api.MozuApiContext; | |
import com.mozu.api.contracts.appdev.AppAuthInfo; | |
import com.mozu.api.resources.commerce.customer.CustomerAccountResource; | |
import com.mozu.api.security.AppAuthenticator; | |
public class GetCustomerAccountsCount { | |
public static void main(String[] args){ | |
AppAuthInfo appAuthInfo = new AppAuthInfo(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void StoreCredit_Transaction() | |
{ | |
var transactionResource = new Mozu.Api.Resources.Commerce.Customer.Credits.CreditTransactionResource(_apiContext); | |
var newTransaction = new Mozu.Api.Contracts.Customer.Credit.CreditTransaction() | |
{ | |
Comments = "Add any comments you might have...", | |
//For a Debit, this must be set as a negative number. | |
ImpactAmount = -5.00m, | |
TransactionType = "Debit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var productResource = new Mozu.Api.Resources.Commerce.Catalog.Admin.ProductResource(_apiContext); | |
var productVariantResource = new Mozu.Api.Resources.Commerce.Catalog.Admin.Products.ProductVariationResource(_apiContext); | |
var product = new Mozu.Api.Contracts.ProductAdmin.Product() | |
{ | |
Content = new ProductLocalizedContent() | |
{ | |
ProductName = "Generated Product with variants", | |
}, | |
ProductCode = "GEN-WITH-VARS-1", | |
Price = new ProductPrice() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @site: t14923-s21420.sandbox.mozu.com | |
var Hypr = require("hyprlive"); | |
var template = [ | |
'HYPR CODE HERE!!!' | |
].join('\n'); | |
console.log(template); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//First, pull in the pieces of the Node SDK used to make API requests. | |
//Each of these Factories will need to receive an apiContext object to gain authorization to make API requests. | |
var CartExtendedPropertiesResourceFactory = require('mozu-node-sdk/clients/commerce/carts/extendedProperty'); | |
var OrderResourceFactory = require('mozu-node-sdk/clients/commerce/order'); | |
module.exports = function(context, callback) { | |
//Wrap functionality in a try/catch block. This prevents errors from stalling the Mozu Storefront. | |
try { | |
//The context.apiContext contains both app-claims and user-claims. | |
//The user-claims allow for making API requests scoped to the user who triggered this Arc.js action. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (context, callback) { | |
console.log("Request:"); | |
console.log(context.request); | |
console.log("Request Params:"); | |
console.log(context.request.params); | |
console.log("Request Headers:"); | |
console.log(context.request.headers); | |
console.log("Request Method:"); | |
console.log(context.request.method); | |
console.log("Request Url:"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"documentTypeFQN": "entityEditor@mozu", | |
"listFQN": "entityEditors@mozu", | |
"name": "store-location-editor", | |
"properties": { | |
"code": "Ext code goes here", | |
"documentLists": [], | |
"documentTypes": [], | |
"entityLists": ["storelocations@grobelny"], | |
"priority": 0 |