From 588deae0b318a17988bdece3e11cfc77b3ce2eff Mon Sep 17 00:00:00 2001 From: Stephen Keep Date: Mon, 13 Apr 2015 15:57:28 +0100 Subject: [PATCH 01/12] Update magento.js Add switch to load secure connection --- src/magento.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/magento.js b/src/magento.js index 1d3938b..cdcaee2 100644 --- a/src/magento.js +++ b/src/magento.js @@ -77,7 +77,13 @@ function Magento(config) { } this.config = magentoConfig; - this.client = xmlrpc.createClient(this.config); + + if (this.config.secure === true) { + this.client = xmlrpc.createSecureClient(this.config); + } else { + this.client = xmlrpc.createClient(this.config); + } + this.queue = []; this.queue.running = 0; this.queue.parallelLimit = this.config.parallelLimit; From 41af37afeee0bc2b5c49e506a4cd6c9b660ca1e6 Mon Sep 17 00:00:00 2001 From: Stephen Keep Date: Mon, 13 Apr 2015 15:57:52 +0100 Subject: [PATCH 02/12] Update magento.js --- src/magento.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/magento.js b/src/magento.js index cdcaee2..6c3ba08 100644 --- a/src/magento.js +++ b/src/magento.js @@ -48,7 +48,8 @@ var configDefaults = { path: mandatory, login: mandatory, pass: mandatory, - parallelLimit: Infinity + parallelLimit: Infinity, + secure: false }; /** From 2f5ea69d96cb03705aeb0b6a19a5d92afc5118bc Mon Sep 17 00:00:00 2001 From: Stephen Keep Date: Wed, 15 Apr 2015 13:12:30 +0100 Subject: [PATCH 03/12] Update package.json --- package.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f4ebf39..4da27ee 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,14 @@ { "name": "magento", - "author": "Tim Marshall ", + "author": "Stephen Keep ", "description": "Magento SOAP API wrapper for Node.js", - "version": "0.0.5", + "version": "0.0.6", "main": "./src/magento", "contributors": [ + { + "name": "Stephen Keep", + "email": "stephenkeep@gmail.com" + }, { "name": "Tim Marshall", "email": "timothyjmarshall@gmail.com" @@ -23,6 +27,6 @@ "api", "xml" ], - "repository": "git://github.com/MadisonReed/magentoapi", + "repository": "git://github.com/stephenkeep/magentoapi", "license": "MIT" } From 65d6cd2802d3ca28eed8d26def9b370f869a2634 Mon Sep 17 00:00:00 2001 From: Stephen Keep Date: Wed, 15 Apr 2015 13:27:02 +0100 Subject: [PATCH 04/12] Update package.json --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 4da27ee..023f1f0 100644 --- a/package.json +++ b/package.json @@ -17,10 +17,7 @@ "engines": { "node": ">=0.10.20" }, - "dependencies" : { - "request": "2.34.0", - "xmlrpc": "1.2.0" - }, + "dependencies" : {}, "keywords": [ "magento", "soap", From 59f41d1eff361a1cadf04a52c720285c73453186 Mon Sep 17 00:00:00 2001 From: Stephen Keep Date: Wed, 15 Apr 2015 13:31:04 +0100 Subject: [PATCH 05/12] Update package.json --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 023f1f0..1625519 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,10 @@ "engines": { "node": ">=0.10.20" }, - "dependencies" : {}, + "dependencies" : { +- "request": "2.34.0", +- "xmlrpc": "1.2.0" +- }, "keywords": [ "magento", "soap", From 484237334567007adaf79506035a95f191581ebb Mon Sep 17 00:00:00 2001 From: Ernest Conill Date: Thu, 17 Dec 2015 09:29:09 +0100 Subject: [PATCH 06/12] update on catalog category and product mandatory and optional fields --- src/resources/catalog_category.js | 2 +- src/resources/catalog_product.js | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/resources/catalog_category.js b/src/resources/catalog_category.js index 0f3d700..b80b25a 100644 --- a/src/resources/catalog_category.js +++ b/src/resources/catalog_category.js @@ -36,7 +36,7 @@ var protos = { Create a new category and return its ID. */ create: { - mandatory: 'categoryId,data', + mandatory: 'parentId,categoryData', optional: 'storeView' }, diff --git a/src/resources/catalog_product.js b/src/resources/catalog_product.js index e46c7fb..bb1bf3a 100644 --- a/src/resources/catalog_product.js +++ b/src/resources/catalog_product.js @@ -21,36 +21,38 @@ var protos = { Allows you to create a new product and return ID of the created product. */ create: { - mandatory: 'type,set,sku,data' + mandatory: 'type,set,sku,data', + optional: 'storeView' }, /** Allows you to set/get the current store view. */ currentStore: { - optional: 'view' + optional: 'storeView' }, /** Allows you to delete the required product. */ 'delete': { - mandatory: 'id' + mandatory: 'product' }, /** Allows you to get the product special price data. */ getSpecialPrice: { - mandatory: 'id' + mandatory: 'product', + optional: 'storeView' }, /** Allows you to retrieve information about the required product. */ info: { - mandatory: 'id', - optional: 'storeView' + mandatory: 'productId', + optional: 'storeView,attributes' }, /** @@ -71,7 +73,7 @@ var protos = { Allows you to set the product special price. */ setSpecialPrice: { - mandatory: 'id,specialPrice,from,to', + mandatory: 'productId,specialPrice,fromDate,toDate', optional: 'storeView', modifiers: { from: dateToISO8601Time, @@ -83,7 +85,7 @@ var protos = { Allows you to update the required product. Note that you should specify only those parameters which you want to be updated. */ update: { - mandatory: 'id,data', + mandatory: 'product,productData', optional: 'storeView' } }; From 33ee5c0414a4cde1965b54ced4d49b131c5577a5 Mon Sep 17 00:00:00 2001 From: Ernest Conill Date: Thu, 17 Dec 2015 11:34:55 +0100 Subject: [PATCH 07/12] just version changes --- package.json | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 1625519..dce40e6 100644 --- a/package.json +++ b/package.json @@ -1,10 +1,14 @@ { "name": "magento", - "author": "Stephen Keep ", + "author": "Ernest Conill ", "description": "Magento SOAP API wrapper for Node.js", - "version": "0.0.6", + "version": "0.0.7", "main": "./src/magento", "contributors": [ + { + "name": "Ernest Conill", + "email": "ernestconill@gmail.com" + }, { "name": "Stephen Keep", "email": "stephenkeep@gmail.com" @@ -18,15 +22,15 @@ "node": ">=0.10.20" }, "dependencies" : { -- "request": "2.34.0", -- "xmlrpc": "1.2.0" -- }, + "request": "2.34.0", + "xmlrpc": "1.2.0" + }, "keywords": [ "magento", "soap", "api", "xml" ], - "repository": "git://github.com/stephenkeep/magentoapi", + "repository": "git://github.com/netusco/magentoapi", "license": "MIT" } From 82164c92d073948c6aec961d7d3426d3d3d5a415 Mon Sep 17 00:00:00 2001 From: Ernest Conill Date: Thu, 17 Dec 2015 11:55:24 +0100 Subject: [PATCH 08/12] fixes on catalog_product fields --- src/resources/catalog_product.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/resources/catalog_product.js b/src/resources/catalog_product.js index bb1bf3a..c90f082 100644 --- a/src/resources/catalog_product.js +++ b/src/resources/catalog_product.js @@ -21,7 +21,7 @@ var protos = { Allows you to create a new product and return ID of the created product. */ create: { - mandatory: 'type,set,sku,data', + mandatory: 'type,set,sku,productData' optional: 'storeView' }, @@ -36,7 +36,8 @@ var protos = { Allows you to delete the required product. */ 'delete': { - mandatory: 'product' + mandatory: 'product', + optional: 'identifierType' }, /** @@ -59,7 +60,7 @@ var protos = { Allows you to retrieve the list of products. */ list: { - optional: 'filters' + optional: 'filters,storeView' }, /** @@ -86,7 +87,7 @@ var protos = { */ update: { mandatory: 'product,productData', - optional: 'storeView' + optional: 'storeView,identifierType' } }; From 6aaeb5d254a3944bab50e88e34f1efd419370f5e Mon Sep 17 00:00:00 2001 From: Ernest Conill Date: Thu, 17 Dec 2015 12:14:07 +0100 Subject: [PATCH 09/12] coma fix! ;) --- src/resources/catalog_product.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/catalog_product.js b/src/resources/catalog_product.js index c90f082..cef0277 100644 --- a/src/resources/catalog_product.js +++ b/src/resources/catalog_product.js @@ -21,7 +21,7 @@ var protos = { Allows you to create a new product and return ID of the created product. */ create: { - mandatory: 'type,set,sku,productData' + mandatory: 'type,set,sku,productData', optional: 'storeView' }, From 6f0a34fbfed57f11c175c7f2b2865b45f13e4ea0 Mon Sep 17 00:00:00 2001 From: Ernest Conill Date: Tue, 5 Jan 2016 17:05:08 +0100 Subject: [PATCH 10/12] custom tools to link configurable products --- src/resources/ourlabor_tools.js | 36 +++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/resources/ourlabor_tools.js diff --git a/src/resources/ourlabor_tools.js b/src/resources/ourlabor_tools.js new file mode 100644 index 0000000..2f1e603 --- /dev/null +++ b/src/resources/ourlabor_tools.js @@ -0,0 +1,36 @@ +// external dependencies +var events = require('events'); +var util = require('util'); + +// internal dependencies +var prototypeBase = require('../prototype_base.js'); +var curry = require('../curry.js'); + +/** + Allows you to manage products. +*/ +function OurlaborTools() { + this.prefix = 'ourlabor_tools.'; +} +util.inherits(OurlaborTools, events.EventEmitter); + + +// prototypes we will be applying +var protos = { + /** + Allows you to link simple products with a configurable product, + set the configurable attributes and prices. + */ + configurable_create_for_reals: { + mandatory: 'productId,attributes,variants', + optional: 'identifierType' + } +}; + +// creating prototypes using curry func +for (var key in protos) { + OurlaborTools.prototype[key] = curry(prototypeBase, key, protos[key]); +} +protos = undefined; + +module.exports = OurlaborTools; From fd0679a0c60253b654046adbe7578f6f62b143ca Mon Sep 17 00:00:00 2001 From: Ernest Conill Date: Tue, 5 Jan 2016 17:15:44 +0100 Subject: [PATCH 11/12] connecting ourlaborTools to magentoApi instance --- src/magento.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/magento.js b/src/magento.js index 6c3ba08..8ddfed8 100644 --- a/src/magento.js +++ b/src/magento.js @@ -35,6 +35,7 @@ var resources = { customerGroup: './resources/customer_group.js', directoryCountry: './resources/directory_country.js', directoryRegion: './resources/directory_region.js', + ourlaborTools: './resources/ourlabor_tools.js', salesOrder: './resources/sales_order.js', salesOrderCreditMemo: './resources/sales_order_credit_memo.js', salesOrderInvoice: './resources/sales_order_invoice.js', From 8687a236424a45c055ddcdca4eeda5130e2b32a5 Mon Sep 17 00:00:00 2001 From: Ernest Conill Date: Fri, 29 Jan 2016 09:38:13 +0100 Subject: [PATCH 12/12] changing ourlabor magento api extension module folder name --- src/magento.js | 2 +- ...urlabor_tools.js => ourlaborisjoy_tools.js} | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) rename src/resources/{ourlabor_tools.js => ourlaborisjoy_tools.js} (58%) diff --git a/src/magento.js b/src/magento.js index 8ddfed8..8699afb 100644 --- a/src/magento.js +++ b/src/magento.js @@ -35,7 +35,7 @@ var resources = { customerGroup: './resources/customer_group.js', directoryCountry: './resources/directory_country.js', directoryRegion: './resources/directory_region.js', - ourlaborTools: './resources/ourlabor_tools.js', + ourlaborisjoyTools: './resources/ourlaborisjoy_tools.js', salesOrder: './resources/sales_order.js', salesOrderCreditMemo: './resources/sales_order_credit_memo.js', salesOrderInvoice: './resources/sales_order_invoice.js', diff --git a/src/resources/ourlabor_tools.js b/src/resources/ourlaborisjoy_tools.js similarity index 58% rename from src/resources/ourlabor_tools.js rename to src/resources/ourlaborisjoy_tools.js index 2f1e603..2c3a20a 100644 --- a/src/resources/ourlabor_tools.js +++ b/src/resources/ourlaborisjoy_tools.js @@ -9,10 +9,10 @@ var curry = require('../curry.js'); /** Allows you to manage products. */ -function OurlaborTools() { - this.prefix = 'ourlabor_tools.'; +function OurlaborisjoyTools() { + this.prefix = 'ourlaborisjoy_tools.'; } -util.inherits(OurlaborTools, events.EventEmitter); +util.inherits(OurlaborisjoyTools, events.EventEmitter); // prototypes we will be applying @@ -24,13 +24,21 @@ var protos = { configurable_create_for_reals: { mandatory: 'productId,attributes,variants', optional: 'identifierType' + }, + + /** + * Allows you to add product attributes that cannot be added through normal api calls + */ + add_msrp_attribute: { + mandatory: 'product,msrp', + optional: 'identifierType,storeView' } }; // creating prototypes using curry func for (var key in protos) { - OurlaborTools.prototype[key] = curry(prototypeBase, key, protos[key]); + OurlaborisjoyTools.prototype[key] = curry(prototypeBase, key, protos[key]); } protos = undefined; -module.exports = OurlaborTools; +module.exports = OurlaborisjoyTools;