@kiva/kv-shop 1.11.6 → 1.12.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/basketCredits.cjs
CHANGED
|
@@ -193,8 +193,15 @@ async function removeKivaCredit(apollo) {
|
|
|
193
193
|
return !!data?.shop?.removeCreditByType;
|
|
194
194
|
}
|
|
195
195
|
async function applyPromoCredit(apollo, options) {
|
|
196
|
-
if (!options?.variables?.creditType
|
|
197
|
-
return Promise.resolve(
|
|
196
|
+
if (!options?.variables?.creditType || !options?.variables?.redemptionCode) {
|
|
197
|
+
return Promise.resolve({
|
|
198
|
+
errors: [
|
|
199
|
+
{
|
|
200
|
+
message: "Missing required parameter.",
|
|
201
|
+
extensions: { code: "upc.missing_parameter" }
|
|
202
|
+
}
|
|
203
|
+
]
|
|
204
|
+
});
|
|
198
205
|
}
|
|
199
206
|
const data = await callShopMutation(apollo, {
|
|
200
207
|
awaitRefetchQueries: true,
|
|
@@ -211,7 +218,7 @@ async function applyPromoCredit(apollo, options) {
|
|
|
211
218
|
}`,
|
|
212
219
|
variables: { ...options?.variables }
|
|
213
220
|
});
|
|
214
|
-
return
|
|
221
|
+
return data;
|
|
215
222
|
}
|
|
216
223
|
async function removePromoCredit(apollo, options) {
|
|
217
224
|
if (!options?.variables?.creditType && !options?.variables?.redemptionCode) {
|
package/dist/basketCredits.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ interface ApplyPromoCreditData {
|
|
|
20
20
|
addCreditByType: boolean;
|
|
21
21
|
} | null;
|
|
22
22
|
}
|
|
23
|
-
declare function applyPromoCredit(apollo: ApolloClient<any>, options: MutationOptions<any>): Promise<
|
|
23
|
+
declare function applyPromoCredit(apollo: ApolloClient<any>, options: MutationOptions<any>): Promise<any>;
|
|
24
24
|
interface RemovePromoCreditData {
|
|
25
25
|
shop: {
|
|
26
26
|
id: string;
|
package/dist/basketCredits.js
CHANGED
|
@@ -29,8 +29,15 @@ async function removeKivaCredit(apollo) {
|
|
|
29
29
|
return !!data?.shop?.removeCreditByType;
|
|
30
30
|
}
|
|
31
31
|
async function applyPromoCredit(apollo, options) {
|
|
32
|
-
if (!options?.variables?.creditType
|
|
33
|
-
return Promise.resolve(
|
|
32
|
+
if (!options?.variables?.creditType || !options?.variables?.redemptionCode) {
|
|
33
|
+
return Promise.resolve({
|
|
34
|
+
errors: [
|
|
35
|
+
{
|
|
36
|
+
message: "Missing required parameter.",
|
|
37
|
+
extensions: { code: "upc.missing_parameter" }
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
});
|
|
34
41
|
}
|
|
35
42
|
const data = await callShopMutation(apollo, {
|
|
36
43
|
awaitRefetchQueries: true,
|
|
@@ -47,7 +54,7 @@ async function applyPromoCredit(apollo, options) {
|
|
|
47
54
|
}`,
|
|
48
55
|
variables: { ...options?.variables }
|
|
49
56
|
});
|
|
50
|
-
return
|
|
57
|
+
return data;
|
|
51
58
|
}
|
|
52
59
|
async function removePromoCredit(apollo, options) {
|
|
53
60
|
if (!options?.variables?.creditType && !options?.variables?.redemptionCode) {
|
package/dist/index.cjs
CHANGED
|
@@ -310,8 +310,15 @@ async function removeKivaCredit(apollo) {
|
|
|
310
310
|
return !!data?.shop?.removeCreditByType;
|
|
311
311
|
}
|
|
312
312
|
async function applyPromoCredit(apollo, options) {
|
|
313
|
-
if (!options?.variables?.creditType
|
|
314
|
-
return Promise.resolve(
|
|
313
|
+
if (!options?.variables?.creditType || !options?.variables?.redemptionCode) {
|
|
314
|
+
return Promise.resolve({
|
|
315
|
+
errors: [
|
|
316
|
+
{
|
|
317
|
+
message: "Missing required parameter.",
|
|
318
|
+
extensions: { code: "upc.missing_parameter" }
|
|
319
|
+
}
|
|
320
|
+
]
|
|
321
|
+
});
|
|
315
322
|
}
|
|
316
323
|
const data = await callShopMutation(apollo, {
|
|
317
324
|
awaitRefetchQueries: true,
|
|
@@ -328,7 +335,7 @@ async function applyPromoCredit(apollo, options) {
|
|
|
328
335
|
}`,
|
|
329
336
|
variables: { ...options?.variables }
|
|
330
337
|
});
|
|
331
|
-
return
|
|
338
|
+
return data;
|
|
332
339
|
}
|
|
333
340
|
async function removePromoCredit(apollo, options) {
|
|
334
341
|
if (!options?.variables?.creditType && !options?.variables?.redemptionCode) {
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kiva/kv-shop",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.12.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"optional": true
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "886f6809b116f6d2510bb2562bc84c6e1e0220d0"
|
|
58
58
|
}
|