@builtbystack/sq-shopify-theme-sdk 0.0.8 → 0.0.10
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/README.md +82 -1
- package/dist/sq-shopify-theme-sdk.d.ts +87 -3
- package/dist/sq-shopify-theme-sdk.js +138 -113
- package/dist/sq-shopify-theme-sdk.umd.js +35 -24
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var He = Object.defineProperty;
|
|
2
2
|
var Ye = (e, t, n) => t in e ? He(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
-
var
|
|
3
|
+
var Te = (e, t, n) => (Ye(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
4
4
|
function ze(e, t) {
|
|
5
5
|
for (var n = 0; n < t.length; n++) {
|
|
6
6
|
const i = t[n];
|
|
@@ -561,7 +561,7 @@ function ht(e, t) {
|
|
|
561
561
|
if (Y(s) || s === 45)
|
|
562
562
|
return ft(e, r, s);
|
|
563
563
|
if (we(s))
|
|
564
|
-
return
|
|
564
|
+
return Ct(e, r);
|
|
565
565
|
throw b(
|
|
566
566
|
e.source,
|
|
567
567
|
r,
|
|
@@ -684,7 +684,7 @@ function yt(e, t) {
|
|
|
684
684
|
size: r
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
|
-
if (i = i << 4 |
|
|
687
|
+
if (i = i << 4 | $(s), i < 0)
|
|
688
688
|
break;
|
|
689
689
|
}
|
|
690
690
|
throw b(
|
|
@@ -718,9 +718,9 @@ function Et(e, t) {
|
|
|
718
718
|
);
|
|
719
719
|
}
|
|
720
720
|
function be(e, t) {
|
|
721
|
-
return
|
|
721
|
+
return $(e.charCodeAt(t)) << 12 | $(e.charCodeAt(t + 1)) << 8 | $(e.charCodeAt(t + 2)) << 4 | $(e.charCodeAt(t + 3));
|
|
722
722
|
}
|
|
723
|
-
function
|
|
723
|
+
function $(e) {
|
|
724
724
|
return e >= 48 && e <= 57 ? e - 48 : e >= 65 && e <= 70 ? e - 55 : e >= 97 && e <= 102 ? e - 87 : -1;
|
|
725
725
|
}
|
|
726
726
|
function gt(e, t) {
|
|
@@ -820,7 +820,7 @@ function vt(e, t) {
|
|
|
820
820
|
}
|
|
821
821
|
throw b(e.source, s, "Unterminated string.");
|
|
822
822
|
}
|
|
823
|
-
function
|
|
823
|
+
function Ct(e, t) {
|
|
824
824
|
const n = e.source.body, i = n.length;
|
|
825
825
|
let r = t + 1;
|
|
826
826
|
for (; r < i; ) {
|
|
@@ -838,8 +838,8 @@ function Tt(e, t) {
|
|
|
838
838
|
n.slice(t, r)
|
|
839
839
|
);
|
|
840
840
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
841
|
+
const Tt = 10, Fe = 2;
|
|
842
|
+
function Ce(e) {
|
|
843
843
|
return oe(e, []);
|
|
844
844
|
}
|
|
845
845
|
function oe(e, t) {
|
|
@@ -882,7 +882,7 @@ function bt(e, t) {
|
|
|
882
882
|
return "[]";
|
|
883
883
|
if (t.length > Fe)
|
|
884
884
|
return "[Array]";
|
|
885
|
-
const n = Math.min(
|
|
885
|
+
const n = Math.min(Tt, e.length), i = e.length - n, r = [];
|
|
886
886
|
for (let s = 0; s < n; ++s)
|
|
887
887
|
r.push(oe(e[s], t));
|
|
888
888
|
return i === 1 ? r.push("... 1 more item") : i > 1 && r.push(`... ${i} more items`), "[" + r.join(", ") + "]";
|
|
@@ -896,7 +896,7 @@ function It(e) {
|
|
|
896
896
|
}
|
|
897
897
|
return t;
|
|
898
898
|
}
|
|
899
|
-
const
|
|
899
|
+
const Dt = (
|
|
900
900
|
/* c8 ignore next 6 */
|
|
901
901
|
// FIXME: https://github.com/graphql/graphql-js/issues/2317
|
|
902
902
|
globalThis.process && globalThis.process.env.NODE_ENV === "production" ? function(t, n) {
|
|
@@ -911,7 +911,7 @@ const Ot = (
|
|
|
911
911
|
Symbol.toStringTag in t ? t[Symbol.toStringTag] : (i = t.constructor) === null || i === void 0 ? void 0 : i.name
|
|
912
912
|
);
|
|
913
913
|
if (r === s) {
|
|
914
|
-
const o =
|
|
914
|
+
const o = Ce(t);
|
|
915
915
|
throw new Error(`Cannot use ${r} "${o}" from another module or realm.
|
|
916
916
|
|
|
917
917
|
Ensure that there is only one instance of "graphql" in the node_modules
|
|
@@ -934,7 +934,7 @@ class Be {
|
|
|
934
934
|
line: 1,
|
|
935
935
|
column: 1
|
|
936
936
|
}) {
|
|
937
|
-
typeof t == "string" || Z(!1, `Body must be a string. Received: ${
|
|
937
|
+
typeof t == "string" || Z(!1, `Body must be a string. Received: ${Ce(t)}.`), this.body = t, this.name = n, this.locationOffset = i, this.locationOffset.line > 0 || Z(
|
|
938
938
|
!1,
|
|
939
939
|
"line in locationOffset is 1-indexed and must be positive."
|
|
940
940
|
), this.locationOffset.column > 0 || Z(
|
|
@@ -946,15 +946,15 @@ class Be {
|
|
|
946
946
|
return "Source";
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
function
|
|
950
|
-
return
|
|
949
|
+
function Ot(e) {
|
|
950
|
+
return Dt(e, Be);
|
|
951
951
|
}
|
|
952
952
|
function Me(e, t) {
|
|
953
953
|
return new _t(e, t).parseDocument();
|
|
954
954
|
}
|
|
955
955
|
class _t {
|
|
956
956
|
constructor(t, n = {}) {
|
|
957
|
-
const i =
|
|
957
|
+
const i = Ot(t) ? t : new Be(t);
|
|
958
958
|
this._lexer = new lt(i), this._options = n, this._tokenCounter = 0;
|
|
959
959
|
}
|
|
960
960
|
/**
|
|
@@ -2269,7 +2269,7 @@ function Lt(e, t, n = Re) {
|
|
|
2269
2269
|
let S;
|
|
2270
2270
|
if (!Array.isArray(p)) {
|
|
2271
2271
|
var y, N;
|
|
2272
|
-
xe(p) || Z(!1, `Invalid AST Node: ${
|
|
2272
|
+
xe(p) || Z(!1, `Invalid AST Node: ${Ce(p)}.`);
|
|
2273
2273
|
const k = _ ? (y = i.get(p.kind)) === null || y === void 0 ? void 0 : y.leave : (N = i.get(p.kind)) === null || N === void 0 ? void 0 : N.enter;
|
|
2274
2274
|
if (S = k == null ? void 0 : k.call(t, p, m, E, g, A), S === Pt)
|
|
2275
2275
|
break;
|
|
@@ -2289,14 +2289,14 @@ function Lt(e, t, n = Re) {
|
|
|
2289
2289
|
if (S === void 0 && z && h.push([m, p]), _)
|
|
2290
2290
|
g.pop();
|
|
2291
2291
|
else {
|
|
2292
|
-
var
|
|
2292
|
+
var O;
|
|
2293
2293
|
r = {
|
|
2294
2294
|
inArray: s,
|
|
2295
2295
|
index: u,
|
|
2296
2296
|
keys: o,
|
|
2297
2297
|
edits: h,
|
|
2298
2298
|
prev: r
|
|
2299
|
-
}, s = Array.isArray(p), o = s ? p : (
|
|
2299
|
+
}, s = Array.isArray(p), o = s ? p : (O = n[p.kind]) !== null && O !== void 0 ? O : [], u = -1, h = [], E && A.push(E), E = p;
|
|
2300
2300
|
}
|
|
2301
2301
|
} while (r !== void 0);
|
|
2302
2302
|
return h.length !== 0 ? h[h.length - 1][1] : e;
|
|
@@ -2329,7 +2329,7 @@ const Mt = 80, Ut = {
|
|
|
2329
2329
|
},
|
|
2330
2330
|
OperationDefinition: {
|
|
2331
2331
|
leave(e) {
|
|
2332
|
-
const t =
|
|
2332
|
+
const t = C("(", d(e.variableDefinitions, ", "), ")"), n = d(
|
|
2333
2333
|
[
|
|
2334
2334
|
e.operation,
|
|
2335
2335
|
d([e.name, t]),
|
|
@@ -2341,16 +2341,16 @@ const Mt = 80, Ut = {
|
|
|
2341
2341
|
}
|
|
2342
2342
|
},
|
|
2343
2343
|
VariableDefinition: {
|
|
2344
|
-
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t +
|
|
2344
|
+
leave: ({ variable: e, type: t, defaultValue: n, directives: i }) => e + ": " + t + C(" = ", n) + C(" ", d(i, " "))
|
|
2345
2345
|
},
|
|
2346
2346
|
SelectionSet: {
|
|
2347
2347
|
leave: ({ selections: e }) => R(e)
|
|
2348
2348
|
},
|
|
2349
2349
|
Field: {
|
|
2350
2350
|
leave({ alias: e, name: t, arguments: n, directives: i, selectionSet: r }) {
|
|
2351
|
-
const s =
|
|
2352
|
-
let o = s +
|
|
2353
|
-
return o.length > Mt && (o = s +
|
|
2351
|
+
const s = C("", e, ": ") + t;
|
|
2352
|
+
let o = s + C("(", d(n, ", "), ")");
|
|
2353
|
+
return o.length > Mt && (o = s + C(`(
|
|
2354
2354
|
`, K(d(n, `
|
|
2355
2355
|
`)), `
|
|
2356
2356
|
)`)), d([o, d(i, " "), r], " ");
|
|
@@ -2361,13 +2361,13 @@ const Mt = 80, Ut = {
|
|
|
2361
2361
|
},
|
|
2362
2362
|
// Fragments
|
|
2363
2363
|
FragmentSpread: {
|
|
2364
|
-
leave: ({ name: e, directives: t }) => "..." + e +
|
|
2364
|
+
leave: ({ name: e, directives: t }) => "..." + e + C(" ", d(t, " "))
|
|
2365
2365
|
},
|
|
2366
2366
|
InlineFragment: {
|
|
2367
2367
|
leave: ({ typeCondition: e, directives: t, selectionSet: n }) => d(
|
|
2368
2368
|
[
|
|
2369
2369
|
"...",
|
|
2370
|
-
|
|
2370
|
+
C("on ", e),
|
|
2371
2371
|
d(t, " "),
|
|
2372
2372
|
n
|
|
2373
2373
|
],
|
|
@@ -2377,7 +2377,7 @@ const Mt = 80, Ut = {
|
|
|
2377
2377
|
FragmentDefinition: {
|
|
2378
2378
|
leave: ({ name: e, typeCondition: t, variableDefinitions: n, directives: i, selectionSet: r }) => (
|
|
2379
2379
|
// or removed in the future.
|
|
2380
|
-
`fragment ${e}${
|
|
2380
|
+
`fragment ${e}${C("(", d(n, ", "), ")")} on ${t} ${C("", d(i, " "), " ")}` + r
|
|
2381
2381
|
)
|
|
2382
2382
|
},
|
|
2383
2383
|
// Value
|
|
@@ -2410,7 +2410,7 @@ const Mt = 80, Ut = {
|
|
|
2410
2410
|
},
|
|
2411
2411
|
// Directive
|
|
2412
2412
|
Directive: {
|
|
2413
|
-
leave: ({ name: e, arguments: t }) => "@" + e +
|
|
2413
|
+
leave: ({ name: e, arguments: t }) => "@" + e + C("(", d(t, ", "), ")")
|
|
2414
2414
|
},
|
|
2415
2415
|
// Type
|
|
2416
2416
|
NamedType: {
|
|
@@ -2424,23 +2424,23 @@ const Mt = 80, Ut = {
|
|
|
2424
2424
|
},
|
|
2425
2425
|
// Type System Definitions
|
|
2426
2426
|
SchemaDefinition: {
|
|
2427
|
-
leave: ({ description: e, directives: t, operationTypes: n }) =>
|
|
2427
|
+
leave: ({ description: e, directives: t, operationTypes: n }) => C("", e, `
|
|
2428
2428
|
`) + d(["schema", d(t, " "), R(n)], " ")
|
|
2429
2429
|
},
|
|
2430
2430
|
OperationTypeDefinition: {
|
|
2431
2431
|
leave: ({ operation: e, type: t }) => e + ": " + t
|
|
2432
2432
|
},
|
|
2433
2433
|
ScalarTypeDefinition: {
|
|
2434
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2434
|
+
leave: ({ description: e, name: t, directives: n }) => C("", e, `
|
|
2435
2435
|
`) + d(["scalar", t, d(n, " ")], " ")
|
|
2436
2436
|
},
|
|
2437
2437
|
ObjectTypeDefinition: {
|
|
2438
|
-
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) =>
|
|
2438
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => C("", e, `
|
|
2439
2439
|
`) + d(
|
|
2440
2440
|
[
|
|
2441
2441
|
"type",
|
|
2442
2442
|
t,
|
|
2443
|
-
|
|
2443
|
+
C("implements ", d(n, " & ")),
|
|
2444
2444
|
d(i, " "),
|
|
2445
2445
|
R(r)
|
|
2446
2446
|
],
|
|
@@ -2448,26 +2448,26 @@ const Mt = 80, Ut = {
|
|
|
2448
2448
|
)
|
|
2449
2449
|
},
|
|
2450
2450
|
FieldDefinition: {
|
|
2451
|
-
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) =>
|
|
2452
|
-
`) + t + (Ie(n) ?
|
|
2451
|
+
leave: ({ description: e, name: t, arguments: n, type: i, directives: r }) => C("", e, `
|
|
2452
|
+
`) + t + (Ie(n) ? C(`(
|
|
2453
2453
|
`, K(d(n, `
|
|
2454
2454
|
`)), `
|
|
2455
|
-
)`) :
|
|
2455
|
+
)`) : C("(", d(n, ", "), ")")) + ": " + i + C(" ", d(r, " "))
|
|
2456
2456
|
},
|
|
2457
2457
|
InputValueDefinition: {
|
|
2458
|
-
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) =>
|
|
2458
|
+
leave: ({ description: e, name: t, type: n, defaultValue: i, directives: r }) => C("", e, `
|
|
2459
2459
|
`) + d(
|
|
2460
|
-
[t + ": " + n,
|
|
2460
|
+
[t + ": " + n, C("= ", i), d(r, " ")],
|
|
2461
2461
|
" "
|
|
2462
2462
|
)
|
|
2463
2463
|
},
|
|
2464
2464
|
InterfaceTypeDefinition: {
|
|
2465
|
-
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) =>
|
|
2465
|
+
leave: ({ description: e, name: t, interfaces: n, directives: i, fields: r }) => C("", e, `
|
|
2466
2466
|
`) + d(
|
|
2467
2467
|
[
|
|
2468
2468
|
"interface",
|
|
2469
2469
|
t,
|
|
2470
|
-
|
|
2470
|
+
C("implements ", d(n, " & ")),
|
|
2471
2471
|
d(i, " "),
|
|
2472
2472
|
R(r)
|
|
2473
2473
|
],
|
|
@@ -2475,30 +2475,30 @@ const Mt = 80, Ut = {
|
|
|
2475
2475
|
)
|
|
2476
2476
|
},
|
|
2477
2477
|
UnionTypeDefinition: {
|
|
2478
|
-
leave: ({ description: e, name: t, directives: n, types: i }) =>
|
|
2478
|
+
leave: ({ description: e, name: t, directives: n, types: i }) => C("", e, `
|
|
2479
2479
|
`) + d(
|
|
2480
|
-
["union", t, d(n, " "),
|
|
2480
|
+
["union", t, d(n, " "), C("= ", d(i, " | "))],
|
|
2481
2481
|
" "
|
|
2482
2482
|
)
|
|
2483
2483
|
},
|
|
2484
2484
|
EnumTypeDefinition: {
|
|
2485
|
-
leave: ({ description: e, name: t, directives: n, values: i }) =>
|
|
2485
|
+
leave: ({ description: e, name: t, directives: n, values: i }) => C("", e, `
|
|
2486
2486
|
`) + d(["enum", t, d(n, " "), R(i)], " ")
|
|
2487
2487
|
},
|
|
2488
2488
|
EnumValueDefinition: {
|
|
2489
|
-
leave: ({ description: e, name: t, directives: n }) =>
|
|
2489
|
+
leave: ({ description: e, name: t, directives: n }) => C("", e, `
|
|
2490
2490
|
`) + d([t, d(n, " ")], " ")
|
|
2491
2491
|
},
|
|
2492
2492
|
InputObjectTypeDefinition: {
|
|
2493
|
-
leave: ({ description: e, name: t, directives: n, fields: i }) =>
|
|
2493
|
+
leave: ({ description: e, name: t, directives: n, fields: i }) => C("", e, `
|
|
2494
2494
|
`) + d(["input", t, d(n, " "), R(i)], " ")
|
|
2495
2495
|
},
|
|
2496
2496
|
DirectiveDefinition: {
|
|
2497
|
-
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) =>
|
|
2498
|
-
`) + "directive @" + t + (Ie(n) ?
|
|
2497
|
+
leave: ({ description: e, name: t, arguments: n, repeatable: i, locations: r }) => C("", e, `
|
|
2498
|
+
`) + "directive @" + t + (Ie(n) ? C(`(
|
|
2499
2499
|
`, K(d(n, `
|
|
2500
2500
|
`)), `
|
|
2501
|
-
)`) :
|
|
2501
|
+
)`) : C("(", d(n, ", "), ")")) + (i ? " repeatable" : "") + " on " + d(r, " | ")
|
|
2502
2502
|
},
|
|
2503
2503
|
SchemaExtension: {
|
|
2504
2504
|
leave: ({ directives: e, operationTypes: t }) => d(
|
|
@@ -2514,7 +2514,7 @@ const Mt = 80, Ut = {
|
|
|
2514
2514
|
[
|
|
2515
2515
|
"extend type",
|
|
2516
2516
|
e,
|
|
2517
|
-
|
|
2517
|
+
C("implements ", d(t, " & ")),
|
|
2518
2518
|
d(n, " "),
|
|
2519
2519
|
R(i)
|
|
2520
2520
|
],
|
|
@@ -2526,7 +2526,7 @@ const Mt = 80, Ut = {
|
|
|
2526
2526
|
[
|
|
2527
2527
|
"extend interface",
|
|
2528
2528
|
e,
|
|
2529
|
-
|
|
2529
|
+
C("implements ", d(t, " & ")),
|
|
2530
2530
|
d(n, " "),
|
|
2531
2531
|
R(i)
|
|
2532
2532
|
],
|
|
@@ -2539,7 +2539,7 @@ const Mt = 80, Ut = {
|
|
|
2539
2539
|
"extend union",
|
|
2540
2540
|
e,
|
|
2541
2541
|
d(t, " "),
|
|
2542
|
-
|
|
2542
|
+
C("= ", d(n, " | "))
|
|
2543
2543
|
],
|
|
2544
2544
|
" "
|
|
2545
2545
|
)
|
|
@@ -2556,16 +2556,16 @@ function d(e, t = "") {
|
|
|
2556
2556
|
return (n = e == null ? void 0 : e.filter((i) => i).join(t)) !== null && n !== void 0 ? n : "";
|
|
2557
2557
|
}
|
|
2558
2558
|
function R(e) {
|
|
2559
|
-
return
|
|
2559
|
+
return C(`{
|
|
2560
2560
|
`, K(d(e, `
|
|
2561
2561
|
`)), `
|
|
2562
2562
|
}`);
|
|
2563
2563
|
}
|
|
2564
|
-
function
|
|
2564
|
+
function C(e, t, n = "") {
|
|
2565
2565
|
return t != null && t !== "" ? e + t + n : "";
|
|
2566
2566
|
}
|
|
2567
2567
|
function K(e) {
|
|
2568
|
-
return
|
|
2568
|
+
return C(" ", e.replace(/\n/g, `
|
|
2569
2569
|
`));
|
|
2570
2570
|
}
|
|
2571
2571
|
function Ie(e) {
|
|
@@ -2573,7 +2573,7 @@ function Ie(e) {
|
|
|
2573
2573
|
return (t = e == null ? void 0 : e.some((n) => n.includes(`
|
|
2574
2574
|
`))) !== null && t !== void 0 ? t : !1;
|
|
2575
2575
|
}
|
|
2576
|
-
const
|
|
2576
|
+
const De = (e) => {
|
|
2577
2577
|
var i, r;
|
|
2578
2578
|
let t;
|
|
2579
2579
|
const n = e.definitions.filter((s) => s.kind === "OperationDefinition");
|
|
@@ -2583,12 +2583,12 @@ const Oe = (e) => {
|
|
|
2583
2583
|
let n;
|
|
2584
2584
|
try {
|
|
2585
2585
|
const i = Me(e);
|
|
2586
|
-
n =
|
|
2586
|
+
n = De(i);
|
|
2587
2587
|
} catch {
|
|
2588
2588
|
}
|
|
2589
2589
|
return { query: e, operationName: n };
|
|
2590
2590
|
}
|
|
2591
|
-
const t =
|
|
2591
|
+
const t = De(e);
|
|
2592
2592
|
return { query: Bt(e), operationName: t };
|
|
2593
2593
|
};
|
|
2594
2594
|
class H extends Error {
|
|
@@ -2712,7 +2712,7 @@ var ye = { exports: {} };
|
|
|
2712
2712
|
return Promise.reject(new TypeError("Already read"));
|
|
2713
2713
|
a.bodyUsed = !0;
|
|
2714
2714
|
}
|
|
2715
|
-
function
|
|
2715
|
+
function O(a) {
|
|
2716
2716
|
return new Promise(function(l, v) {
|
|
2717
2717
|
a.onload = function() {
|
|
2718
2718
|
l(a.result);
|
|
@@ -2722,16 +2722,16 @@ var ye = { exports: {} };
|
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
2724
2724
|
function _(a) {
|
|
2725
|
-
var l = new FileReader(), v =
|
|
2725
|
+
var l = new FileReader(), v = O(l);
|
|
2726
2726
|
return l.readAsArrayBuffer(a), v;
|
|
2727
2727
|
}
|
|
2728
2728
|
function z(a) {
|
|
2729
|
-
var l = new FileReader(), v =
|
|
2729
|
+
var l = new FileReader(), v = O(l);
|
|
2730
2730
|
return l.readAsText(a), v;
|
|
2731
2731
|
}
|
|
2732
2732
|
function S(a) {
|
|
2733
|
-
for (var l = new Uint8Array(a), v = new Array(l.length),
|
|
2734
|
-
v[
|
|
2733
|
+
for (var l = new Uint8Array(a), v = new Array(l.length), D = 0; D < l.length; D++)
|
|
2734
|
+
v[D] = String.fromCharCode(l[D]);
|
|
2735
2735
|
return v.join("");
|
|
2736
2736
|
}
|
|
2737
2737
|
function k(a) {
|
|
@@ -2798,18 +2798,18 @@ var ye = { exports: {} };
|
|
|
2798
2798
|
var l = new FormData();
|
|
2799
2799
|
return a.trim().split("&").forEach(function(v) {
|
|
2800
2800
|
if (v) {
|
|
2801
|
-
var
|
|
2802
|
-
l.append(decodeURIComponent(I), decodeURIComponent(
|
|
2801
|
+
var D = v.split("="), I = D.shift().replace(/\+/g, " "), T = D.join("=").replace(/\+/g, " ");
|
|
2802
|
+
l.append(decodeURIComponent(I), decodeURIComponent(T));
|
|
2803
2803
|
}
|
|
2804
2804
|
}), l;
|
|
2805
2805
|
}
|
|
2806
|
-
function
|
|
2806
|
+
function Ge(a) {
|
|
2807
2807
|
var l = new y(), v = a.replace(/\r?\n[\t ]+/g, " ");
|
|
2808
|
-
return v.split(/\r?\n/).forEach(function(
|
|
2809
|
-
var I =
|
|
2810
|
-
if (
|
|
2808
|
+
return v.split(/\r?\n/).forEach(function(D) {
|
|
2809
|
+
var I = D.split(":"), T = I.shift().trim();
|
|
2810
|
+
if (T) {
|
|
2811
2811
|
var X = I.join(":").trim();
|
|
2812
|
-
l.append(
|
|
2812
|
+
l.append(T, X);
|
|
2813
2813
|
}
|
|
2814
2814
|
}), l;
|
|
2815
2815
|
}
|
|
@@ -2828,9 +2828,9 @@ var ye = { exports: {} };
|
|
|
2828
2828
|
var a = new w(null, { status: 0, statusText: "" });
|
|
2829
2829
|
return a.type = "error", a;
|
|
2830
2830
|
};
|
|
2831
|
-
var
|
|
2831
|
+
var $e = [301, 302, 303, 307, 308];
|
|
2832
2832
|
w.redirect = function(a, l) {
|
|
2833
|
-
if (
|
|
2833
|
+
if ($e.indexOf(l) === -1)
|
|
2834
2834
|
throw new RangeError("Invalid status code");
|
|
2835
2835
|
return new w(null, { status: l, headers: { location: a } });
|
|
2836
2836
|
}, o.DOMException = s.DOMException;
|
|
@@ -2839,39 +2839,39 @@ var ye = { exports: {} };
|
|
|
2839
2839
|
} catch {
|
|
2840
2840
|
o.DOMException = function(l, v) {
|
|
2841
2841
|
this.message = l, this.name = v;
|
|
2842
|
-
var
|
|
2843
|
-
this.stack =
|
|
2842
|
+
var D = Error(l);
|
|
2843
|
+
this.stack = D.stack;
|
|
2844
2844
|
}, o.DOMException.prototype = Object.create(Error.prototype), o.DOMException.prototype.constructor = o.DOMException;
|
|
2845
2845
|
}
|
|
2846
2846
|
function ae(a, l) {
|
|
2847
|
-
return new Promise(function(v,
|
|
2847
|
+
return new Promise(function(v, D) {
|
|
2848
2848
|
var I = new L(a, l);
|
|
2849
2849
|
if (I.signal && I.signal.aborted)
|
|
2850
|
-
return
|
|
2851
|
-
var
|
|
2850
|
+
return D(new o.DOMException("Aborted", "AbortError"));
|
|
2851
|
+
var T = new XMLHttpRequest();
|
|
2852
2852
|
function X() {
|
|
2853
|
-
|
|
2853
|
+
T.abort();
|
|
2854
2854
|
}
|
|
2855
|
-
|
|
2855
|
+
T.onload = function() {
|
|
2856
2856
|
var j = {
|
|
2857
|
-
status:
|
|
2858
|
-
statusText:
|
|
2859
|
-
headers:
|
|
2857
|
+
status: T.status,
|
|
2858
|
+
statusText: T.statusText,
|
|
2859
|
+
headers: Ge(T.getAllResponseHeaders() || "")
|
|
2860
2860
|
};
|
|
2861
|
-
j.url = "responseURL" in
|
|
2862
|
-
var ce = "response" in
|
|
2861
|
+
j.url = "responseURL" in T ? T.responseURL : j.headers.get("X-Request-URL");
|
|
2862
|
+
var ce = "response" in T ? T.response : T.responseText;
|
|
2863
2863
|
v(new w(ce, j));
|
|
2864
|
-
},
|
|
2865
|
-
|
|
2866
|
-
},
|
|
2867
|
-
|
|
2868
|
-
},
|
|
2869
|
-
|
|
2870
|
-
},
|
|
2871
|
-
|
|
2872
|
-
}), I.signal && (I.signal.addEventListener("abort", X),
|
|
2873
|
-
|
|
2874
|
-
}),
|
|
2864
|
+
}, T.onerror = function() {
|
|
2865
|
+
D(new TypeError("Network request failed"));
|
|
2866
|
+
}, T.ontimeout = function() {
|
|
2867
|
+
D(new TypeError("Network request failed"));
|
|
2868
|
+
}, T.onabort = function() {
|
|
2869
|
+
D(new o.DOMException("Aborted", "AbortError"));
|
|
2870
|
+
}, T.open(I.method, I.url, !0), I.credentials === "include" ? T.withCredentials = !0 : I.credentials === "omit" && (T.withCredentials = !1), "responseType" in T && u.blob && (T.responseType = "blob"), I.headers.forEach(function(j, ce) {
|
|
2871
|
+
T.setRequestHeader(ce, j);
|
|
2872
|
+
}), I.signal && (I.signal.addEventListener("abort", X), T.onreadystatechange = function() {
|
|
2873
|
+
T.readyState === 4 && I.signal.removeEventListener("abort", X);
|
|
2874
|
+
}), T.send(typeof I._bodyInit > "u" ? null : I._bodyInit);
|
|
2875
2875
|
});
|
|
2876
2876
|
}
|
|
2877
2877
|
return ae.polyfill = !0, s.fetch || (s.fetch = ae, s.Headers = y, s.Request = L, s.Response = w), o.Headers = y, o.Request = L, o.Response = w, o.fetch = ae, Object.defineProperty(o, "__esModule", { value: !0 }), o;
|
|
@@ -2889,22 +2889,22 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
|
2889
2889
|
return e && (typeof Headers < "u" && e instanceof Headers || jt && ne.Headers && e instanceof ne.Headers ? t = Je(e) : Array.isArray(e) ? e.forEach(([n, i]) => {
|
|
2890
2890
|
n && i !== void 0 && (t[n] = i);
|
|
2891
2891
|
}) : t = e), t;
|
|
2892
|
-
},
|
|
2892
|
+
}, Oe = (e) => e.replace(/([\s,]|#[^\n\r]+)+/g, " ").trim(), Gt = (e) => {
|
|
2893
2893
|
if (!Array.isArray(e.query)) {
|
|
2894
|
-
const i = e, r = [`query=${encodeURIComponent(
|
|
2894
|
+
const i = e, r = [`query=${encodeURIComponent(Oe(i.query))}`];
|
|
2895
2895
|
return e.variables && r.push(`variables=${encodeURIComponent(i.jsonSerializer.stringify(i.variables))}`), i.operationName && r.push(`operationName=${encodeURIComponent(i.operationName)}`), r.join("&");
|
|
2896
2896
|
}
|
|
2897
2897
|
if (typeof e.variables < "u" && !Array.isArray(e.variables))
|
|
2898
2898
|
throw new Error("Cannot create query with given variable type, array expected");
|
|
2899
2899
|
const t = e, n = e.query.reduce((i, r, s) => (i.push({
|
|
2900
|
-
query:
|
|
2900
|
+
query: Oe(r),
|
|
2901
2901
|
variables: t.variables ? t.jsonSerializer.stringify(t.variables[s]) : void 0
|
|
2902
2902
|
}), i), []);
|
|
2903
2903
|
return `query=${encodeURIComponent(t.jsonSerializer.stringify(n))}`;
|
|
2904
|
-
},
|
|
2904
|
+
}, $t = (e) => async (t) => {
|
|
2905
2905
|
const { url: n, query: i, variables: r, operationName: s, fetch: o, fetchOptions: u, middleware: h } = t, p = { ...t.headers };
|
|
2906
2906
|
let m = "", E;
|
|
2907
|
-
e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (p["Content-Type"] = "application/json")) : m =
|
|
2907
|
+
e === "POST" ? (E = Yt(i, r, s, u.jsonSerializer), typeof E == "string" && (p["Content-Type"] = "application/json")) : m = Gt({
|
|
2908
2908
|
query: i,
|
|
2909
2909
|
variables: r,
|
|
2910
2910
|
operationName: s,
|
|
@@ -2918,8 +2918,8 @@ const ee = /* @__PURE__ */ Vt(ne), jt = /* @__PURE__ */ ze({
|
|
|
2918
2918
|
};
|
|
2919
2919
|
let A = n, y = g;
|
|
2920
2920
|
if (h) {
|
|
2921
|
-
const N = await Promise.resolve(h({ ...g, url: n, operationName: s, variables: r })), { url:
|
|
2922
|
-
A =
|
|
2921
|
+
const N = await Promise.resolve(h({ ...g, url: n, operationName: s, variables: r })), { url: O, ..._ } = N;
|
|
2922
|
+
A = O, y = _;
|
|
2923
2923
|
}
|
|
2924
2924
|
return m && (A = `${A}?${m}`), await o(A, y);
|
|
2925
2925
|
};
|
|
@@ -2942,8 +2942,8 @@ class Ht {
|
|
|
2942
2942
|
method: m,
|
|
2943
2943
|
fetchOptions: A,
|
|
2944
2944
|
middleware: E
|
|
2945
|
-
}).then((
|
|
2946
|
-
throw g && g(
|
|
2945
|
+
}).then((O) => (g && g(O), O)).catch((O) => {
|
|
2946
|
+
throw g && g(O), O;
|
|
2947
2947
|
});
|
|
2948
2948
|
};
|
|
2949
2949
|
}
|
|
@@ -3009,7 +3009,7 @@ class Ht {
|
|
|
3009
3009
|
}
|
|
3010
3010
|
}
|
|
3011
3011
|
const de = async (e) => {
|
|
3012
|
-
const { query: t, variables: n, fetchOptions: i } = e, r =
|
|
3012
|
+
const { query: t, variables: n, fetchOptions: i } = e, r = $t(Qe(e.method ?? "post")), s = Array.isArray(e.query), o = await r(e), u = await zt(o, i.jsonSerializer ?? ge), h = Array.isArray(u) ? !u.some(({ data: m }) => !m) : !!u.data, p = Array.isArray(u) || !u.errors || Array.isArray(u.errors) && !u.errors.length || i.errorPolicy === "all" || i.errorPolicy === "ignore";
|
|
3013
3013
|
if (o.ok && p && h) {
|
|
3014
3014
|
const { errors: m, ...E } = (Array.isArray(u), u), g = i.errorPolicy === "ignore" ? E : u;
|
|
3015
3015
|
return {
|
|
@@ -3115,7 +3115,7 @@ function en() {
|
|
|
3115
3115
|
function tn() {
|
|
3116
3116
|
ie = !1;
|
|
3117
3117
|
}
|
|
3118
|
-
var
|
|
3118
|
+
var G = {
|
|
3119
3119
|
gql: q,
|
|
3120
3120
|
resetCaches: Zt,
|
|
3121
3121
|
disableFragmentWarnings: Kt,
|
|
@@ -3123,7 +3123,7 @@ var $ = {
|
|
|
3123
3123
|
disableExperimentalFragmentVariables: tn
|
|
3124
3124
|
};
|
|
3125
3125
|
(function(e) {
|
|
3126
|
-
e.gql =
|
|
3126
|
+
e.gql = G.gql, e.resetCaches = G.resetCaches, e.disableFragmentWarnings = G.disableFragmentWarnings, e.enableExperimentalFragmentVariables = G.enableExperimentalFragmentVariables, e.disableExperimentalFragmentVariables = G.disableExperimentalFragmentVariables;
|
|
3127
3127
|
})(q || (q = {}));
|
|
3128
3128
|
q.default = q;
|
|
3129
3129
|
const P = q, nn = P`
|
|
@@ -3240,8 +3240,12 @@ const P = q, nn = P`
|
|
|
3240
3240
|
nodes {
|
|
3241
3241
|
id
|
|
3242
3242
|
title
|
|
3243
|
+
status
|
|
3243
3244
|
description
|
|
3244
3245
|
code
|
|
3246
|
+
customerApplicable
|
|
3247
|
+
startsAt
|
|
3248
|
+
endsAt
|
|
3245
3249
|
createdAt
|
|
3246
3250
|
updatedAt
|
|
3247
3251
|
}
|
|
@@ -3255,6 +3259,13 @@ const P = q, nn = P`
|
|
|
3255
3259
|
}
|
|
3256
3260
|
}
|
|
3257
3261
|
`, un = P`
|
|
3262
|
+
query GetPurchasingCustomerDiscountCodeCount {
|
|
3263
|
+
purchasingCustomer {
|
|
3264
|
+
id
|
|
3265
|
+
discountCodeCount
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
`, ln = P`
|
|
3258
3269
|
query GetPurchasingCustomerPointChangeActivities($first: Int, $after: String, $isReverse: Boolean! = false, $sortKeys: PointChangeActivitySortKey! = CREATED_AT) {
|
|
3259
3270
|
purchasingCustomer {
|
|
3260
3271
|
id
|
|
@@ -3286,7 +3297,7 @@ const P = q, nn = P`
|
|
|
3286
3297
|
}
|
|
3287
3298
|
}
|
|
3288
3299
|
}
|
|
3289
|
-
`,
|
|
3300
|
+
`, dn = P`
|
|
3290
3301
|
query GetPurchasingCustomerRank {
|
|
3291
3302
|
purchasingCustomer {
|
|
3292
3303
|
currentCustomerRank {
|
|
@@ -3325,8 +3336,8 @@ const P = q, nn = P`
|
|
|
3325
3336
|
}
|
|
3326
3337
|
}
|
|
3327
3338
|
}
|
|
3328
|
-
`,
|
|
3329
|
-
function
|
|
3339
|
+
`, hn = (e, t, n, i) => e();
|
|
3340
|
+
function pn(e, t = hn) {
|
|
3330
3341
|
return {
|
|
3331
3342
|
GetLocationAvailabilities(n, i) {
|
|
3332
3343
|
return t((r) => e.request(nn, n, { ...i, ...r }), "GetLocationAvailabilities", "query", n);
|
|
@@ -3346,18 +3357,21 @@ function hn(e, t = dn) {
|
|
|
3346
3357
|
GetPurchasingCustomerDiscounts(n, i) {
|
|
3347
3358
|
return t((r) => e.request(cn, n, { ...i, ...r }), "GetPurchasingCustomerDiscounts", "query", n);
|
|
3348
3359
|
},
|
|
3360
|
+
GetPurchasingCustomerDiscountCodeCount(n, i) {
|
|
3361
|
+
return t((r) => e.request(un, n, { ...i, ...r }), "GetPurchasingCustomerDiscountCodeCount", "query", n);
|
|
3362
|
+
},
|
|
3349
3363
|
GetPurchasingCustomerPointChangeActivities(n, i) {
|
|
3350
|
-
return t((r) => e.request(
|
|
3364
|
+
return t((r) => e.request(ln, n, { ...i, ...r }), "GetPurchasingCustomerPointChangeActivities", "query", n);
|
|
3351
3365
|
},
|
|
3352
3366
|
GetPurchasingCustomerRank(n, i) {
|
|
3353
|
-
return t((r) => e.request(
|
|
3367
|
+
return t((r) => e.request(dn, n, { ...i, ...r }), "GetPurchasingCustomerRank", "query", n);
|
|
3354
3368
|
}
|
|
3355
3369
|
};
|
|
3356
3370
|
}
|
|
3357
|
-
class
|
|
3371
|
+
class mn {
|
|
3358
3372
|
constructor(t) {
|
|
3359
|
-
|
|
3360
|
-
this.api =
|
|
3373
|
+
Te(this, "api");
|
|
3374
|
+
this.api = pn(
|
|
3361
3375
|
new Ht(`${t}/apps/sq-api`, {
|
|
3362
3376
|
headers: {
|
|
3363
3377
|
"X-SQ-CLIENT": "ShopifyAppProxy"
|
|
@@ -3504,8 +3518,12 @@ class fn {
|
|
|
3504
3518
|
(s) => ({
|
|
3505
3519
|
id: s.id,
|
|
3506
3520
|
title: s.title,
|
|
3521
|
+
status: s.status,
|
|
3507
3522
|
description: s.description,
|
|
3508
3523
|
code: s.code,
|
|
3524
|
+
customerApplicable: s.customerApplicable,
|
|
3525
|
+
startsAt: new Date(s.startsAt),
|
|
3526
|
+
endsAt: new Date(s.endsAt),
|
|
3509
3527
|
createdAt: new Date(s.createdAt),
|
|
3510
3528
|
updatedAt: new Date(s.updatedAt)
|
|
3511
3529
|
})
|
|
@@ -3594,7 +3612,14 @@ class fn {
|
|
|
3594
3612
|
} : void 0
|
|
3595
3613
|
} : null;
|
|
3596
3614
|
}
|
|
3615
|
+
/**
|
|
3616
|
+
* getPurchasingCustomerDiscountCodeCount は顧客に紐付くDiscountCodeの数を返します。
|
|
3617
|
+
*/
|
|
3618
|
+
async getPurchasingCustomerDiscountCodeCount() {
|
|
3619
|
+
var n;
|
|
3620
|
+
return ((n = (await this.api.GetPurchasingCustomerDiscountCodeCount()).purchasingCustomer) == null ? void 0 : n.discountCodeCount) ?? 0;
|
|
3621
|
+
}
|
|
3597
3622
|
}
|
|
3598
3623
|
export {
|
|
3599
|
-
|
|
3624
|
+
mn as SDK
|
|
3600
3625
|
};
|