swell-js 3.19.10 → 3.20.1
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/{api-b8c1d9ac.js → api-06903a1c.js} +20 -18
- package/dist/api.js +15 -15
- package/dist/{attributes-a5d59cae.js → attributes-7a214d6b.js} +2 -2
- package/dist/attributes.js +3 -3
- package/dist/{cache-70cd9241.js → cache-751d89b1.js} +1 -1
- package/dist/cache.js +2 -2
- package/dist/{card-31d20d88.js → card-91071403.js} +1 -1
- package/dist/card.js +2 -2
- package/dist/{cart-fe0aca95.js → cart-ff3e3ef6.js} +8 -2
- package/dist/cart.js +5 -5
- package/dist/{categories-bb6f6179.js → categories-8f6a4584.js} +2 -2
- package/dist/categories.js +3 -3
- package/dist/{content-8feae575.js → content-0afdcb05.js} +1 -1
- package/dist/content.js +3 -3
- package/dist/{cookie-dff5d694.js → cookie-b78058af.js} +1 -1
- package/dist/cookie.js +2 -2
- package/dist/{currency-85151e0d.js → currency-842f76f2.js} +2 -2
- package/dist/currency.js +3 -3
- package/dist/index-1582746d.js +2773 -0
- package/dist/{index-bee7164f.js → index-512fc30d.js} +488 -76
- package/dist/index.js +15 -15
- package/dist/{locale-abdc14e0.js → locale-4391bcf3.js} +2 -2
- package/dist/locale.js +3 -3
- package/dist/payment.js +7 -7
- package/dist/{products-9a198f48.js → products-7f2fbc3e.js} +3 -3
- package/dist/products.js +4 -4
- package/dist/{settings-3cf85d69.js → settings-937b96f1.js} +1 -1
- package/dist/settings.js +2 -2
- package/dist/{subscriptions-5d5db711.js → subscriptions-8044a530.js} +3 -3
- package/dist/subscriptions.js +5 -5
- package/dist/swell.cjs.js +2818 -1298
- package/dist/swell.cjs.js.map +1 -1
- package/dist/swell.umd.min.js +2731 -1321
- package/dist/swell.umd.min.js.map +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/types/billing/camel.d.ts +37 -0
- package/types/billing/index.d.ts +29 -0
- package/types/billing/snake.d.ts +59 -0
- package/types/card/snake.d.ts +3 -2
- package/types/cart/camel.d.ts +13 -1
- package/types/cart/index.d.ts +8 -4
- package/types/cart/snake.d.ts +71 -12
- package/types/coupon/camel.d.ts +6 -0
- package/types/coupon/index.d.ts +4 -0
- package/types/coupon/snake.d.ts +15 -0
- package/types/discount/camel.d.ts +6 -0
- package/types/discount/index.d.ts +4 -0
- package/types/discount/snake.d.ts +12 -0
- package/types/index.d.ts +24 -15
- package/types/invoice/snake.d.ts +7 -5
- package/types/order/camel.d.ts +11 -1
- package/types/order/index.d.ts +7 -4
- package/types/order/snake.d.ts +80 -22
- package/types/payment/index.d.ts +71 -21
- package/types/payment/snake.d.ts +4 -2
- package/types/product/camel.d.ts +4 -0
- package/types/product/index.d.ts +9 -8
- package/types/product/snake.d.ts +18 -17
- package/types/promotion/camel.d.ts +6 -0
- package/types/promotion/index.d.ts +4 -0
- package/types/promotion/snake.d.ts +20 -0
- package/types/purchase_link/camel.d.ts +14 -0
- package/types/purchase_link/index.d.ts +11 -0
- package/types/purchase_link/snake.d.ts +26 -0
- package/types/refund/camel.d.ts +6 -0
- package/types/refund/index.d.ts +4 -0
- package/types/refund/snake.d.ts +30 -0
- package/types/shipment_rating/camel.d.ts +10 -0
- package/types/shipment_rating/index.d.ts +5 -0
- package/types/shipment_rating/snake.d.ts +14 -0
- package/types/subscription/camel.d.ts +5 -1
- package/types/subscription/index.d.ts +4 -3
- package/types/subscription/snake.d.ts +36 -24
- package/dist/payment-491338ef.js +0 -1673
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { c as cardApi } from './card-
|
|
2
|
-
import { g as getCookie, s as setCookie } from './cookie-
|
|
3
|
-
import { c as cacheApi } from './cache-
|
|
4
|
-
import { m as methods$1 } from './cart-
|
|
1
|
+
import { c as cardApi } from './card-91071403.js';
|
|
2
|
+
import { g as getCookie, s as setCookie } from './cookie-b78058af.js';
|
|
3
|
+
import { c as cacheApi } from './cache-751d89b1.js';
|
|
4
|
+
import { m as methods$1 } from './cart-ff3e3ef6.js';
|
|
5
5
|
import { m as methods$2 } from './account-328cc590.js';
|
|
6
|
-
import { m as methods$3 } from './products-
|
|
7
|
-
import { m as methods$4 } from './categories-
|
|
8
|
-
import { m as methods$5 } from './attributes-
|
|
9
|
-
import { m as methods$6 } from './subscriptions-
|
|
10
|
-
import { d as defaultMethods, n as trimEnd,
|
|
11
|
-
import { m as methods$7 } from './content-
|
|
12
|
-
import { m as methods$8 } from './settings-
|
|
13
|
-
import {
|
|
14
|
-
import { m as methods$
|
|
15
|
-
import { m as methods$
|
|
6
|
+
import { m as methods$3 } from './products-7f2fbc3e.js';
|
|
7
|
+
import { m as methods$4 } from './categories-8f6a4584.js';
|
|
8
|
+
import { m as methods$5 } from './attributes-7a214d6b.js';
|
|
9
|
+
import { m as methods$6 } from './subscriptions-8044a530.js';
|
|
10
|
+
import { d as defaultMethods, n as trimEnd, K as utils, l as trimStart, k as trimBoth, j as toSnake, o as stringifyQuery, E as base64Encode, t as toCamel, e as setOptions } from './index-512fc30d.js';
|
|
11
|
+
import { m as methods$7 } from './content-0afdcb05.js';
|
|
12
|
+
import { m as methods$8 } from './settings-937b96f1.js';
|
|
13
|
+
import { P as PaymentController } from './index-1582746d.js';
|
|
14
|
+
import { m as methods$9 } from './locale-4391bcf3.js';
|
|
15
|
+
import { m as methods$a } from './currency-842f76f2.js';
|
|
16
16
|
|
|
17
17
|
function methods(request) {
|
|
18
18
|
const { get, list } = defaultMethods(request, '/invoices', ['list', 'get']);
|
|
@@ -34,7 +34,7 @@ const options = {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
const api = {
|
|
37
|
-
version: '3.
|
|
37
|
+
version: '3.20.1',
|
|
38
38
|
options,
|
|
39
39
|
request,
|
|
40
40
|
|
|
@@ -54,6 +54,8 @@ const api = {
|
|
|
54
54
|
options.locale = opt.locale;
|
|
55
55
|
options.currency = opt.currency;
|
|
56
56
|
options.api = api;
|
|
57
|
+
options.getCart = opt.getCart;
|
|
58
|
+
options.updateCart = opt.updateCart;
|
|
57
59
|
setOptions(options);
|
|
58
60
|
},
|
|
59
61
|
|
|
@@ -100,11 +102,11 @@ const api = {
|
|
|
100
102
|
|
|
101
103
|
settings: methods$8(request, options),
|
|
102
104
|
|
|
103
|
-
payment:
|
|
105
|
+
payment: new PaymentController(request, options),
|
|
104
106
|
|
|
105
|
-
locale: methods$
|
|
107
|
+
locale: methods$9(request, options),
|
|
106
108
|
|
|
107
|
-
currency: methods$
|
|
109
|
+
currency: methods$a(request, options),
|
|
108
110
|
|
|
109
111
|
utils,
|
|
110
112
|
};
|
package/dist/api.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
export { a as default } from './api-
|
|
2
|
-
import './card-
|
|
3
|
-
import './index-
|
|
1
|
+
export { a as default } from './api-06903a1c.js';
|
|
2
|
+
import './card-91071403.js';
|
|
3
|
+
import './index-512fc30d.js';
|
|
4
4
|
import 'qs';
|
|
5
5
|
import 'deepmerge';
|
|
6
6
|
import 'fast-case';
|
|
7
|
-
import './cookie-
|
|
8
|
-
import './cache-
|
|
9
|
-
import './cart-
|
|
10
|
-
import './products-
|
|
11
|
-
import './attributes-
|
|
7
|
+
import './cookie-b78058af.js';
|
|
8
|
+
import './cache-751d89b1.js';
|
|
9
|
+
import './cart-ff3e3ef6.js';
|
|
10
|
+
import './products-7f2fbc3e.js';
|
|
11
|
+
import './attributes-7a214d6b.js';
|
|
12
12
|
import './account-328cc590.js';
|
|
13
|
-
import './categories-
|
|
14
|
-
import './subscriptions-
|
|
15
|
-
import './content-
|
|
16
|
-
import './settings-
|
|
17
|
-
import './
|
|
18
|
-
import './locale-
|
|
19
|
-
import './currency-
|
|
13
|
+
import './categories-8f6a4584.js';
|
|
14
|
+
import './subscriptions-8044a530.js';
|
|
15
|
+
import './content-0afdcb05.js';
|
|
16
|
+
import './settings-937b96f1.js';
|
|
17
|
+
import './index-1582746d.js';
|
|
18
|
+
import './locale-4391bcf3.js';
|
|
19
|
+
import './currency-842f76f2.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as defaultMethods } from './index-
|
|
2
|
-
import { c as cacheApi } from './cache-
|
|
1
|
+
import { d as defaultMethods } from './index-512fc30d.js';
|
|
2
|
+
import { c as cacheApi } from './cache-751d89b1.js';
|
|
3
3
|
|
|
4
4
|
function methods(request) {
|
|
5
5
|
const { get, list } = defaultMethods(request, '/attributes', ['list', 'get']);
|
package/dist/attributes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { m as default } from './attributes-
|
|
2
|
-
import './index-
|
|
1
|
+
export { m as default } from './attributes-7a214d6b.js';
|
|
2
|
+
import './index-512fc30d.js';
|
|
3
3
|
import 'qs';
|
|
4
4
|
import 'deepmerge';
|
|
5
5
|
import 'fast-case';
|
|
6
|
-
import './cache-
|
|
6
|
+
import './cache-751d89b1.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as set, g as get, m as merge, t as toCamel, i as toCamelPath, h as getOptions } from './index-
|
|
1
|
+
import { s as set, g as get, m as merge, t as toCamel, i as toCamelPath, h as getOptions } from './index-512fc30d.js';
|
|
2
2
|
|
|
3
3
|
const RECORD_TIMEOUT = 5000;
|
|
4
4
|
|
package/dist/cache.js
CHANGED
package/dist/card.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import 'qs';
|
|
2
|
-
import { b as cloneDeep } from './index-
|
|
2
|
+
import { b as cloneDeep } from './index-512fc30d.js';
|
|
3
3
|
import 'deepmerge';
|
|
4
4
|
import 'fast-case';
|
|
5
|
-
import { c as cleanProductOptions } from './products-
|
|
5
|
+
import { c as cleanProductOptions } from './products-7f2fbc3e.js';
|
|
6
6
|
|
|
7
7
|
function methods(request, options) {
|
|
8
8
|
return {
|
|
@@ -44,6 +44,9 @@ function methods(request, options) {
|
|
|
44
44
|
},
|
|
45
45
|
|
|
46
46
|
get() {
|
|
47
|
+
if (options.getCart) {
|
|
48
|
+
return options.getCart();
|
|
49
|
+
}
|
|
47
50
|
let data;
|
|
48
51
|
if (this.cacheClear) {
|
|
49
52
|
this.cacheClear = null;
|
|
@@ -110,6 +113,9 @@ function methods(request, options) {
|
|
|
110
113
|
items: data.items.map(this.getItemData),
|
|
111
114
|
};
|
|
112
115
|
}
|
|
116
|
+
if (options.updateCart) {
|
|
117
|
+
return options.updateCart(input);
|
|
118
|
+
}
|
|
113
119
|
return this.requestStateChange('put', `/cart`, data);
|
|
114
120
|
},
|
|
115
121
|
|
package/dist/cart.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { m as default } from './cart-
|
|
1
|
+
export { m as default } from './cart-ff3e3ef6.js';
|
|
2
2
|
import 'qs';
|
|
3
|
-
import './index-
|
|
3
|
+
import './index-512fc30d.js';
|
|
4
4
|
import 'deepmerge';
|
|
5
5
|
import 'fast-case';
|
|
6
|
-
import './products-
|
|
7
|
-
import './cache-
|
|
8
|
-
import './attributes-
|
|
6
|
+
import './products-7f2fbc3e.js';
|
|
7
|
+
import './cache-751d89b1.js';
|
|
8
|
+
import './attributes-7a214d6b.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as defaultMethods } from './index-
|
|
2
|
-
import { c as cacheApi } from './cache-
|
|
1
|
+
import { d as defaultMethods } from './index-512fc30d.js';
|
|
2
|
+
import { c as cacheApi } from './cache-751d89b1.js';
|
|
3
3
|
|
|
4
4
|
function methods(request) {
|
|
5
5
|
const { get, list } = defaultMethods(request, '/categories', ['list', 'get']);
|
package/dist/categories.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { m as default } from './categories-
|
|
2
|
-
import './index-
|
|
1
|
+
export { m as default } from './categories-8f6a4584.js';
|
|
2
|
+
import './index-512fc30d.js';
|
|
3
3
|
import 'qs';
|
|
4
4
|
import 'deepmerge';
|
|
5
5
|
import 'fast-case';
|
|
6
|
-
import './cache-
|
|
6
|
+
import './cache-751d89b1.js';
|
package/dist/content.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { m as default } from './content-
|
|
2
|
-
import './cache-
|
|
3
|
-
import './index-
|
|
1
|
+
export { m as default } from './content-0afdcb05.js';
|
|
2
|
+
import './cache-751d89b1.js';
|
|
3
|
+
import './index-512fc30d.js';
|
|
4
4
|
import 'qs';
|
|
5
5
|
import 'deepmerge';
|
|
6
6
|
import 'fast-case';
|
package/dist/cookie.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import 'qs';
|
|
2
|
-
import { f as find, g as get, r as round } from './index-
|
|
2
|
+
import { f as find, g as get, r as round } from './index-512fc30d.js';
|
|
3
3
|
import 'deepmerge';
|
|
4
4
|
import 'fast-case';
|
|
5
|
-
import { g as getCookie, s as setCookie } from './cookie-
|
|
5
|
+
import { g as getCookie, s as setCookie } from './cookie-b78058af.js';
|
|
6
6
|
|
|
7
7
|
const FORMATTERS = {};
|
|
8
8
|
|
package/dist/currency.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { m as default } from './currency-
|
|
1
|
+
export { m as default } from './currency-842f76f2.js';
|
|
2
2
|
import 'qs';
|
|
3
|
-
import './index-
|
|
3
|
+
import './index-512fc30d.js';
|
|
4
4
|
import 'deepmerge';
|
|
5
5
|
import 'fast-case';
|
|
6
|
-
import './cookie-
|
|
6
|
+
import './cookie-b78058af.js';
|