swell-js 4.0.7 → 4.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account.mjs +14 -2
- package/dist/api.mjs +2 -2
- package/dist/attributes.mjs +1 -1
- package/dist/cache.mjs +2 -2
- package/dist/card.mjs +2 -2
- package/dist/cart.mjs +4 -4
- package/dist/categories.mjs +1 -1
- package/dist/content.mjs +1 -1
- package/dist/cookie.mjs +1 -1
- package/dist/{index.6938673d.mjs → index.95daac5a.mjs} +3 -1
- package/dist/index.mjs +1 -1
- package/dist/payment.mjs +135 -41
- package/dist/products.mjs +1 -1
- package/dist/settings.mjs +3 -3
- package/dist/subscriptions.mjs +1 -1
- package/dist/swell.cjs +165 -57
- package/dist/swell.cjs.map +1 -1
- package/dist/swell.umd.min.js +203 -136
- package/dist/swell.umd.min.js.map +1 -1
- package/dist/utils/index.mjs +1 -1
- package/package.json +10 -2
- package/types/account/camel.d.ts +6 -10
- package/types/account/index.d.ts +4 -3
- package/types/account/snake.d.ts +12 -9
- package/types/attribute/camel.d.ts +2 -4
- package/types/attribute/snake.d.ts +3 -2
- package/types/billing/camel.d.ts +14 -25
- package/types/billing/index.d.ts +5 -0
- package/types/billing/snake.d.ts +30 -21
- package/types/card/camel.d.ts +7 -10
- package/types/card/index.d.ts +4 -3
- package/types/card/snake.d.ts +6 -4
- package/types/cart/camel.d.ts +24 -16
- package/types/cart/index.d.ts +23 -1
- package/types/cart/snake.d.ts +57 -22
- package/types/category/camel.d.ts +2 -4
- package/types/category/snake.d.ts +10 -7
- package/types/content/camel.d.ts +3 -7
- package/types/content/index.d.ts +1 -0
- package/types/content/snake.d.ts +6 -3
- package/types/coupon/camel.d.ts +2 -4
- package/types/coupon/snake.d.ts +9 -11
- package/types/currency/camel.d.ts +9 -10
- package/types/currency/index.d.ts +3 -0
- package/types/discount/camel.d.ts +14 -5
- package/types/discount/index.d.ts +16 -2
- package/types/discount/snake.d.ts +34 -8
- package/types/giftcard/camel.d.ts +6 -0
- package/types/giftcard/index.d.ts +5 -0
- package/types/giftcard/snake.d.ts +39 -0
- package/types/index.d.ts +210 -147
- package/types/invoice/camel.d.ts +2 -4
- package/types/invoice/snake.d.ts +16 -10
- package/types/order/camel.d.ts +7 -16
- package/types/order/index.d.ts +1 -0
- package/types/order/snake.d.ts +35 -21
- package/types/payment/camel.d.ts +17 -25
- package/types/payment/index.d.ts +8 -0
- package/types/payment/snake.d.ts +57 -34
- package/types/product/camel.d.ts +13 -36
- package/types/product/index.d.ts +8 -8
- package/types/product/snake.d.ts +37 -30
- package/types/promotion/camel.d.ts +6 -5
- package/types/promotion/index.d.ts +6 -2
- package/types/promotion/snake.d.ts +20 -8
- package/types/purchase_link/camel.d.ts +3 -9
- package/types/purchase_link/index.d.ts +3 -7
- package/types/purchase_link/snake.d.ts +9 -12
- package/types/refund/camel.d.ts +2 -4
- package/types/shipment_rating/camel.d.ts +4 -7
- package/types/shipment_rating/index.d.ts +1 -0
- package/types/shipment_rating/snake.d.ts +3 -1
- package/types/subscription/camel.d.ts +13 -8
- package/types/subscription/index.d.ts +17 -3
- package/types/subscription/snake.d.ts +35 -27
package/dist/account.mjs
CHANGED
|
@@ -77,7 +77,7 @@ function methods(request) {
|
|
|
77
77
|
},
|
|
78
78
|
|
|
79
79
|
listOrders(query) {
|
|
80
|
-
return request('get',
|
|
80
|
+
return request('get', '/account/orders', query);
|
|
81
81
|
},
|
|
82
82
|
|
|
83
83
|
getOrder(id) {
|
|
@@ -85,14 +85,26 @@ function methods(request) {
|
|
|
85
85
|
},
|
|
86
86
|
|
|
87
87
|
// Deprecated methods
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @deprecated use `listAddresses` instead
|
|
91
|
+
*/
|
|
88
92
|
getAddresses(query) {
|
|
89
93
|
return request('get', '/account/addresses', query);
|
|
90
94
|
},
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* @deprecated use `listCards` instead
|
|
98
|
+
*/
|
|
91
99
|
getCards(query) {
|
|
92
100
|
return request('get', '/account/cards', query);
|
|
93
101
|
},
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @deprecated use `listOrders` instead
|
|
105
|
+
*/
|
|
94
106
|
getOrders(query) {
|
|
95
|
-
return request('get',
|
|
107
|
+
return request('get', '/account/orders', query);
|
|
96
108
|
},
|
|
97
109
|
};
|
|
98
110
|
}
|
package/dist/api.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import methods$5 from './products.mjs';
|
|
|
7
7
|
import methods$6 from './categories.mjs';
|
|
8
8
|
import methods$7 from './attributes.mjs';
|
|
9
9
|
import methods$8 from './subscriptions.mjs';
|
|
10
|
-
import { d as defaultMethods, z as trimEnd, A as utils, B as trimStart, C as trimBoth, t as toSnake, D as stringifyQuery, E as base64Encode, a as toCamel, F as setOptions } from './index.
|
|
10
|
+
import { d as defaultMethods, z as trimEnd, A as utils, B as trimStart, C as trimBoth, t as toSnake, D as stringifyQuery, E as base64Encode, a as toCamel, F as setOptions } from './index.95daac5a.mjs';
|
|
11
11
|
import methods$9 from './content.mjs';
|
|
12
12
|
import methods$a from './settings.mjs';
|
|
13
13
|
import PaymentController from './payment.mjs';
|
|
@@ -135,7 +135,7 @@ const options = {
|
|
|
135
135
|
};
|
|
136
136
|
|
|
137
137
|
const api = {
|
|
138
|
-
version: '4.0.
|
|
138
|
+
version: '4.0.9',
|
|
139
139
|
options,
|
|
140
140
|
request,
|
|
141
141
|
|
package/dist/attributes.mjs
CHANGED
package/dist/cache.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as set, m as merge, a as toCamel, h as toCamelPath, j as getOptions } from './index.
|
|
1
|
+
import { s as set, m as merge, a as toCamel, h as toCamelPath, j as getOptions } from './index.95daac5a.mjs';
|
|
2
2
|
import { g as get } from './find.fd7de00e.mjs';
|
|
3
3
|
import 'qs';
|
|
4
4
|
import './round.a606b844.mjs';
|
|
@@ -53,7 +53,7 @@ const cacheApi = {
|
|
|
53
53
|
set(details) {
|
|
54
54
|
this.debug('cache.set', ...arguments);
|
|
55
55
|
let { model, id, path, value } = details;
|
|
56
|
-
let { data = {}, record
|
|
56
|
+
let { data = {}, record } = this.values(details);
|
|
57
57
|
|
|
58
58
|
if (id === null) {
|
|
59
59
|
return;
|
package/dist/card.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as toSnake, v as vaultRequest } from './index.
|
|
1
|
+
import { t as toSnake, v as vaultRequest } from './index.95daac5a.mjs';
|
|
2
2
|
import 'qs';
|
|
3
3
|
import './find.fd7de00e.mjs';
|
|
4
4
|
import './round.a606b844.mjs';
|
|
@@ -64,7 +64,7 @@ const cardApi = {
|
|
|
64
64
|
return value;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const parts = new String(value).split(/[\s
|
|
67
|
+
const parts = new String(value).split(/[\s/-]+/, 2);
|
|
68
68
|
const month = parts[0];
|
|
69
69
|
let year = parts[1];
|
|
70
70
|
|
package/dist/cart.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import 'qs';
|
|
2
|
-
import { c as cloneDeep } from './index.
|
|
2
|
+
import { c as cloneDeep } from './index.95daac5a.mjs';
|
|
3
3
|
import 'deepmerge';
|
|
4
4
|
import 'fast-case';
|
|
5
5
|
import { cleanProductOptions } from './products.mjs';
|
|
@@ -137,7 +137,7 @@ function methods(request, options) {
|
|
|
137
137
|
if (options.updateCart) {
|
|
138
138
|
return options.updateCart(input);
|
|
139
139
|
}
|
|
140
|
-
return this.requestStateChange('put',
|
|
140
|
+
return this.requestStateChange('put', '/cart', data);
|
|
141
141
|
},
|
|
142
142
|
|
|
143
143
|
applyCoupon(code) {
|
|
@@ -176,11 +176,11 @@ function methods(request, options) {
|
|
|
176
176
|
async getOrder(checkoutId = undefined) {
|
|
177
177
|
let result;
|
|
178
178
|
if (checkoutId) {
|
|
179
|
-
result = await request('get',
|
|
179
|
+
result = await request('get', '/cart/order', {
|
|
180
180
|
checkout_id: checkoutId,
|
|
181
181
|
});
|
|
182
182
|
} else {
|
|
183
|
-
result = await request('get',
|
|
183
|
+
result = await request('get', '/cart/order');
|
|
184
184
|
}
|
|
185
185
|
this.order = result;
|
|
186
186
|
return result;
|
package/dist/categories.mjs
CHANGED
package/dist/content.mjs
CHANGED
package/dist/cookie.mjs
CHANGED
|
@@ -1469,11 +1469,13 @@ function isEmpty(value) {
|
|
|
1469
1469
|
return true;
|
|
1470
1470
|
}
|
|
1471
1471
|
|
|
1472
|
+
/* global Buffer */
|
|
1473
|
+
|
|
1472
1474
|
const LOADING_SCRIPTS = {};
|
|
1473
1475
|
|
|
1474
1476
|
let options = {};
|
|
1475
1477
|
|
|
1476
|
-
function merge(x, y,
|
|
1478
|
+
function merge(x, y, _opt = {}) {
|
|
1477
1479
|
if (!y || typeof y !== 'object') {
|
|
1478
1480
|
return x;
|
|
1479
1481
|
}
|