@kiva/kv-shop 2.1.2 → 3.0.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/_virtual/_commonjs-dynamic-modules.js +6 -0
- package/dist/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/_virtual/dropin.js +11 -0
- package/dist/_virtual/dropin2.js +4 -0
- package/dist/basket.js +35 -12
- package/dist/basketCredits.js +78 -14
- package/dist/basketItems.js +27 -8
- package/dist/basketTotals.js +38 -10
- package/dist/basketVerification.js +6 -6
- package/dist/checkoutStatus.js +52 -8
- package/dist/components/KvPaymentSelect.css +1 -0
- package/dist/components/KvPaymentSelect.js +23 -0
- package/dist/components/KvPaymentSelect2.js +110 -0
- package/dist/index.d.ts +321 -20
- package/dist/index.js +49 -96
- package/dist/managedAccount.js +62 -8
- package/dist/oneTimeCheckout.js +156 -12
- package/dist/receipt.js +143 -12
- package/dist/shopError.js +41 -6
- package/dist/shopQueries.js +82 -11
- package/dist/subscriptionCheckout.js +88 -7
- package/dist/useBraintreeDropIn.js +145 -9
- package/dist/util/cookie.js +11 -0
- package/dist/util/poll.js +17 -0
- package/dist/util/redirect.js +8 -0
- package/dist/util/visitorId.js +7 -0
- package/dist/validatePreCheckout.js +44 -11
- package/dist/vendor/braintree-web-drop-in/dist/browser/dropin.js +12223 -0
- package/package.json +28 -26
- package/dist/basket.cjs +0 -141
- package/dist/basket.d.ts +0 -8
- package/dist/basketCredits.cjs +0 -250
- package/dist/basketCredits.d.ts +0 -32
- package/dist/basketItems.cjs +0 -205
- package/dist/basketItems.d.ts +0 -26
- package/dist/basketTotals.cjs +0 -228
- package/dist/basketTotals.d.ts +0 -37
- package/dist/basketVerification.cjs +0 -41
- package/dist/basketVerification.d.ts +0 -10
- package/dist/checkoutStatus.cjs +0 -111
- package/dist/checkoutStatus.d.ts +0 -20
- package/dist/chunk-4ODZGLWK.js +0 -64
- package/dist/chunk-ASZJVUQ7.js +0 -72
- package/dist/chunk-FBF4WMN6.js +0 -49
- package/dist/chunk-FC4QW6QA.js +0 -106
- package/dist/chunk-FCAOCO7O.js +0 -17
- package/dist/chunk-GVVI7X2R.js +0 -196
- package/dist/chunk-IIN37LC7.js +0 -45
- package/dist/chunk-IOZ5ERDX.js +0 -121
- package/dist/chunk-KCUOMCSN.js +0 -58
- package/dist/chunk-LZ4UMRCV.js +0 -16
- package/dist/chunk-RQNRQ2E5.js +0 -155
- package/dist/chunk-SRGYGDAX.js +0 -80
- package/dist/chunk-TPJPGUO7.js +0 -12
- package/dist/chunk-UJXHTR43.js +0 -86
- package/dist/chunk-VZ3VDRRP.js +0 -167
- package/dist/chunk-Z7JRY3QE.js +0 -34
- package/dist/components/KvPaymentSelect.vue +0 -380
- package/dist/index.cjs +0 -1227
- package/dist/managedAccount.cjs +0 -231
- package/dist/managedAccount.d.ts +0 -59
- package/dist/oneTimeCheckout.cjs +0 -636
- package/dist/oneTimeCheckout.d.ts +0 -21
- package/dist/receipt.cjs +0 -191
- package/dist/receipt.d.ts +0 -16
- package/dist/shopError.cjs +0 -88
- package/dist/shopError.d.ts +0 -14
- package/dist/shopQueries.cjs +0 -248
- package/dist/shopQueries.d.ts +0 -8
- package/dist/subscriptionCheckout.cjs +0 -187
- package/dist/subscriptionCheckout.d.ts +0 -13
- package/dist/useBraintreeDropIn.cjs +0 -258
- package/dist/useBraintreeDropIn.d.ts +0 -25
- package/dist/validatePreCheckout.cjs +0 -218
- package/dist/validatePreCheckout.d.ts +0 -28
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,321 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { ApolloClient } from '@apollo/client';
|
|
2
|
+
import { DocumentNode } from '@apollo/client';
|
|
3
|
+
import { Dropin } from 'braintree-web-drop-in';
|
|
4
|
+
import { default as KvPaymentSelect } from './components/KvPaymentSelect.js';
|
|
5
|
+
import { MutationOptions } from '@apollo/client';
|
|
6
|
+
import { ObservableQuery } from '@apollo/client';
|
|
7
|
+
import { PaymentMethodPayload } from 'braintree-web-drop-in';
|
|
8
|
+
import { QueryOptions } from '@apollo/client';
|
|
9
|
+
import { Ref } from 'vue';
|
|
10
|
+
import { TransactionData } from '@kiva/kv-analytics';
|
|
11
|
+
import { WatchQueryOptions } from '@apollo/client';
|
|
12
|
+
|
|
13
|
+
export declare function applyKivaCredit(apollo: ApolloClient<any>): Promise<boolean>;
|
|
14
|
+
|
|
15
|
+
export declare interface ApplyKivaCreditData {
|
|
16
|
+
shop: {
|
|
17
|
+
id: string;
|
|
18
|
+
addCreditByType: boolean;
|
|
19
|
+
} | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare function applyPromoCredit(apollo: ApolloClient<any>, options: MutationOptions<any>): Promise<any>;
|
|
23
|
+
|
|
24
|
+
export declare interface ApplyPromoCreditData {
|
|
25
|
+
shop: {
|
|
26
|
+
id: string;
|
|
27
|
+
addCreditByType: boolean;
|
|
28
|
+
} | null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare interface BasketTotalsData {
|
|
32
|
+
shop: {
|
|
33
|
+
id: string;
|
|
34
|
+
basket: {
|
|
35
|
+
id: string;
|
|
36
|
+
totals: {
|
|
37
|
+
bonusAppliedTotal: string;
|
|
38
|
+
bonusAvailableTotal: string;
|
|
39
|
+
creditAmountNeeded: string;
|
|
40
|
+
creditAppliedTotal: string;
|
|
41
|
+
creditAvailableTotal: string;
|
|
42
|
+
donationTotal: string;
|
|
43
|
+
itemTotal: string;
|
|
44
|
+
freeTrialAppliedTotal: string;
|
|
45
|
+
freeTrialAvailableTotal: string;
|
|
46
|
+
loanReservationTotal: string;
|
|
47
|
+
kivaCardTotal: string;
|
|
48
|
+
kivaCreditAppliedTotal: string;
|
|
49
|
+
kivaCreditAvailableTotal: string;
|
|
50
|
+
kivaCreditRemaining: string;
|
|
51
|
+
kivaCreditToReapply: string;
|
|
52
|
+
redemptionCodeAppliedTotal: string;
|
|
53
|
+
redemptionCodeAvailableTotal: string;
|
|
54
|
+
universalCodeAppliedTotal: string;
|
|
55
|
+
universalCodeAvailableTotal: string;
|
|
56
|
+
} | null;
|
|
57
|
+
} | null;
|
|
58
|
+
} | null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export declare const basketTotalsQuery: DocumentNode;
|
|
62
|
+
|
|
63
|
+
export declare function callShopMutation<TData>(apollo: ApolloClient<any>, options: MutationOptions<TData, any>, maxretries?: number): Promise<TData>;
|
|
64
|
+
|
|
65
|
+
export declare function callShopQuery<TData>(apollo: ApolloClient<any>, options: QueryOptions<any, TData>, maxretries?: number): Promise<TData>;
|
|
66
|
+
|
|
67
|
+
export declare interface CheckoutStatusQueryResult {
|
|
68
|
+
data: {
|
|
69
|
+
checkoutStatus: any;
|
|
70
|
+
} | null;
|
|
71
|
+
errors?: any;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export declare function checkSubscriptionStatus(apollo: any): Promise<boolean>;
|
|
75
|
+
|
|
76
|
+
export declare function createBasket(apollo: ApolloClient<any>): Promise<any>;
|
|
77
|
+
|
|
78
|
+
export declare const defaultPaymentTypes: readonly ["paypal", "card", "applePay", "googlePay"];
|
|
79
|
+
|
|
80
|
+
export declare interface DropInInitOptions {
|
|
81
|
+
amount: string | number;
|
|
82
|
+
authToken: string;
|
|
83
|
+
container: string | HTMLElement;
|
|
84
|
+
googlePayMerchantId: string;
|
|
85
|
+
paymentTypes?: PaymentType[];
|
|
86
|
+
preselectVaultedPaymentMethod?: boolean;
|
|
87
|
+
paypalFlow?: PayPalFlowType;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export declare interface DropInWrapper {
|
|
91
|
+
initDropIn: (options: DropInInitOptions) => Promise<Dropin>;
|
|
92
|
+
paymentMethodRequestable: Ref<boolean>;
|
|
93
|
+
requestPaymentMethod: () => Promise<PaymentMethodPayload | void>;
|
|
94
|
+
updateAmount: (amount: string | number) => void;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export declare function executeNewSubscriptionCheckout({ amount, apollo, dayOfMonth, donateAmount, paymentMethod, }: SubscriptionCheckoutOptions): Promise<any>;
|
|
98
|
+
|
|
99
|
+
export declare function executeOneTimeCheckout({ apollo, braintree, emailAddress, emailOptIn, valetInviter, deactivateRedirect, }: OneTimeCheckoutOptions): Promise<CheckoutStatusQueryResult>;
|
|
100
|
+
|
|
101
|
+
export declare function getBasketID(): string;
|
|
102
|
+
|
|
103
|
+
export declare function getCheckoutStatus({ apollo, transactionSagaId }: GetCheckoutStatusOptions): Promise<CheckoutStatusQueryResult>;
|
|
104
|
+
|
|
105
|
+
export declare interface GetCheckoutStatusOptions {
|
|
106
|
+
apollo: ApolloClient<any>;
|
|
107
|
+
transactionSagaId: string;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export declare function getCheckoutTrackingData(apollo: ApolloClient<any>, checkoutId: string, paymentType: string): Promise<TransactionData>;
|
|
111
|
+
|
|
112
|
+
export declare function getClientToken(apollo: any): Promise<any>;
|
|
113
|
+
|
|
114
|
+
export declare function getFTDStatus(apollo: ApolloClient<any>): Promise<any>;
|
|
115
|
+
|
|
116
|
+
export declare function getPromoFromBasket(apollo: ApolloClient<any>, options: QueryOptions<any>): Promise<ShopPromoCampaignData | ShopPromoCampaignError | null>;
|
|
117
|
+
|
|
118
|
+
export declare function getReceiptItems(apollo: ApolloClient<any>, checkoutId: number): Promise<ReceiptItem[]>;
|
|
119
|
+
|
|
120
|
+
export declare function getReceiptTotals(apollo: ApolloClient<any>, checkoutId: number): Promise<any>;
|
|
121
|
+
|
|
122
|
+
export declare function hasBasketExpired(error: any): boolean;
|
|
123
|
+
|
|
124
|
+
export declare function isBasketVerified(state: VerificationState): boolean;
|
|
125
|
+
|
|
126
|
+
export { KvPaymentSelect }
|
|
127
|
+
|
|
128
|
+
export declare interface OneTimeCheckoutOptions {
|
|
129
|
+
apollo: ApolloClient<any>;
|
|
130
|
+
braintree?: DropInWrapper;
|
|
131
|
+
emailAddress?: string;
|
|
132
|
+
emailOptIn?: boolean;
|
|
133
|
+
valetInviter?: ValetInviter;
|
|
134
|
+
deactivateRedirect?: boolean;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export declare function parseShopError(error: any): ShopError;
|
|
138
|
+
|
|
139
|
+
export declare type PaymentType = 'card' | 'paypal' | 'paypalCredit' | 'venmo' | 'applePay' | 'googlePay';
|
|
140
|
+
|
|
141
|
+
export declare type PayPalFlowType = 'checkout' | 'vault';
|
|
142
|
+
|
|
143
|
+
export declare interface PollForCheckoutStatusOptions extends GetCheckoutStatusOptions {
|
|
144
|
+
interval?: number;
|
|
145
|
+
timeout?: number;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export declare function pollForFinishedCheckout({ apollo, transactionSagaId, interval, timeout, }: PollForCheckoutStatusOptions): Promise<CheckoutStatusQueryResult>;
|
|
149
|
+
|
|
150
|
+
declare interface ReceiptItem {
|
|
151
|
+
id: string;
|
|
152
|
+
price: string;
|
|
153
|
+
__typename: string;
|
|
154
|
+
isTip?: boolean;
|
|
155
|
+
isUserEdited?: boolean;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export declare function removeKivaCredit(apollo: ApolloClient<any>): Promise<boolean>;
|
|
159
|
+
|
|
160
|
+
export declare interface RemoveKivaCreditData {
|
|
161
|
+
shop: {
|
|
162
|
+
id: string;
|
|
163
|
+
removeCreditByType: boolean;
|
|
164
|
+
} | null;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export declare function removePromoCredit(apollo: ApolloClient<any>, options: MutationOptions<any>): Promise<boolean>;
|
|
168
|
+
|
|
169
|
+
export declare interface RemovePromoCreditData {
|
|
170
|
+
shop: {
|
|
171
|
+
id: string;
|
|
172
|
+
removeCreditByType: boolean;
|
|
173
|
+
} | null;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export declare function setBasketID(basketId: any): void;
|
|
177
|
+
|
|
178
|
+
export declare function setTipDonation({ amount, apollo, metadata }: SetTipDonationOptions): Promise<{
|
|
179
|
+
id: string;
|
|
180
|
+
price: string;
|
|
181
|
+
isTip: boolean;
|
|
182
|
+
metadata: string | null;
|
|
183
|
+
}>;
|
|
184
|
+
|
|
185
|
+
export declare interface SetTipDonationData {
|
|
186
|
+
shop: {
|
|
187
|
+
id: string;
|
|
188
|
+
updateDonation: {
|
|
189
|
+
id: string;
|
|
190
|
+
price: string;
|
|
191
|
+
isTip: boolean;
|
|
192
|
+
metadata: string | null;
|
|
193
|
+
} | null;
|
|
194
|
+
} | null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export declare interface SetTipDonationOptions {
|
|
198
|
+
amount: string | number;
|
|
199
|
+
metadata?: string | null;
|
|
200
|
+
apollo: ApolloClient<any>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export declare class ShopError extends Error {
|
|
204
|
+
code: string;
|
|
205
|
+
original?: object;
|
|
206
|
+
errors?: Array<ShopError>;
|
|
207
|
+
constructor({ code, original }: ShopErrorOptions, ...params: any[]);
|
|
208
|
+
aggregateErrors(errors: Array<ShopError>): void;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export declare interface ShopErrorOptions {
|
|
212
|
+
code: string;
|
|
213
|
+
original?: object;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export declare interface ShopPromoCampaignData {
|
|
217
|
+
shop?: {
|
|
218
|
+
id: string;
|
|
219
|
+
promoCampaign?: {
|
|
220
|
+
promoFund?: {
|
|
221
|
+
id: number;
|
|
222
|
+
displayName: string;
|
|
223
|
+
displayDescription: string;
|
|
224
|
+
promoPrice: string;
|
|
225
|
+
};
|
|
226
|
+
promoGroup?: {
|
|
227
|
+
id: number;
|
|
228
|
+
type: string;
|
|
229
|
+
teamId: number;
|
|
230
|
+
};
|
|
231
|
+
managedAccount?: {
|
|
232
|
+
managementType: string;
|
|
233
|
+
audience: string;
|
|
234
|
+
allowDonations: string;
|
|
235
|
+
sendKivaNewsletter: string;
|
|
236
|
+
id: number;
|
|
237
|
+
isEmployee: boolean;
|
|
238
|
+
formId: string;
|
|
239
|
+
pageId: string;
|
|
240
|
+
loanSearchCriteria: {
|
|
241
|
+
filters: {
|
|
242
|
+
cityState: [string];
|
|
243
|
+
country: [string];
|
|
244
|
+
currencyLossPossible: boolean;
|
|
245
|
+
dafEligible: boolean;
|
|
246
|
+
distributionModel: any | string;
|
|
247
|
+
excludeNonRated: boolean;
|
|
248
|
+
expiringSoon: boolean;
|
|
249
|
+
gender: any | string;
|
|
250
|
+
hasResearchScore: boolean;
|
|
251
|
+
isGroup: boolean;
|
|
252
|
+
lenderFavorite: number;
|
|
253
|
+
loanLimit: number;
|
|
254
|
+
loanTags: [number];
|
|
255
|
+
isMatched: boolean;
|
|
256
|
+
sector: [number];
|
|
257
|
+
status: any | string;
|
|
258
|
+
theme: [string];
|
|
259
|
+
};
|
|
260
|
+
sortBy: any | string | null;
|
|
261
|
+
} | any | null;
|
|
262
|
+
} | any | null;
|
|
263
|
+
} | any | null;
|
|
264
|
+
} | null;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export declare interface ShopPromoCampaignError {
|
|
268
|
+
shop?: any;
|
|
269
|
+
error?: string | null;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
export declare interface SubscriptionCheckoutOptions {
|
|
273
|
+
amount: string;
|
|
274
|
+
apollo: any;
|
|
275
|
+
dayOfMonth?: number;
|
|
276
|
+
donateAmount: string;
|
|
277
|
+
paymentMethod: PaymentMethodPayload;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export declare function useBraintreeDropIn(key?: string): DropInWrapper;
|
|
281
|
+
|
|
282
|
+
export declare type ValetInviter = {
|
|
283
|
+
inviterId: string;
|
|
284
|
+
invitationUrl: string;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
export declare function validatePreCheckout({ apollo, emailAddress, emailOptIn, valetInviter, }: ValidatePreCheckoutOptions): Promise<void>;
|
|
288
|
+
|
|
289
|
+
export declare interface ValidatePreCheckoutData {
|
|
290
|
+
shop: {
|
|
291
|
+
id: string;
|
|
292
|
+
validatePreCheckout: Array<{
|
|
293
|
+
error: string;
|
|
294
|
+
success: boolean;
|
|
295
|
+
value: string;
|
|
296
|
+
}>;
|
|
297
|
+
} | null;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export declare const validatePreCheckoutMutation: DocumentNode;
|
|
301
|
+
|
|
302
|
+
export declare interface ValidatePreCheckoutOptions {
|
|
303
|
+
apollo: ApolloClient<any>;
|
|
304
|
+
emailAddress?: string;
|
|
305
|
+
emailOptIn?: boolean;
|
|
306
|
+
valetInviter?: ValetInviter;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
export declare enum VerificationState {
|
|
310
|
+
VERIFIED = "verified",
|
|
311
|
+
PENDING = "pending",
|
|
312
|
+
REQUIRED = "required",
|
|
313
|
+
MAY_BE_NEEDED = "may_be_needed",
|
|
314
|
+
NOT_NEEDED = "not_needed"
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export declare function watchBasketTotals(apollo: ApolloClient<any>): ObservableQuery<BasketTotalsData, any>;
|
|
318
|
+
|
|
319
|
+
export declare function watchShopQuery<TData>(apollo: ApolloClient<any>, options: WatchQueryOptions<any, TData>, maxretries?: number): ObservableQuery<TData, any>;
|
|
320
|
+
|
|
321
|
+
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,98 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
} from "./
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "./
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} from "./
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
getClientToken,
|
|
17
|
-
useBraintreeDropIn
|
|
18
|
-
} from "./chunk-VZ3VDRRP.js";
|
|
19
|
-
import {
|
|
20
|
-
validatePreCheckout,
|
|
21
|
-
validatePreCheckoutMutation
|
|
22
|
-
} from "./chunk-KCUOMCSN.js";
|
|
23
|
-
import {
|
|
24
|
-
applyKivaCredit,
|
|
25
|
-
applyPromoCredit,
|
|
26
|
-
removeKivaCredit,
|
|
27
|
-
removePromoCredit
|
|
28
|
-
} from "./chunk-UJXHTR43.js";
|
|
29
|
-
import {
|
|
30
|
-
setTipDonation
|
|
31
|
-
} from "./chunk-Z7JRY3QE.js";
|
|
32
|
-
import {
|
|
33
|
-
basketTotalsQuery,
|
|
34
|
-
watchBasketTotals
|
|
35
|
-
} from "./chunk-IIN37LC7.js";
|
|
36
|
-
import {
|
|
37
|
-
VerificationState,
|
|
38
|
-
isBasketVerified
|
|
39
|
-
} from "./chunk-FCAOCO7O.js";
|
|
40
|
-
import {
|
|
41
|
-
getCheckoutStatus,
|
|
42
|
-
pollForFinishedCheckout
|
|
43
|
-
} from "./chunk-SRGYGDAX.js";
|
|
44
|
-
import "./chunk-TPJPGUO7.js";
|
|
45
|
-
import {
|
|
46
|
-
getPromoFromBasket
|
|
47
|
-
} from "./chunk-ASZJVUQ7.js";
|
|
48
|
-
import {
|
|
49
|
-
callShopMutation,
|
|
50
|
-
callShopQuery,
|
|
51
|
-
watchShopQuery
|
|
52
|
-
} from "./chunk-IOZ5ERDX.js";
|
|
53
|
-
import {
|
|
54
|
-
createBasket,
|
|
55
|
-
getBasketID,
|
|
56
|
-
hasBasketExpired,
|
|
57
|
-
setBasketID
|
|
58
|
-
} from "./chunk-FBF4WMN6.js";
|
|
59
|
-
import {
|
|
60
|
-
ShopError,
|
|
61
|
-
parseShopError
|
|
62
|
-
} from "./chunk-4ODZGLWK.js";
|
|
63
|
-
import "./chunk-LZ4UMRCV.js";
|
|
1
|
+
import { createBasket as o, getBasketID as r, hasBasketExpired as a, setBasketID as p } from "./basket.js";
|
|
2
|
+
import { applyKivaCredit as s, applyPromoCredit as m, removeKivaCredit as c, removePromoCredit as u } from "./basketCredits.js";
|
|
3
|
+
import { setTipDonation as k } from "./basketItems.js";
|
|
4
|
+
import { basketTotalsQuery as x, watchBasketTotals as h } from "./basketTotals.js";
|
|
5
|
+
import { VerificationState as d, isBasketVerified as C } from "./basketVerification.js";
|
|
6
|
+
import { getCheckoutStatus as g, pollForFinishedCheckout as T } from "./checkoutStatus.js";
|
|
7
|
+
import { getPromoFromBasket as B } from "./managedAccount.js";
|
|
8
|
+
import { executeOneTimeCheckout as P } from "./oneTimeCheckout.js";
|
|
9
|
+
import { getCheckoutTrackingData as F, getFTDStatus as I, getReceiptItems as b, getReceiptTotals as w } from "./receipt.js";
|
|
10
|
+
import { ShopError as K, parseShopError as Q } from "./shopError.js";
|
|
11
|
+
import { callShopMutation as R, callShopQuery as V, watchShopQuery as N } from "./shopQueries.js";
|
|
12
|
+
import { checkSubscriptionStatus as j, executeNewSubscriptionCheckout as q } from "./subscriptionCheckout.js";
|
|
13
|
+
import { defaultPaymentTypes as A, getClientToken as G, default as H } from "./useBraintreeDropIn.js";
|
|
14
|
+
import { validatePreCheckout as L, validatePreCheckoutMutation as U } from "./validatePreCheckout.js";
|
|
15
|
+
import { default as X } from "./components/KvPaymentSelect.js";
|
|
64
16
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
17
|
+
X as KvPaymentSelect,
|
|
18
|
+
K as ShopError,
|
|
19
|
+
d as VerificationState,
|
|
20
|
+
s as applyKivaCredit,
|
|
21
|
+
m as applyPromoCredit,
|
|
22
|
+
x as basketTotalsQuery,
|
|
23
|
+
R as callShopMutation,
|
|
24
|
+
V as callShopQuery,
|
|
25
|
+
j as checkSubscriptionStatus,
|
|
26
|
+
o as createBasket,
|
|
27
|
+
A as defaultPaymentTypes,
|
|
28
|
+
q as executeNewSubscriptionCheckout,
|
|
29
|
+
P as executeOneTimeCheckout,
|
|
30
|
+
r as getBasketID,
|
|
31
|
+
g as getCheckoutStatus,
|
|
32
|
+
F as getCheckoutTrackingData,
|
|
33
|
+
G as getClientToken,
|
|
34
|
+
I as getFTDStatus,
|
|
35
|
+
B as getPromoFromBasket,
|
|
36
|
+
b as getReceiptItems,
|
|
37
|
+
w as getReceiptTotals,
|
|
38
|
+
a as hasBasketExpired,
|
|
39
|
+
C as isBasketVerified,
|
|
40
|
+
Q as parseShopError,
|
|
41
|
+
T as pollForFinishedCheckout,
|
|
42
|
+
c as removeKivaCredit,
|
|
43
|
+
u as removePromoCredit,
|
|
44
|
+
p as setBasketID,
|
|
45
|
+
k as setTipDonation,
|
|
46
|
+
H as useBraintreeDropIn,
|
|
47
|
+
L as validatePreCheckout,
|
|
48
|
+
U as validatePreCheckoutMutation,
|
|
49
|
+
h as watchBasketTotals,
|
|
50
|
+
N as watchShopQuery
|
|
98
51
|
};
|
package/dist/managedAccount.js
CHANGED
|
@@ -1,10 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { gql as i } from "@apollo/client";
|
|
2
|
+
import { callShopQuery as l } from "./shopQueries.js";
|
|
3
|
+
async function c(d, e) {
|
|
4
|
+
var r, a;
|
|
5
|
+
return !((r = e == null ? void 0 : e.variables) != null && r.promoFundId) && !((a = e == null ? void 0 : e.variables) != null && a.basketId) ? Promise.resolve({ error: "promoFundId or basketId variable required" }) : await l(d, {
|
|
6
|
+
variables: { ...e == null ? void 0 : e.variables },
|
|
7
|
+
query: i`
|
|
8
|
+
query promoCampaign($basketId: String, $promoFundId: String) {
|
|
9
|
+
shop (basketId: $basketId) {
|
|
10
|
+
id
|
|
11
|
+
promoCampaign (promoFundId: $promoFundId) {
|
|
12
|
+
promoFund {
|
|
13
|
+
id
|
|
14
|
+
displayName
|
|
15
|
+
displayDescription
|
|
16
|
+
promoPrice
|
|
17
|
+
}
|
|
18
|
+
promoGroup {
|
|
19
|
+
id
|
|
20
|
+
type
|
|
21
|
+
teamId
|
|
22
|
+
}
|
|
23
|
+
managedAccount {
|
|
24
|
+
managementType
|
|
25
|
+
audience
|
|
26
|
+
allowDonations
|
|
27
|
+
sendKivaNewsletter
|
|
28
|
+
id
|
|
29
|
+
isEmployee
|
|
30
|
+
formId
|
|
31
|
+
pageId
|
|
32
|
+
loanSearchCriteria {
|
|
33
|
+
filters {
|
|
34
|
+
cityState
|
|
35
|
+
country
|
|
36
|
+
currencyLossPossible
|
|
37
|
+
dafEligible
|
|
38
|
+
distributionModel
|
|
39
|
+
status
|
|
40
|
+
excludeNonRated
|
|
41
|
+
expiringSoon
|
|
42
|
+
gender
|
|
43
|
+
hasResearchScore
|
|
44
|
+
isGroup
|
|
45
|
+
lenderFavorite
|
|
46
|
+
loanLimit
|
|
47
|
+
isMatched
|
|
48
|
+
sector
|
|
49
|
+
loanTags
|
|
50
|
+
theme
|
|
51
|
+
}
|
|
52
|
+
sortBy
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`,
|
|
59
|
+
fetchPolicy: (e == null ? void 0 : e.fetchPolicy) ?? "network-only"
|
|
60
|
+
}, 0);
|
|
61
|
+
}
|
|
8
62
|
export {
|
|
9
|
-
getPromoFromBasket
|
|
63
|
+
c as getPromoFromBasket
|
|
10
64
|
};
|