@kiva/kv-shop 3.3.39 → 3.4.0
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.js +30 -8
- package/dist/index.d.ts +43 -0
- package/dist/index.js +42 -40
- package/package.json +2 -2
package/dist/basketItems.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { gql as r } from "@apollo/client/core";
|
|
2
|
-
import
|
|
3
|
-
import { callShopMutation as
|
|
4
|
-
async function
|
|
5
|
-
var
|
|
6
|
-
const
|
|
2
|
+
import s from "numeral";
|
|
3
|
+
import { callShopMutation as d } from "./shopQueries.js";
|
|
4
|
+
async function k({ amount: t, apollo: o, metadata: e }) {
|
|
5
|
+
var n;
|
|
6
|
+
const i = s(t).format("0.00"), a = await d(o, {
|
|
7
7
|
awaitRefetchQueries: !0,
|
|
8
8
|
mutation: r`mutation setTipDonation($price: Money!, $basketId: String, $metadata: String) {
|
|
9
9
|
shop (basketId: $basketId) {
|
|
@@ -25,10 +25,32 @@ async function u({ amount: i, apollo: e, metadata: o }) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
}`,
|
|
28
|
-
variables: { price:
|
|
28
|
+
variables: { price: i, metadata: e }
|
|
29
|
+
});
|
|
30
|
+
return (n = a == null ? void 0 : a.shop) == null ? void 0 : n.updateDonation;
|
|
31
|
+
}
|
|
32
|
+
var p = /* @__PURE__ */ ((t) => (t.Email = "email", t.Lender = "lender", t.Postal = "postal", t.Print = "print", t))(p || {});
|
|
33
|
+
async function f({ kivaCard: t, apollo: o }) {
|
|
34
|
+
var a;
|
|
35
|
+
const e = s(t.giftAmount).format("0.00"), i = await d(o, {
|
|
36
|
+
awaitRefetchQueries: !0,
|
|
37
|
+
mutation: r`mutation AddKivaCardToBasket($kivaCard: KivaCardInput!, $basketId: String) {
|
|
38
|
+
shop (basketId: $basketId) {
|
|
39
|
+
id
|
|
40
|
+
addKivaCardToBasket(kivaCard: $kivaCard)
|
|
41
|
+
}
|
|
42
|
+
}`,
|
|
43
|
+
variables: {
|
|
44
|
+
kivaCard: {
|
|
45
|
+
...t,
|
|
46
|
+
giftAmount: e
|
|
47
|
+
}
|
|
48
|
+
}
|
|
29
49
|
});
|
|
30
|
-
return (a =
|
|
50
|
+
return ((a = i == null ? void 0 : i.shop) == null ? void 0 : a.addKivaCardToBasket) ?? !1;
|
|
31
51
|
}
|
|
32
52
|
export {
|
|
33
|
-
|
|
53
|
+
p as KivaCardDeliveryTypeEnum,
|
|
54
|
+
f as addKivaCardToBasket,
|
|
55
|
+
k as setTipDonation
|
|
34
56
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,20 @@ export declare interface AddGivingFundOptions {
|
|
|
26
26
|
fundTarget: string;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
export declare function addKivaCardToBasket({ kivaCard, apollo }: AddKivaCardToBasketOptions): Promise<boolean>;
|
|
30
|
+
|
|
31
|
+
export declare interface AddKivaCardToBasketData {
|
|
32
|
+
shop: {
|
|
33
|
+
id: string;
|
|
34
|
+
addKivaCardToBasket: boolean | null;
|
|
35
|
+
} | null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare interface AddKivaCardToBasketOptions {
|
|
39
|
+
kivaCard: KivaCardInput;
|
|
40
|
+
apollo: ApolloClient<any>;
|
|
41
|
+
}
|
|
42
|
+
|
|
29
43
|
export declare function applyKivaCredit(apollo: ApolloClient<any>): Promise<boolean>;
|
|
30
44
|
|
|
31
45
|
export declare interface ApplyKivaCreditData {
|
|
@@ -141,6 +155,35 @@ export declare function hasBasketExpired(error: any): boolean;
|
|
|
141
155
|
|
|
142
156
|
export declare function isBasketVerified(state: VerificationState): boolean;
|
|
143
157
|
|
|
158
|
+
export declare enum KivaCardDeliveryTypeEnum {
|
|
159
|
+
Email = "email",
|
|
160
|
+
Lender = "lender",
|
|
161
|
+
Postal = "postal",
|
|
162
|
+
Print = "print"
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare interface KivaCardInput {
|
|
166
|
+
deliveryType: KivaCardDeliveryTypeEnum;
|
|
167
|
+
giftAmount: string | number;
|
|
168
|
+
message?: string | null;
|
|
169
|
+
recipient: KivaCardRecipientInput;
|
|
170
|
+
senderEmail?: string | null;
|
|
171
|
+
senderName?: string | null;
|
|
172
|
+
giftsPerRecipient?: number | null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export declare interface KivaCardRecipientInput {
|
|
176
|
+
email?: string;
|
|
177
|
+
name?: string;
|
|
178
|
+
address?: string;
|
|
179
|
+
city?: string;
|
|
180
|
+
state?: string;
|
|
181
|
+
postalCode?: string;
|
|
182
|
+
country?: string;
|
|
183
|
+
lenderId?: string | number;
|
|
184
|
+
scheduledDeliveryDate?: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
144
187
|
export { KvPaymentSelect }
|
|
145
188
|
|
|
146
189
|
export declare interface OneTimeCheckoutForGivingFundOptions {
|
package/dist/index.js
CHANGED
|
@@ -1,55 +1,57 @@
|
|
|
1
1
|
import { createBasket as o, getBasketID as r, hasBasketExpired as a, setBasketID as i } from "./basket.js";
|
|
2
2
|
import { applyKivaCredit as u, applyPromoCredit as m, removeKivaCredit as s, removePromoCredit as c } from "./basketCredits.js";
|
|
3
|
-
import {
|
|
4
|
-
import { basketTotalsQuery as
|
|
5
|
-
import { VerificationState as
|
|
6
|
-
import { getCheckoutStatus as
|
|
7
|
-
import { addGivingFund as
|
|
8
|
-
import { getPromoFromBasket as
|
|
3
|
+
import { KivaCardDeliveryTypeEnum as d, addKivaCardToBasket as f, setTipDonation as k } from "./basketItems.js";
|
|
4
|
+
import { basketTotalsQuery as l, watchBasketTotals as h } from "./basketTotals.js";
|
|
5
|
+
import { VerificationState as v, isBasketVerified as g } from "./basketVerification.js";
|
|
6
|
+
import { getCheckoutStatus as T, pollForFinishedCheckout as y } from "./checkoutStatus.js";
|
|
7
|
+
import { addGivingFund as F, addGivingFundMutation as D } from "./givingFunds.js";
|
|
8
|
+
import { getPromoFromBasket as K } from "./managedAccount.js";
|
|
9
9
|
import { executeOneTimeCheckout as I, executeOneTimeCheckoutForGivingFund as b } from "./oneTimeCheckout.js";
|
|
10
|
-
import { getCheckoutTrackingData as
|
|
11
|
-
import { ShopError as
|
|
12
|
-
import { callShopMutation as
|
|
13
|
-
import { checkSubscriptionStatus as
|
|
14
|
-
import { defaultPaymentTypes as
|
|
15
|
-
import { validatePreCheckout as
|
|
16
|
-
import { default as
|
|
10
|
+
import { getCheckoutTrackingData as G, getFTDStatus as M, getReceiptItems as Q, getReceiptTotals as O } from "./receipt.js";
|
|
11
|
+
import { ShopError as V, parseShopError as N } from "./shopError.js";
|
|
12
|
+
import { callShopMutation as q, callShopQuery as z, watchShopQuery as A } from "./shopQueries.js";
|
|
13
|
+
import { checkSubscriptionStatus as J, executeNewSubscriptionCheckout as L } from "./subscriptionCheckout.js";
|
|
14
|
+
import { defaultPaymentTypes as W, getClientToken as X, default as Y } from "./useBraintreeDropIn.js";
|
|
15
|
+
import { validatePreCheckout as _, validatePreCheckoutMutation as $ } from "./validatePreCheckout.js";
|
|
16
|
+
import { default as te } from "./components/KvPaymentSelect.js";
|
|
17
17
|
export {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
d as KivaCardDeliveryTypeEnum,
|
|
19
|
+
te as KvPaymentSelect,
|
|
20
|
+
V as ShopError,
|
|
21
|
+
v as VerificationState,
|
|
22
|
+
F as addGivingFund,
|
|
23
|
+
D as addGivingFundMutation,
|
|
24
|
+
f as addKivaCardToBasket,
|
|
23
25
|
u as applyKivaCredit,
|
|
24
26
|
m as applyPromoCredit,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
l as basketTotalsQuery,
|
|
28
|
+
q as callShopMutation,
|
|
29
|
+
z as callShopQuery,
|
|
30
|
+
J as checkSubscriptionStatus,
|
|
29
31
|
o as createBasket,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
+
W as defaultPaymentTypes,
|
|
33
|
+
L as executeNewSubscriptionCheckout,
|
|
32
34
|
I as executeOneTimeCheckout,
|
|
33
35
|
b as executeOneTimeCheckoutForGivingFund,
|
|
34
36
|
r as getBasketID,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
T as getCheckoutStatus,
|
|
38
|
+
G as getCheckoutTrackingData,
|
|
39
|
+
X as getClientToken,
|
|
40
|
+
M as getFTDStatus,
|
|
41
|
+
K as getPromoFromBasket,
|
|
42
|
+
Q as getReceiptItems,
|
|
43
|
+
O as getReceiptTotals,
|
|
42
44
|
a as hasBasketExpired,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
g as isBasketVerified,
|
|
46
|
+
N as parseShopError,
|
|
47
|
+
y as pollForFinishedCheckout,
|
|
46
48
|
s as removeKivaCredit,
|
|
47
49
|
c as removePromoCredit,
|
|
48
50
|
i as setBasketID,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
k as setTipDonation,
|
|
52
|
+
Y as useBraintreeDropIn,
|
|
53
|
+
_ as validatePreCheckout,
|
|
54
|
+
$ as validatePreCheckoutMutation,
|
|
55
|
+
h as watchBasketTotals,
|
|
56
|
+
A as watchShopQuery
|
|
55
57
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-shop",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"numeral": "2.x",
|
|
56
56
|
"vue": "3.x"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "7f8839370744768a45f8ba3dd679380dd09a421b"
|
|
59
59
|
}
|