@kiva/kv-shop 1.1.4 → 1.1.6
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/basketItems.cjs +3 -3
- package/dist/basketItems.js +1 -1
- package/dist/{chunk-KSEC5YWO.js → chunk-AEAZBR36.js} +3 -3
- package/dist/{chunk-R27YZQKP.js → chunk-HWDTIIXN.js} +2 -2
- package/dist/{chunk-V2I7V4QJ.js → chunk-LWEH4UKM.js} +3 -3
- package/dist/index.cjs +8 -8
- package/dist/index.js +3 -3
- package/dist/subscriptionCheckout.cjs +3 -3
- package/dist/subscriptionCheckout.js +1 -1
- package/dist/useBraintreeDropIn.cjs +2 -2
- package/dist/useBraintreeDropIn.js +1 -1
- package/package.json +3 -3
package/dist/basketItems.cjs
CHANGED
|
@@ -97,10 +97,10 @@ async function setTipDonation({ amount, apollo }) {
|
|
|
97
97
|
basketId: getBasketID()
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
|
-
if (result
|
|
101
|
-
error = result
|
|
100
|
+
if (result?.error || result?.errors?.length) {
|
|
101
|
+
error = result?.error ?? result?.errors?.[0];
|
|
102
102
|
} else {
|
|
103
|
-
data = result
|
|
103
|
+
data = result?.data;
|
|
104
104
|
}
|
|
105
105
|
} catch (e) {
|
|
106
106
|
error = e;
|
package/dist/basketItems.js
CHANGED
|
@@ -32,10 +32,10 @@ async function setTipDonation({ amount, apollo }) {
|
|
|
32
32
|
basketId: getBasketID()
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
if (result
|
|
36
|
-
error = result
|
|
35
|
+
if (result?.error || result?.errors?.length) {
|
|
36
|
+
error = result?.error ?? result?.errors?.[0];
|
|
37
37
|
} else {
|
|
38
|
-
data = result
|
|
38
|
+
data = result?.data;
|
|
39
39
|
}
|
|
40
40
|
} catch (e) {
|
|
41
41
|
error = e;
|
|
@@ -17,8 +17,8 @@ async function getClientToken(apollo) {
|
|
|
17
17
|
}
|
|
18
18
|
}`
|
|
19
19
|
});
|
|
20
|
-
if (error || errors
|
|
21
|
-
throw parseShopError(error ?? errors[0]);
|
|
20
|
+
if (error || errors?.length) {
|
|
21
|
+
throw parseShopError(error ?? errors?.[0]);
|
|
22
22
|
}
|
|
23
23
|
return data?.shop?.getClientToken;
|
|
24
24
|
}
|
|
@@ -77,10 +77,10 @@ async function executeNewSubscriptionCheckout({
|
|
|
77
77
|
}
|
|
78
78
|
}`
|
|
79
79
|
});
|
|
80
|
-
if (result
|
|
81
|
-
error = result
|
|
80
|
+
if (result?.error || result?.errors?.length) {
|
|
81
|
+
error = result?.error ?? result?.errors?.[0];
|
|
82
82
|
} else {
|
|
83
|
-
data = result
|
|
83
|
+
data = result?.data;
|
|
84
84
|
}
|
|
85
85
|
} catch (e) {
|
|
86
86
|
error = e;
|
package/dist/index.cjs
CHANGED
|
@@ -113,10 +113,10 @@ async function setTipDonation({ amount, apollo }) {
|
|
|
113
113
|
basketId: getBasketID()
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
|
-
if (result
|
|
117
|
-
error = result
|
|
116
|
+
if (result?.error || result?.errors?.length) {
|
|
117
|
+
error = result?.error ?? result?.errors?.[0];
|
|
118
118
|
} else {
|
|
119
|
-
data = result
|
|
119
|
+
data = result?.data;
|
|
120
120
|
}
|
|
121
121
|
} catch (e) {
|
|
122
122
|
error = e;
|
|
@@ -223,10 +223,10 @@ async function executeNewSubscriptionCheckout({
|
|
|
223
223
|
}
|
|
224
224
|
}`
|
|
225
225
|
});
|
|
226
|
-
if (result
|
|
227
|
-
error = result
|
|
226
|
+
if (result?.error || result?.errors?.length) {
|
|
227
|
+
error = result?.error ?? result?.errors?.[0];
|
|
228
228
|
} else {
|
|
229
|
-
data = result
|
|
229
|
+
data = result?.data;
|
|
230
230
|
}
|
|
231
231
|
} catch (e) {
|
|
232
232
|
error = e;
|
|
@@ -258,8 +258,8 @@ async function getClientToken(apollo) {
|
|
|
258
258
|
}
|
|
259
259
|
}`
|
|
260
260
|
});
|
|
261
|
-
if (error || errors
|
|
262
|
-
throw parseShopError(error ?? errors[0]);
|
|
261
|
+
if (error || errors?.length) {
|
|
262
|
+
throw parseShopError(error ?? errors?.[0]);
|
|
263
263
|
}
|
|
264
264
|
return data?.shop?.getClientToken;
|
|
265
265
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setTipDonation
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AEAZBR36.js";
|
|
4
4
|
import {
|
|
5
5
|
getBasketID,
|
|
6
6
|
getCookieValue,
|
|
@@ -13,12 +13,12 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
checkSubscriptionStatus,
|
|
15
15
|
executeNewSubscriptionCheckout
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LWEH4UKM.js";
|
|
17
17
|
import {
|
|
18
18
|
defaultPaymentTypes,
|
|
19
19
|
getClientToken,
|
|
20
20
|
useBraintreeDropIn
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-HWDTIIXN.js";
|
|
22
22
|
import {
|
|
23
23
|
ShopError,
|
|
24
24
|
parseShopError
|
|
@@ -125,10 +125,10 @@ async function executeNewSubscriptionCheckout({
|
|
|
125
125
|
}
|
|
126
126
|
}`
|
|
127
127
|
});
|
|
128
|
-
if (result
|
|
129
|
-
error = result
|
|
128
|
+
if (result?.error || result?.errors?.length) {
|
|
129
|
+
error = result?.error ?? result?.errors?.[0];
|
|
130
130
|
} else {
|
|
131
|
-
data = result
|
|
131
|
+
data = result?.data;
|
|
132
132
|
}
|
|
133
133
|
} catch (e) {
|
|
134
134
|
error = e;
|
|
@@ -76,8 +76,8 @@ async function getClientToken(apollo) {
|
|
|
76
76
|
}
|
|
77
77
|
}`
|
|
78
78
|
});
|
|
79
|
-
if (error || errors
|
|
80
|
-
throw parseShopError(error ?? errors[0]);
|
|
79
|
+
if (error || errors?.length) {
|
|
80
|
+
throw parseShopError(error ?? errors?.[0]);
|
|
81
81
|
}
|
|
82
82
|
return data?.shop?.getClientToken;
|
|
83
83
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-shop",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@apollo/client": "^3.7.14",
|
|
41
|
-
"@kiva/kv-components": "^3.
|
|
41
|
+
"@kiva/kv-components": "^3.22.1",
|
|
42
42
|
"@types/braintree-web-drop-in": "^1.34.2",
|
|
43
43
|
"braintree-web-drop-in": "^1.37.0",
|
|
44
44
|
"numeral": "^2.0.6",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"optional": true
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "e7c14947aa5b7a856c23671ec38d9c8312f13324"
|
|
57
57
|
}
|