Skip to content
This repository was archived by the owner on May 28, 2023. It is now read-only.

Commit 265ecff

Browse files
authored
Merge pull request #193 from DivanteLtd/develop
Release 1.8.3
2 parents a1223f3 + 9f95d30 commit 265ecff

33 files changed

+7894
-7696
lines changed

config/default.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,21 @@
162162
"accessTokenSecret": "7qunl3p505rubmr7u1ijt7odyialnih9"
163163
}
164164
},
165+
"magento1": {
166+
"url": "http://magento-demo.local",
167+
"imgUrl": "http://magento-demo.local/media/catalog/product",
168+
"magentoUserName": "",
169+
"magentoUserPassword": "",
170+
"httpUserName": "",
171+
"httpUserPassword": "",
172+
"api": {
173+
"url": "http://magento-demo.local/vsbridge",
174+
"consumerKey": "",
175+
"consumerSecret": "",
176+
"accessToken": "",
177+
"accessTokenSecret": ""
178+
}
179+
},
165180
"imageable": {
166181
"namespace": "",
167182
"maxListeners": 512,

config/elastic.schema.category.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"properties": {
33
"url_key": {"type": "keyword"},
4+
"url_path": {"type": "keyword"},
5+
"slug": {"type": "keyword"},
46
"is_active": {"type": "boolean"},
57
"product_count": {"type": "integer"},
68
"parent_id": {"type": "integer"},

config/elastic.schema.product.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"properties": {
33
"sku": {"type": "keyword"},
44
"url_key": {"type": "keyword"},
5+
"url_path": {"type": "keyword"},
56
"slug": {"type": "keyword"},
67
"size": {"type": "integer"},
78
"size_options": {"type": "integer"},

src/platform/abstract/address.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class AbstractAddressProxy {
2+
constructor(config, req) {
3+
this._config = config
4+
this._request = req
5+
}
6+
7+
list (customerToken) {
8+
throw new Error('AbstractAddressProxy::list must be implemented for specific platform')
9+
}
10+
update (customerToken, addressData) {
11+
throw new Error('AbstractAddressProxy::update must be implemented for specific platform')
12+
}
13+
get (customerToken, addressId) {
14+
throw new Error('AbstractAddressProxy::get must be implemented for specific platform')
15+
}
16+
delete (customerToken, addressData) {
17+
throw new Error('AbstractAddressProxy::delete must be implemented for specific platform')
18+
}
19+
}
20+
21+
export default AbstractAddressProxy

src/platform/abstract/contact.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class AbstractContactProxy {
2+
submit (formData) {
3+
throw new Error('AbstractContactProxy::check must be implemented for specific platform')
4+
}
5+
}
6+
7+
module.exports = AbstractContactProxy

src/platform/abstract/newsletter.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class AbstractNewsletterProxy {
2+
subscribe (emailAddress) {
3+
}
4+
5+
unsubscribe (customerToken) {
6+
}
7+
}
8+
9+
module.exports = AbstractNewsletterProxy

src/platform/abstract/stock_alert.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class AbstractStockAlertProxy {
2+
constructor(config, req) {
3+
this._config = config
4+
this._request = req
5+
}
6+
subscribe (customerToken, productId, emailAddress) {
7+
throw new Error('AbstractContactProxy::subscribe must be implemented for specific platform')
8+
}
9+
}
10+
11+
export default AbstractStockAlertProxy

src/platform/abstract/wishlist.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
class AbstractWishlistProxy {
2+
pull (customerToken) {
3+
throw new Error('AbstractWishlistProxy::pull must be implemented for specific platform')
4+
}
5+
update (customerToken, wishListItem) {
6+
throw new Error('AbstractWishlistProxy::update must be implemented for specific platform')
7+
}
8+
delete (customerToken, wishListItem) {
9+
throw new Error('AbstractWishlistProxy::delete must be implemented for specific platform')
10+
}
11+
}
12+
13+
module.exports = AbstractWishlistProxy

src/platform/magento1/address.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import AbstractAddressProxy from '../abstract/address'
2+
import {multiStoreConfig} from "./util";
3+
import {Magento1Client} from "./module";
4+
5+
class AddressProxy extends AbstractAddressProxy {
6+
constructor (config, req){
7+
super(config, req)
8+
this.api = Magento1Client(multiStoreConfig(config.magento1.api, req));
9+
}
10+
list (customerToken) {
11+
return this.api.address.list(customerToken)
12+
}
13+
update (customerToken, addressData) {
14+
return this.api.address.update(customerToken, addressData);
15+
}
16+
get (customerToken, addressId) {
17+
return this.api.address.get(customerToken, addressId)
18+
}
19+
delete (customerToken, addressData) {
20+
return this.api.address.delete(customerToken, addressData)
21+
}
22+
}
23+
24+
module.exports = AddressProxy

src/platform/magento1/cart.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import AbstractCartProxy from '../abstract/cart';
2+
import { multiStoreConfig } from './util';
3+
import { Magento1Client } from './module/index';
4+
5+
class CartProxy extends AbstractCartProxy {
6+
constructor (config, req){
7+
super(config, req)
8+
this.api = Magento1Client(multiStoreConfig(config.magento1.api, req));
9+
}
10+
create (customerToken) {
11+
return this.api.cart.create(customerToken);
12+
}
13+
update (customerToken, cartId, cartItem) {
14+
return this.api.cart.update(customerToken, cartId, cartItem);
15+
}
16+
delete (customerToken, cartId, cartItem) {
17+
return this.api.cart.delete(customerToken, cartId, cartItem);
18+
}
19+
pull (customerToken, cartId, params) {
20+
return this.api.cart.pull(customerToken, cartId, params);
21+
}
22+
totals (customerToken, cartId, params) {
23+
return this.api.cart.totals(customerToken, cartId, params);
24+
}
25+
getShippingMethods (customerToken, cartId, address) {
26+
return this.api.cart.shippingMethods(customerToken, cartId, address);
27+
}
28+
getPaymentMethods (customerToken, cartId) {
29+
return this.api.cart.paymentMethods(customerToken, cartId);
30+
}
31+
setShippingInformation (customerToken, cartId, address) {
32+
return this.api.cart.shippingInformation(customerToken, cartId, address);
33+
}
34+
collectTotals (customerToken, cartId, shippingMethod) {
35+
return this.api.cart.collectTotals(customerToken, cartId, shippingMethod);
36+
}
37+
applyCoupon (customerToken, cartId, coupon) {
38+
return this.api.cart.applyCoupon(customerToken, cartId, coupon);
39+
}
40+
deleteCoupon (customerToken, cartId) {
41+
return this.api.cart.deleteCoupon(customerToken, cartId);
42+
}
43+
getCoupon (customerToken, cartId) {
44+
return this.api.cart.getCoupon(customerToken, cartId);
45+
}
46+
}
47+
48+
module.exports = CartProxy;

0 commit comments

Comments
 (0)