@shopify/cli-kit 3.0.0 → 3.0.5

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.
@@ -2190,7 +2190,7 @@ class ArrayPrompt$3 extends Prompt$5 {
2190
2190
  let len = this.choices.length;
2191
2191
  let num = this.num;
2192
2192
 
2193
- let handle = (val = false, res) => {
2193
+ let handle = (val, res) => {
2194
2194
  clearTimeout(this.numberTimeout);
2195
2195
  if (val) res = number(num);
2196
2196
  this.num = '';
@@ -2810,7 +2810,7 @@ const utils$r = utils$z;
2810
2810
  * @api public
2811
2811
  */
2812
2812
 
2813
- var placeholder$2 = (prompt, options = {}) => {
2813
+ var placeholder$2 = (prompt, options) => {
2814
2814
  prompt.cursorHide();
2815
2815
 
2816
2816
  let { input = '', initial = '', pos, showCursor = true, color } = options;
@@ -4059,7 +4059,7 @@ class Item {
4059
4059
  }
4060
4060
  }
4061
4061
 
4062
- const tokenize = async(options = {}, defaults = {}, fn = token => token) => {
4062
+ const tokenize = async(options = {}, defaults, fn = token => token) => {
4063
4063
  let unique = new Set();
4064
4064
  let fields = options.fields || [];
4065
4065
  let input = options.template;
@@ -5610,7 +5610,7 @@ async function pLocate$2(
5610
5610
  {
5611
5611
  concurrency = Number.POSITIVE_INFINITY,
5612
5612
  preserveOrder = true,
5613
- } = {},
5613
+ },
5614
5614
  ) {
5615
5615
  const limit = pLimit$3(concurrency);
5616
5616
 
@@ -5677,7 +5677,7 @@ const toPath = urlOrPath => urlOrPath instanceof URL ? fileURLToPath(urlOrPath)
5677
5677
 
5678
5678
  const findUpStop = Symbol('findUpStop');
5679
5679
 
5680
- async function findUpMultiple(name, options = {}) {
5680
+ async function findUpMultiple(name, options) {
5681
5681
  let directory = path$I.resolve(toPath(options.cwd) || '');
5682
5682
  const {root} = path$I.parse(directory);
5683
5683
  const stopAt = path$I.resolve(directory, options.stopAt || root);
@@ -6611,7 +6611,7 @@ const invalidStep = (step, options) => {
6611
6611
  return [];
6612
6612
  };
6613
6613
 
6614
- const fillNumbers = (start, end, step = 1, options = {}) => {
6614
+ const fillNumbers = (start, end, step = 1, options) => {
6615
6615
  let a = Number(start);
6616
6616
  let b = Number(end);
6617
6617
 
@@ -6663,7 +6663,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
6663
6663
  return range;
6664
6664
  };
6665
6665
 
6666
- const fillLetters = (start, end, step = 1, options = {}) => {
6666
+ const fillLetters = (start, end, step = 1, options) => {
6667
6667
  if ((!isNumber$3(start) && start.length > 1) || (!isNumber$3(end) && end.length > 1)) {
6668
6668
  return invalidRange(start, end, options);
6669
6669
  }
@@ -12317,7 +12317,7 @@ var path$w = /*#__PURE__*/Object.freeze({
12317
12317
  });
12318
12318
 
12319
12319
  var name = "@shopify/cli-kit";
12320
- var version$4 = "3.0.0";
12320
+ var version$4 = "3.0.5";
12321
12321
  var description$1 = "A set of utilities, interfaces, and models that are common across all the platform features";
12322
12322
  var keywords = [
12323
12323
  "shopify",
@@ -12365,7 +12365,7 @@ var os$7 = [
12365
12365
  "win32"
12366
12366
  ];
12367
12367
  var dependencies$1 = {
12368
- "@oclif/core": "1.7.0",
12368
+ "@oclif/core": "1.9.0",
12369
12369
  envfile: "^6.17.0",
12370
12370
  keytar: "^7.9.0",
12371
12371
  open: "^8.4.0",
@@ -12380,6 +12380,7 @@ var devDependencies = {
12380
12380
  "abort-controller": "^3.0.0",
12381
12381
  "ansi-colors": "^4.1.1",
12382
12382
  "change-case": "^4.1.2",
12383
+ "color-json": "^2.0.1",
12383
12384
  commondir: "^1.0.1",
12384
12385
  conf: "^10.1.2",
12385
12386
  "cross-zip": "^4.0.0",
@@ -12394,7 +12395,7 @@ var devDependencies = {
12394
12395
  "fs-extra": "^10.0.0",
12395
12396
  "get-port-please": "^2.5.0",
12396
12397
  graphql: "^16.4.0",
12397
- "graphql-request": "^4.2.0",
12398
+ "graphql-request": "^4.3.0",
12398
12399
  "js-yaml": "^4.1.0",
12399
12400
  "latest-version": "^6.0.0",
12400
12401
  liquidjs: "^9.36.0",
@@ -12407,7 +12408,7 @@ var devDependencies = {
12407
12408
  tempy: "^2.0.0",
12408
12409
  "term-size": "^3.0.1",
12409
12410
  "terminal-link": "^3.0.0",
12410
- vitest: "0.10.0",
12411
+ vitest: "0.13.1",
12411
12412
  zod: "^3.17.3"
12412
12413
  };
12413
12414
  var cliKitPackageJson = {
@@ -12432,11 +12433,11 @@ var cliKitPackageJson = {
12432
12433
  devDependencies: devDependencies
12433
12434
  };
12434
12435
 
12435
- var version$3 = "3.0.0";
12436
+ var version$3 = "3.0.5";
12436
12437
 
12437
- var version$2 = "3.0.0";
12438
+ var version$2 = "3.0.5";
12438
12439
 
12439
- var version$1 = "3.0.0";
12440
+ var version$1 = "3.0.5";
12440
12441
 
12441
12442
  const homedir$1 = os$8.homedir();
12442
12443
  const tmpdir$1 = os$8.tmpdir();
@@ -13225,7 +13226,7 @@ function npmRunPath(options = {}) {
13225
13226
  return [...result, path_].join(path$I.delimiter);
13226
13227
  }
13227
13228
 
13228
- function npmRunPathEnv({env = process$2.env, ...options} = {}) {
13229
+ function npmRunPathEnv({env = process$2.env, ...options}) {
13229
13230
  env = {...env};
13230
13231
 
13231
13232
  const path = pathKey({env});
@@ -19038,7 +19039,7 @@ const rmkidsSync = (p, options) => {
19038
19039
  var rimraf_1 = rimraf$1;
19039
19040
  rimraf$1.sync = rimrafSync;
19040
19041
 
19041
- var indentString$3 = (string, count = 1, options) => {
19042
+ var indentString$3 = (string, count, options) => {
19042
19043
  options = {
19043
19044
  indent: ' ',
19044
19045
  includeEmptyLines: false,
@@ -19922,7 +19923,7 @@ function translateLevel(level) {
19922
19923
  };
19923
19924
  }
19924
19925
 
19925
- function supportsColor$1(haveStream, streamIsTTY) {
19926
+ function supportsColor$3(haveStream, streamIsTTY) {
19926
19927
  if (forceColor === 0) {
19927
19928
  return 0;
19928
19929
  }
@@ -20005,17 +20006,17 @@ function supportsColor$1(haveStream, streamIsTTY) {
20005
20006
  }
20006
20007
 
20007
20008
  function getSupportLevel(stream) {
20008
- const level = supportsColor$1(stream, stream && stream.isTTY);
20009
+ const level = supportsColor$3(stream, stream && stream.isTTY);
20009
20010
  return translateLevel(level);
20010
20011
  }
20011
20012
 
20012
20013
  var supportsColor_1 = {
20013
20014
  supportsColor: getSupportLevel,
20014
- stdout: translateLevel(supportsColor$1(true, tty.isatty(1))),
20015
- stderr: translateLevel(supportsColor$1(true, tty.isatty(2)))
20015
+ stdout: translateLevel(supportsColor$3(true, tty.isatty(1))),
20016
+ stderr: translateLevel(supportsColor$3(true, tty.isatty(2)))
20016
20017
  };
20017
20018
 
20018
- const supportsColor = supportsColor_1;
20019
+ const supportsColor$2 = supportsColor_1;
20019
20020
  const hasFlag = hasFlag$2;
20020
20021
 
20021
20022
  function parseVersion(versionString) {
@@ -20053,7 +20054,7 @@ function supportsHyperlink(stream) {
20053
20054
  }
20054
20055
 
20055
20056
  // If they specify no colors, they probably don't want hyperlinks.
20056
- if (!supportsColor.supportsColor(stream)) {
20057
+ if (!supportsColor$2.supportsColor(stream)) {
20057
20058
  return false;
20058
20059
  }
20059
20060
 
@@ -21100,6 +21101,60 @@ if (typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol") {
21100
21101
  });
21101
21102
  }
21102
21103
 
21104
+ // TODO: this is super beta, consider using Sindre's supports-colors
21105
+ var supportsColor$1 = function supportsColor() {
21106
+ const onHeroku = truth(process.env.DYNO) ? true : false;
21107
+ const forceNoColor = truth(process.env.FORCE_NO_COLOR) ? true : false;
21108
+ const forceColor = truth(process.env.FORCE_COLOR) ? true : false;
21109
+ return !onHeroku && !forceNoColor || forceColor;
21110
+ };
21111
+
21112
+ // also counts 'false' as false
21113
+ function truth(it) {
21114
+ return it && it !== 'false' ? true : false;
21115
+ }
21116
+
21117
+ const supportsColor = supportsColor$1;
21118
+
21119
+ const defaultColorMap = {
21120
+ black: '\x1b[30m',
21121
+ red: '\x1b[31m',
21122
+ green: '\x1b[32m',
21123
+ yellow: '\x1b[33m',
21124
+ blue: '\x1b[34m',
21125
+ magenta: '\x1b[35m',
21126
+ cyan: '\x1b[36m',
21127
+ white: '\x1b[37m'
21128
+ };
21129
+
21130
+ const defaultColors = {
21131
+ separator: 'yellow',
21132
+ string: 'green',
21133
+ number: 'magenta',
21134
+ boolean: 'cyan',
21135
+ null: 'red',
21136
+ key: 'white'
21137
+ };
21138
+
21139
+ var colorJson$1 = supportsColor() ? function syntaxHighlight(json, colors = defaultColors, colorMap = defaultColorMap, spacing = 2) { // thanks: https://stackoverflow.com/a/7220510/4151489
21140
+ if (typeof json != 'string') json = JSON.stringify(json, undefined, spacing);
21141
+ else json = JSON.stringify(JSON.parse(json), undefined, spacing);
21142
+ return colorMap[colors.separator] + json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) {
21143
+ let colorCode = 'number';
21144
+ if (/^"/.test(match)) {
21145
+ if (/:$/.test(match)) colorCode = 'key';
21146
+ else colorCode = 'string';
21147
+ } else if (/true|false/.test(match)) colorCode = 'boolean';
21148
+ else if (/null/.test(match)) colorCode = 'null';
21149
+ const color = colorMap[colors[colorCode]] || '';
21150
+ return `\x1b[0m${color}${match}${colorMap[colors.separator]}`;
21151
+ }) + '\x1b[0m';
21152
+ } : function syntaxNoHighlight(json, colors = defaultColors, colorMap = defaultColorMap, spacing = 2) {
21153
+ if (typeof json != 'string') json = JSON.stringify(json, undefined, spacing);
21154
+ else json = JSON.stringify(JSON.parse(json), undefined, spacing);
21155
+ return json;
21156
+ };
21157
+
21103
21158
  class ContentToken {
21104
21159
  constructor(value, metadata = {}, type) {
21105
21160
  this.type = type;
@@ -21273,6 +21328,9 @@ const warn = (content2) => {
21273
21328
  const newline = () => {
21274
21329
  console.log();
21275
21330
  };
21331
+ const colorJson = (json) => {
21332
+ return colorJson$1(json);
21333
+ };
21276
21334
  const error$k = async (content2) => {
21277
21335
  if (shouldOutput("error")) {
21278
21336
  if (!content2.message) {
@@ -21326,7 +21384,7 @@ function stringifyMessage(message2) {
21326
21384
  return message2;
21327
21385
  }
21328
21386
  }
21329
- const message = (content2, level = "info") => {
21387
+ const message = (content2, level) => {
21330
21388
  if (shouldOutput(level)) {
21331
21389
  consoleLog(stringifyMessage(content2));
21332
21390
  }
@@ -21410,6 +21468,7 @@ var output = /*#__PURE__*/Object.freeze({
21410
21468
  debug: debug$5,
21411
21469
  warn: warn,
21412
21470
  newline: newline,
21471
+ colorJson: colorJson,
21413
21472
  error: error$k,
21414
21473
  stringifyMessage: stringifyMessage,
21415
21474
  concurrent: concurrent,
@@ -21496,15 +21555,15 @@ function __extends$2(d, b) {
21496
21555
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21497
21556
  }
21498
21557
 
21499
- var __assign$1 = function() {
21500
- __assign$1 = Object.assign || function __assign(t) {
21558
+ var __assign$2 = function() {
21559
+ __assign$2 = Object.assign || function __assign(t) {
21501
21560
  for (var s, i = 1, n = arguments.length; i < n; i++) {
21502
21561
  s = arguments[i];
21503
21562
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
21504
21563
  }
21505
21564
  return t;
21506
21565
  };
21507
- return __assign$1.apply(this, arguments);
21566
+ return __assign$2.apply(this, arguments);
21508
21567
  };
21509
21568
 
21510
21569
  function __values$1(o) {
@@ -26415,18 +26474,18 @@ function __extends$1(d, b) {
26415
26474
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
26416
26475
  }
26417
26476
 
26418
- var __assign = function() {
26419
- __assign = Object.assign || function __assign(t) {
26477
+ var __assign$1 = function() {
26478
+ __assign$1 = Object.assign || function __assign(t) {
26420
26479
  for (var s, i = 1, n = arguments.length; i < n; i++) {
26421
26480
  s = arguments[i];
26422
26481
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
26423
26482
  }
26424
26483
  return t;
26425
26484
  };
26426
- return __assign.apply(this, arguments);
26485
+ return __assign$1.apply(this, arguments);
26427
26486
  };
26428
26487
 
26429
- function __awaiter(thisArg, _arguments, P, generator) {
26488
+ function __awaiter$1(thisArg, _arguments, P, generator) {
26430
26489
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26431
26490
  return new (P || (P = Promise))(function (resolve, reject) {
26432
26491
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -26436,7 +26495,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
26436
26495
  });
26437
26496
  }
26438
26497
 
26439
- function __generator(thisArg, body) {
26498
+ function __generator$1(thisArg, body) {
26440
26499
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
26441
26500
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26442
26501
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -26738,8 +26797,8 @@ function requireResolve (file) {
26738
26797
  var statAsync$1 = promisify$2(stat$6);
26739
26798
  var readFileAsync = promisify$2(readFile$3);
26740
26799
  function exists(filepath) {
26741
- return __awaiter(this, void 0, void 0, function () {
26742
- return __generator(this, function (_a) {
26800
+ return __awaiter$1(this, void 0, void 0, function () {
26801
+ return __generator$1(this, function (_a) {
26743
26802
  switch (_a.label) {
26744
26803
  case 0:
26745
26804
  _a.trys.push([0, 2, , 3]);
@@ -27837,7 +27896,7 @@ var Expression = /** @class */ (function () {
27837
27896
  Expression.prototype.evaluate = function (ctx, lenient) {
27838
27897
  var operands, _a, _b, token, r, l, result, _c, _d, e_1_1;
27839
27898
  var e_1, _e;
27840
- return __generator(this, function (_f) {
27899
+ return __generator$1(this, function (_f) {
27841
27900
  switch (_f.label) {
27842
27901
  case 0:
27843
27902
  assert(ctx, 'unable to evaluate: context not defined');
@@ -27934,7 +27993,7 @@ function evalRangeToken(token, ctx) {
27934
27993
  function toPostfix(tokens) {
27935
27994
  var ops, tokens_1, tokens_1_1, token, e_2_1;
27936
27995
  var e_2, _a;
27937
- return __generator(this, function (_b) {
27996
+ return __generator$1(this, function (_b) {
27938
27997
  switch (_b.label) {
27939
27998
  case 0:
27940
27999
  ops = [];
@@ -28304,7 +28363,7 @@ var Tokenizer = /** @class */ (function () {
28304
28363
  };
28305
28364
  Tokenizer.prototype.readExpressionTokens = function () {
28306
28365
  var operand, operator, operand_1;
28307
- return __generator(this, function (_a) {
28366
+ return __generator$1(this, function (_a) {
28308
28367
  switch (_a.label) {
28309
28368
  case 0:
28310
28369
  operand = this.readValue();
@@ -28644,7 +28703,7 @@ var Tokenizer = /** @class */ (function () {
28644
28703
  };
28645
28704
  Tokenizer.prototype.readFileNameTemplate = function (options) {
28646
28705
  var outputDelimiterLeft, htmlStopStrings, htmlStopStringSet;
28647
- return __generator(this, function (_a) {
28706
+ return __generator$1(this, function (_a) {
28648
28707
  switch (_a.label) {
28649
28708
  case 0:
28650
28709
  outputDelimiterLeft = options.outputDelimiterLeft;
@@ -28778,7 +28837,7 @@ var Hash = /** @class */ (function () {
28778
28837
  Hash.prototype.render = function (ctx) {
28779
28838
  var hash, _a, _b, key, _c, _d, _e, e_2_1;
28780
28839
  var e_2, _f;
28781
- return __generator(this, function (_g) {
28840
+ return __generator$1(this, function (_g) {
28782
28841
  switch (_g.label) {
28783
28842
  case 0:
28784
28843
  hash = {};
@@ -28874,7 +28933,7 @@ var Value = /** @class */ (function () {
28874
28933
  Value.prototype.value = function (ctx, lenient) {
28875
28934
  var val, _a, _b, filter, e_1_1;
28876
28935
  var e_1, _c;
28877
- return __generator(this, function (_d) {
28936
+ return __generator$1(this, function (_d) {
28878
28937
  switch (_d.label) {
28879
28938
  case 0:
28880
28939
  lenient = lenient || (ctx.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === 'default');
@@ -28997,7 +29056,7 @@ var assign = {
28997
29056
  },
28998
29057
  render: function (ctx) {
28999
29058
  var _a, _b;
29000
- return __generator(this, function (_c) {
29059
+ return __generator$1(this, function (_c) {
29001
29060
  switch (_c.label) {
29002
29061
  case 0:
29003
29062
  _a = ctx.bottom();
@@ -29076,7 +29135,7 @@ var For = {
29076
29135
  render: function (ctx, emitter) {
29077
29136
  var r, collection, _a, continueKey, hash, modifiers, scope, collection_1, collection_1_1, item, e_1_1;
29078
29137
  var e_1, _b;
29079
- return __generator(this, function (_c) {
29138
+ return __generator$1(this, function (_c) {
29080
29139
  switch (_c.label) {
29081
29140
  case 0:
29082
29141
  r = this.liquid.renderer;
@@ -29176,7 +29235,7 @@ var capture = {
29176
29235
  },
29177
29236
  render: function (ctx) {
29178
29237
  var r, html;
29179
- return __generator(this, function (_a) {
29238
+ return __generator$1(this, function (_a) {
29180
29239
  switch (_a.label) {
29181
29240
  case 0:
29182
29241
  r = this.liquid.renderer;
@@ -29229,7 +29288,7 @@ var Case = {
29229
29288
  render: function (ctx, emitter) {
29230
29289
  var r, cond, _a, _b, _c, branch, val, e_1_1;
29231
29290
  var e_1, _d;
29232
- return __generator(this, function (_e) {
29291
+ return __generator$1(this, function (_e) {
29233
29292
  switch (_e.label) {
29234
29293
  case 0:
29235
29294
  r = this.liquid.renderer;
@@ -29344,7 +29403,7 @@ var render = {
29344
29403
  render: function (ctx, emitter) {
29345
29404
  var _a, liquid, hash, filepath, childCtx, scope, _b, _c, _d, value, alias, _e, value, alias, collection, collection_1, collection_1_1, item, templates, e_1_1, templates;
29346
29405
  var e_1, _f;
29347
- return __generator(this, function (_g) {
29406
+ return __generator$1(this, function (_g) {
29348
29407
  switch (_g.label) {
29349
29408
  case 0:
29350
29409
  _a = this, liquid = _a.liquid, hash = _a.hash;
@@ -29354,7 +29413,7 @@ var render = {
29354
29413
  assert(filepath, function () { return "illegal filename \"".concat(filepath, "\""); });
29355
29414
  childCtx = new Context({}, ctx.opts, { sync: ctx.sync, globals: ctx.globals, strictVariables: ctx.strictVariables });
29356
29415
  scope = childCtx.bottom();
29357
- _b = __assign;
29416
+ _b = __assign$1;
29358
29417
  _c = [scope];
29359
29418
  return [4 /*yield*/, hash.render(ctx)];
29360
29419
  case 2:
@@ -29474,7 +29533,7 @@ var include = {
29474
29533
  },
29475
29534
  render: function (ctx, emitter) {
29476
29535
  var _a, liquid, hash, withVar, renderer, filepath, saved, scope, templates;
29477
- return __generator(this, function (_b) {
29536
+ return __generator$1(this, function (_b) {
29478
29537
  switch (_b.label) {
29479
29538
  case 0:
29480
29539
  _a = this, liquid = _a.liquid, hash = _a.hash, withVar = _a.withVar;
@@ -29582,7 +29641,7 @@ var If = {
29582
29641
  render: function (ctx, emitter) {
29583
29642
  var r, _a, _b, _c, predicate, templates, value, e_1_1;
29584
29643
  var e_1, _d;
29585
- return __generator(this, function (_e) {
29644
+ return __generator$1(this, function (_e) {
29586
29645
  switch (_e.label) {
29587
29646
  case 0:
29588
29647
  r = this.liquid.renderer;
@@ -29653,7 +29712,7 @@ var layout = {
29653
29712
  },
29654
29713
  render: function (ctx, emitter) {
29655
29714
  var _a, liquid, hash, file, renderer, filepath, templates, html, blocks, _b, _c;
29656
- return __generator(this, function (_d) {
29715
+ return __generator$1(this, function (_d) {
29657
29716
  switch (_d.label) {
29658
29717
  case 0:
29659
29718
  _a = this, liquid = _a.liquid, hash = _a.hash, file = _a.file;
@@ -29733,7 +29792,7 @@ var block$1 = {
29733
29792
  },
29734
29793
  render: function (ctx, emitter) {
29735
29794
  var blockRender;
29736
- return __generator(this, function (_a) {
29795
+ return __generator$1(this, function (_a) {
29737
29796
  switch (_a.label) {
29738
29797
  case 0:
29739
29798
  blockRender = this.getBlockRender(ctx);
@@ -29752,7 +29811,7 @@ var block$1 = {
29752
29811
  var _a = this, liquid = _a.liquid, tpls = _a.tpls;
29753
29812
  var renderChild = ctx.getRegister('blocks')[this.block];
29754
29813
  var renderCurrent = function (superBlock, emitter) {
29755
- return __generator(this, function (_a) {
29814
+ return __generator$1(this, function (_a) {
29756
29815
  switch (_a.label) {
29757
29816
  case 0:
29758
29817
  // add {{ block.super }} support when rendering
@@ -29843,7 +29902,7 @@ var tablerow = {
29843
29902
  },
29844
29903
  render: function (ctx, emitter) {
29845
29904
  var collection, _a, hash, offset, limit, cols, r, tablerowloop, scope, idx;
29846
- return __generator(this, function (_b) {
29905
+ return __generator$1(this, function (_b) {
29847
29906
  switch (_b.label) {
29848
29907
  case 0:
29849
29908
  _a = toEnumerable;
@@ -29916,7 +29975,7 @@ var unless = {
29916
29975
  render: function (ctx, emitter) {
29917
29976
  var r, _a, _b, _c, predicate, test_1, templates, value, e_1_1;
29918
29977
  var e_1, _d;
29919
- return __generator(this, function (_e) {
29978
+ return __generator$1(this, function (_e) {
29920
29979
  switch (_e.label) {
29921
29980
  case 0:
29922
29981
  r = this.liquid.renderer;
@@ -29977,7 +30036,7 @@ var echo = {
29977
30036
  },
29978
30037
  render: function (ctx, emitter) {
29979
30038
  var val;
29980
- return __generator(this, function (_a) {
30039
+ return __generator$1(this, function (_a) {
29981
30040
  switch (_a.label) {
29982
30041
  case 0: return [4 /*yield*/, this.value.value(ctx, false)];
29983
30042
  case 1:
@@ -29996,7 +30055,7 @@ var liquid = {
29996
30055
  this.tpls = this.liquid.parser.parseTokens(tokens);
29997
30056
  },
29998
30057
  render: function (ctx, emitter) {
29999
- return __generator(this, function (_a) {
30058
+ return __generator$1(this, function (_a) {
30000
30059
  switch (_a.label) {
30001
30060
  case 0: return [4 /*yield*/, this.liquid.renderer.renderTemplates(this.tpls, ctx, emitter)];
30002
30061
  case 1:
@@ -30083,7 +30142,7 @@ function normalize$1(options) {
30083
30142
  cache = options.cache ? new LRU$1(1024) : undefined;
30084
30143
  options.cache = cache;
30085
30144
  }
30086
- options = __assign(__assign(__assign({}, defaultOptions$1), (options.jekyllInclude ? { dynamicPartials: false } : {})), options);
30145
+ options = __assign$1(__assign$1(__assign$1({}, defaultOptions$1), (options.jekyllInclude ? { dynamicPartials: false } : {})), options);
30087
30146
  if (!options.fs.dirname && options.relativeReference) {
30088
30147
  console.warn('[LiquidJS] `fs.dirname` is required for relativeReference, set relativeReference to `false` to suppress this warning, or provide implementation for `fs.dirname`');
30089
30148
  options.relativeReference = false;
@@ -30154,7 +30213,7 @@ var Context = /** @class */ (function () {
30154
30213
  });
30155
30214
  };
30156
30215
  Context.prototype.getAll = function () {
30157
- return __spreadArray([this.globals, this.environments], __read(this.scopes), false).reduce(function (ctx, val) { return __assign(ctx, val); }, {});
30216
+ return __spreadArray([this.globals, this.environments], __read(this.scopes), false).reduce(function (ctx, val) { return __assign$1(ctx, val); }, {});
30158
30217
  };
30159
30218
  Context.prototype.get = function (paths) {
30160
30219
  var scope = this.findScope(paths[0]);
@@ -30259,7 +30318,7 @@ var Loader = /** @class */ (function () {
30259
30318
  Loader.prototype.lookup = function (file, type, sync, currentFile) {
30260
30319
  var fs, dirs, _a, _b, filepath, _c, e_1_1;
30261
30320
  var e_1, _d;
30262
- return __generator(this, function (_e) {
30321
+ return __generator$1(this, function (_e) {
30263
30322
  switch (_e.label) {
30264
30323
  case 0:
30265
30324
  fs = this.options.fs;
@@ -30304,7 +30363,7 @@ var Loader = /** @class */ (function () {
30304
30363
  Loader.prototype.candidates = function (file, dirs, currentFile, enforceRoot) {
30305
30364
  var _a, fs, extname, referenced, dirs_1, dirs_1_1, dir, e_2_1, dirs_2, dirs_2_1, dir, referenced, e_3_1, filepath;
30306
30365
  var e_2, _b, e_3, _c;
30307
- return __generator(this, function (_d) {
30366
+ return __generator$1(this, function (_d) {
30308
30367
  switch (_d.label) {
30309
30368
  case 0:
30310
30369
  _a = this.options, fs = _a.fs, extname = _a.extname;
@@ -30452,7 +30511,7 @@ var Render = /** @class */ (function () {
30452
30511
  Render.prototype.renderTemplates = function (templates, ctx, emitter) {
30453
30512
  var templates_1, templates_1_1, tpl, html, e_1, err, e_2_1;
30454
30513
  var e_2, _a;
30455
- return __generator(this, function (_b) {
30514
+ return __generator$1(this, function (_b) {
30456
30515
  switch (_b.label) {
30457
30516
  case 0:
30458
30517
  if (!emitter) {
@@ -30526,7 +30585,7 @@ var Tag = /** @class */ (function (_super) {
30526
30585
  }
30527
30586
  Tag.prototype.render = function (ctx, emitter) {
30528
30587
  var hash, impl;
30529
- return __generator(this, function (_a) {
30588
+ return __generator$1(this, function (_a) {
30530
30589
  switch (_a.label) {
30531
30590
  case 0: return [4 /*yield*/, new Hash(this.token.args).render(ctx)];
30532
30591
  case 1:
@@ -30559,7 +30618,7 @@ var Output = /** @class */ (function (_super) {
30559
30618
  }
30560
30619
  Output.prototype.render = function (ctx, emitter) {
30561
30620
  var val;
30562
- return __generator(this, function (_a) {
30621
+ return __generator$1(this, function (_a) {
30563
30622
  switch (_a.label) {
30564
30623
  case 0: return [4 /*yield*/, this.value.value(ctx, false)];
30565
30624
  case 1:
@@ -30580,7 +30639,7 @@ var HTML = /** @class */ (function (_super) {
30580
30639
  return _this;
30581
30640
  }
30582
30641
  HTML.prototype.render = function (ctx, emitter) {
30583
- return __generator(this, function (_a) {
30642
+ return __generator$1(this, function (_a) {
30584
30643
  emitter.write(this.str);
30585
30644
  return [2 /*return*/];
30586
30645
  });
@@ -30630,7 +30689,7 @@ var Parser$2 = /** @class */ (function () {
30630
30689
  Parser.prototype._parseFileCached = function (file, sync, type, currentFile) {
30631
30690
  var key, tpls, task;
30632
30691
  if (type === void 0) { type = LookupType.Root; }
30633
- return __generator(this, function (_a) {
30692
+ return __generator$1(this, function (_a) {
30634
30693
  switch (_a.label) {
30635
30694
  case 0:
30636
30695
  key = this.loader.shouldLoadRelative(file)
@@ -30660,7 +30719,7 @@ var Parser$2 = /** @class */ (function () {
30660
30719
  Parser.prototype._parseFile = function (file, sync, type, currentFile) {
30661
30720
  var filepath, _a, _b, _c;
30662
30721
  if (type === void 0) { type = LookupType.Root; }
30663
- return __generator(this, function (_d) {
30722
+ return __generator$1(this, function (_d) {
30664
30723
  switch (_d.label) {
30665
30724
  case 0: return [4 /*yield*/, this.loader.lookup(file, type, sync, currentFile)];
30666
30725
  case 1:
@@ -30734,14 +30793,14 @@ var Liquid = /** @class */ (function () {
30734
30793
  return this.renderer.renderTemplates(tpl, ctx);
30735
30794
  };
30736
30795
  Liquid.prototype.render = function (tpl, scope, renderOptions) {
30737
- return __awaiter(this, void 0, void 0, function () {
30738
- return __generator(this, function (_a) {
30739
- return [2 /*return*/, toPromise(this._render(tpl, scope, __assign(__assign({}, renderOptions), { sync: false })))];
30796
+ return __awaiter$1(this, void 0, void 0, function () {
30797
+ return __generator$1(this, function (_a) {
30798
+ return [2 /*return*/, toPromise(this._render(tpl, scope, __assign$1(__assign$1({}, renderOptions), { sync: false })))];
30740
30799
  });
30741
30800
  });
30742
30801
  };
30743
30802
  Liquid.prototype.renderSync = function (tpl, scope, renderOptions) {
30744
- return toValue(this._render(tpl, scope, __assign(__assign({}, renderOptions), { sync: true })));
30803
+ return toValue(this._render(tpl, scope, __assign$1(__assign$1({}, renderOptions), { sync: true })));
30745
30804
  };
30746
30805
  Liquid.prototype.renderToNodeStream = function (tpl, scope, renderOptions) {
30747
30806
  if (renderOptions === void 0) { renderOptions = {}; }
@@ -30753,14 +30812,14 @@ var Liquid = /** @class */ (function () {
30753
30812
  return this._render(tpl, scope, renderOptions);
30754
30813
  };
30755
30814
  Liquid.prototype.parseAndRender = function (html, scope, renderOptions) {
30756
- return __awaiter(this, void 0, void 0, function () {
30757
- return __generator(this, function (_a) {
30758
- return [2 /*return*/, toPromise(this._parseAndRender(html, scope, __assign(__assign({}, renderOptions), { sync: false })))];
30815
+ return __awaiter$1(this, void 0, void 0, function () {
30816
+ return __generator$1(this, function (_a) {
30817
+ return [2 /*return*/, toPromise(this._parseAndRender(html, scope, __assign$1(__assign$1({}, renderOptions), { sync: false })))];
30759
30818
  });
30760
30819
  });
30761
30820
  };
30762
30821
  Liquid.prototype.parseAndRenderSync = function (html, scope, renderOptions) {
30763
- return toValue(this._parseAndRender(html, scope, __assign(__assign({}, renderOptions), { sync: true })));
30822
+ return toValue(this._parseAndRender(html, scope, __assign$1(__assign$1({}, renderOptions), { sync: true })));
30764
30823
  };
30765
30824
  Liquid.prototype._parsePartialFile = function (file, sync, currentFile) {
30766
30825
  return this.parser.parseFile(file, sync, LookupType.Partials, currentFile);
@@ -30769,8 +30828,8 @@ var Liquid = /** @class */ (function () {
30769
30828
  return this.parser.parseFile(file, sync, LookupType.Layouts, currentFile);
30770
30829
  };
30771
30830
  Liquid.prototype.parseFile = function (file) {
30772
- return __awaiter(this, void 0, void 0, function () {
30773
- return __generator(this, function (_a) {
30831
+ return __awaiter$1(this, void 0, void 0, function () {
30832
+ return __generator$1(this, function (_a) {
30774
30833
  return [2 /*return*/, toPromise(this.parser.parseFile(file, false))];
30775
30834
  });
30776
30835
  });
@@ -30779,9 +30838,9 @@ var Liquid = /** @class */ (function () {
30779
30838
  return toValue(this.parser.parseFile(file, true));
30780
30839
  };
30781
30840
  Liquid.prototype.renderFile = function (file, ctx, renderOptions) {
30782
- return __awaiter(this, void 0, void 0, function () {
30841
+ return __awaiter$1(this, void 0, void 0, function () {
30783
30842
  var templates;
30784
- return __generator(this, function (_a) {
30843
+ return __generator$1(this, function (_a) {
30785
30844
  switch (_a.label) {
30786
30845
  case 0: return [4 /*yield*/, this.parseFile(file)];
30787
30846
  case 1:
@@ -30796,9 +30855,9 @@ var Liquid = /** @class */ (function () {
30796
30855
  return this.renderSync(templates, ctx, renderOptions);
30797
30856
  };
30798
30857
  Liquid.prototype.renderFileToNodeStream = function (file, scope, renderOptions) {
30799
- return __awaiter(this, void 0, void 0, function () {
30858
+ return __awaiter$1(this, void 0, void 0, function () {
30800
30859
  var templates;
30801
- return __generator(this, function (_a) {
30860
+ return __generator$1(this, function (_a) {
30802
30861
  switch (_a.label) {
30803
30862
  case 0: return [4 /*yield*/, this.parseFile(file)];
30804
30863
  case 1:
@@ -30813,8 +30872,8 @@ var Liquid = /** @class */ (function () {
30813
30872
  return value.value(ctx, false);
30814
30873
  };
30815
30874
  Liquid.prototype.evalValue = function (str, ctx) {
30816
- return __awaiter(this, void 0, void 0, function () {
30817
- return __generator(this, function (_a) {
30875
+ return __awaiter$1(this, void 0, void 0, function () {
30876
+ return __generator$1(this, function (_a) {
30818
30877
  return [2 /*return*/, toPromise(this._evalValue(str, ctx))];
30819
30878
  });
30820
30879
  });
@@ -30935,7 +30994,7 @@ function pascalCaseTransform(input, index) {
30935
30994
  }
30936
30995
  function pascalCase(input, options) {
30937
30996
  if (options === void 0) { options = {}; }
30938
- return noCase(input, __assign$1({ delimiter: "", transform: pascalCaseTransform }, options));
30997
+ return noCase(input, __assign$2({ delimiter: "", transform: pascalCaseTransform }, options));
30939
30998
  }
30940
30999
 
30941
31000
  function camelCaseTransform(input, index) {
@@ -30945,7 +31004,7 @@ function camelCaseTransform(input, index) {
30945
31004
  }
30946
31005
  function camelCase(input, options) {
30947
31006
  if (options === void 0) { options = {}; }
30948
- return pascalCase(input, __assign$1({ transform: camelCaseTransform }, options));
31007
+ return pascalCase(input, __assign$2({ transform: camelCaseTransform }, options));
30949
31008
  }
30950
31009
 
30951
31010
  /**
@@ -30960,22 +31019,22 @@ function upperCase(str) {
30960
31019
 
30961
31020
  function constantCase(input, options) {
30962
31021
  if (options === void 0) { options = {}; }
30963
- return noCase(input, __assign$1({ delimiter: "_", transform: upperCase }, options));
31022
+ return noCase(input, __assign$2({ delimiter: "_", transform: upperCase }, options));
30964
31023
  }
30965
31024
 
30966
31025
  function dotCase(input, options) {
30967
31026
  if (options === void 0) { options = {}; }
30968
- return noCase(input, __assign$1({ delimiter: "." }, options));
31027
+ return noCase(input, __assign$2({ delimiter: "." }, options));
30969
31028
  }
30970
31029
 
30971
31030
  function paramCase(input, options) {
30972
31031
  if (options === void 0) { options = {}; }
30973
- return dotCase(input, __assign$1({ delimiter: "-" }, options));
31032
+ return dotCase(input, __assign$2({ delimiter: "-" }, options));
30974
31033
  }
30975
31034
 
30976
31035
  function snakeCase(input, options) {
30977
31036
  if (options === void 0) { options = {}; }
30978
- return dotCase(input, __assign$1({ delimiter: "_" }, options));
31037
+ return dotCase(input, __assign$2({ delimiter: "_" }, options));
30979
31038
  }
30980
31039
 
30981
31040
  function randomHex(size) {
@@ -35616,7 +35675,7 @@ function isTaskError(result) {
35616
35675
  function getErrorMessage(result) {
35617
35676
  return Buffer.concat([...result.stdOut, ...result.stdErr]);
35618
35677
  }
35619
- function errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) {
35678
+ function errorDetectionHandler(overwrite, isError = isTaskError, errorMessage = getErrorMessage) {
35620
35679
  return (error, result) => {
35621
35680
  if (!overwrite && error || !isError(result)) {
35622
35681
  return error;
@@ -40129,7 +40188,7 @@ try {
40129
40188
  const POOL_SIZE = 65536;
40130
40189
 
40131
40190
  /** @param {(Blob | Uint8Array)[]} parts */
40132
- async function * toIterator (parts, clone = true) {
40191
+ async function * toIterator (parts, clone) {
40133
40192
  for (const part of parts) {
40134
40193
  if ('stream' in part) {
40135
40194
  yield * (/** @type {AsyncIterableIterator<Uint8Array>} */ (part.stream()));
@@ -40671,7 +40730,7 @@ class Body$1 {
40671
40730
  return formData;
40672
40731
  }
40673
40732
 
40674
- const {toFormData} = await import('./multipart-parser-e253e1bc.js');
40733
+ const {toFormData} = await import('./multipart-parser-afb071c7.js');
40675
40734
  return toFormData(this.body, ct);
40676
40735
  }
40677
40736
 
@@ -53714,14 +53773,14 @@ function async$2(callback)
53714
53773
  }
53715
53774
 
53716
53775
  // API
53717
- var abort_1 = abort$2;
53776
+ var abort_1 = abort$3;
53718
53777
 
53719
53778
  /**
53720
53779
  * Aborts leftover active jobs
53721
53780
  *
53722
53781
  * @param {object} state - current state object
53723
53782
  */
53724
- function abort$2(state)
53783
+ function abort$3(state)
53725
53784
  {
53726
53785
  Object.keys(state.jobs).forEach(clean$1.bind(state));
53727
53786
 
@@ -53744,7 +53803,7 @@ function clean$1(key)
53744
53803
  }
53745
53804
 
53746
53805
  var async$1 = async_1
53747
- , abort$1 = abort_1
53806
+ , abort$2 = abort_1
53748
53807
  ;
53749
53808
 
53750
53809
  // API
@@ -53780,7 +53839,7 @@ function iterate$2(list, iterator, state, callback)
53780
53839
  // don't process rest of the results
53781
53840
  // stop still active jobs
53782
53841
  // and reset the list
53783
- abort$1(state);
53842
+ abort$2(state);
53784
53843
  }
53785
53844
  else
53786
53845
  {
@@ -53857,7 +53916,7 @@ function state(list, sortMethod)
53857
53916
  return initState;
53858
53917
  }
53859
53918
 
53860
- var abort = abort_1
53919
+ var abort$1 = abort_1
53861
53920
  , async = async_1
53862
53921
  ;
53863
53922
 
@@ -53881,7 +53940,7 @@ function terminator$2(callback)
53881
53940
  this.index = this.size;
53882
53941
 
53883
53942
  // abort jobs
53884
- abort(this);
53943
+ abort$1(this);
53885
53944
 
53886
53945
  // send back results we have so far
53887
53946
  async(callback)(null, this.results);
@@ -61718,7 +61777,7 @@ __exportStar(core$4, exports);
61718
61777
  var parseBody$1 = {};
61719
61778
 
61720
61779
  Object.defineProperty(parseBody$1, "__esModule", { value: true });
61721
- const types_1$2 = types$3;
61780
+ const types_1$3 = types$3;
61722
61781
  const parseBody = (response, responseType, parseJson, encoding) => {
61723
61782
  const { rawBody } = response;
61724
61783
  try {
@@ -61731,13 +61790,13 @@ const parseBody = (response, responseType, parseJson, encoding) => {
61731
61790
  if (responseType === 'buffer') {
61732
61791
  return rawBody;
61733
61792
  }
61734
- throw new types_1$2.ParseError({
61793
+ throw new types_1$3.ParseError({
61735
61794
  message: `Unknown body type '${responseType}'`,
61736
61795
  name: 'Error'
61737
61796
  }, response);
61738
61797
  }
61739
61798
  catch (error) {
61740
- throw new types_1$2.ParseError(error, response);
61799
+ throw new types_1$3.ParseError(error, response);
61741
61800
  }
61742
61801
  };
61743
61802
  parseBody$1.default = parseBody;
@@ -61922,10 +61981,10 @@ __exportStar(types$3, exports);
61922
61981
  var createRejection$1 = {};
61923
61982
 
61924
61983
  Object.defineProperty(createRejection$1, "__esModule", { value: true });
61925
- const types_1$1 = types$3;
61984
+ const types_1$2 = types$3;
61926
61985
  function createRejection(error, ...beforeErrorGroups) {
61927
61986
  const promise = (async () => {
61928
- if (error instanceof types_1$1.RequestError) {
61987
+ if (error instanceof types_1$2.RequestError) {
61929
61988
  try {
61930
61989
  for (const hooks of beforeErrorGroups) {
61931
61990
  if (hooks) {
@@ -83506,11 +83565,11 @@ exports.DiscrError = void 0;
83506
83565
 
83507
83566
  Object.defineProperty(discriminator, "__esModule", { value: true });
83508
83567
  const codegen_1 = codegen;
83509
- const types_1 = types$1;
83568
+ const types_1$1 = types$1;
83510
83569
  const compile_1 = compile;
83511
83570
  const util_1 = util$1;
83512
83571
  const error = {
83513
- message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
83572
+ message: ({ params: { discrError, tagName } }) => discrError === types_1$1.DiscrError.Tag
83514
83573
  ? `tag "${tagName}" must be string`
83515
83574
  : `value of tag "${tagName}" must be in oneOf`,
83516
83575
  params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,
@@ -83535,7 +83594,7 @@ const def = {
83535
83594
  throw new Error("discriminator: requires oneOf keyword");
83536
83595
  const valid = gen.let("valid", false);
83537
83596
  const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);
83538
- gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName }));
83597
+ gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1$1.DiscrError.Tag, tag, tagName }));
83539
83598
  cxt.ok(valid);
83540
83599
  function validateMapping() {
83541
83600
  const mapping = getMapping();
@@ -83545,7 +83604,7 @@ const def = {
83545
83604
  gen.assign(valid, applyTagSchema(mapping[tagValue]));
83546
83605
  }
83547
83606
  gen.else();
83548
- cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
83607
+ cxt.error(false, { discrError: types_1$1.DiscrError.Mapping, tag, tagName });
83549
83608
  gen.endIf();
83550
83609
  }
83551
83610
  function applyTagSchema(schemaProp) {
@@ -84268,7 +84327,7 @@ var mimicFn_1 = mimicFn$1;
84268
84327
 
84269
84328
  const mimicFn = mimicFn_1;
84270
84329
 
84271
- var debounceFn = (inputFunction, options = {}) => {
84330
+ var debounceFn = (inputFunction, options) => {
84272
84331
  if (typeof inputFunction !== 'function') {
84273
84332
  throw new TypeError(`Expected the first argument to be a function, got \`${typeof inputFunction}\``);
84274
84333
  }
@@ -170619,7 +170678,7 @@ const printDocASTReducer = {
170619
170678
  * print all items together separated by separator if provided
170620
170679
  */
170621
170680
 
170622
- function join(maybeArray, separator = '') {
170681
+ function join(maybeArray, separator) {
170623
170682
  var _maybeArray$filter$jo;
170624
170683
 
170625
170684
  return (_maybeArray$filter$jo =
@@ -171447,6 +171506,281 @@ var ClientError = /** @class */ (function (_super) {
171447
171506
  }(Error));
171448
171507
  types.ClientError = ClientError;
171449
171508
 
171509
+ var graphqlWs = {};
171510
+
171511
+ var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
171512
+ __assign = Object.assign || function(t) {
171513
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
171514
+ s = arguments[i];
171515
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
171516
+ t[p] = s[p];
171517
+ }
171518
+ return t;
171519
+ };
171520
+ return __assign.apply(this, arguments);
171521
+ };
171522
+ var __awaiter = (commonjsGlobal && commonjsGlobal.__awaiter) || function (thisArg, _arguments, P, generator) {
171523
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
171524
+ return new (P || (P = Promise))(function (resolve, reject) {
171525
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
171526
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
171527
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
171528
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
171529
+ });
171530
+ };
171531
+ var __generator = (commonjsGlobal && commonjsGlobal.__generator) || function (thisArg, body) {
171532
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
171533
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
171534
+ function verb(n) { return function (v) { return step([n, v]); }; }
171535
+ function step(op) {
171536
+ if (f) throw new TypeError("Generator is already executing.");
171537
+ while (_) try {
171538
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
171539
+ if (y = 0, t) op = [op[0] & 2, t.value];
171540
+ switch (op[0]) {
171541
+ case 0: case 1: t = op; break;
171542
+ case 4: _.label++; return { value: op[1], done: false };
171543
+ case 5: _.label++; y = op[1]; op = [0]; continue;
171544
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
171545
+ default:
171546
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
171547
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
171548
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
171549
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
171550
+ if (t[2]) _.ops.pop();
171551
+ _.trys.pop(); continue;
171552
+ }
171553
+ op = body.call(thisArg, _);
171554
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
171555
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
171556
+ }
171557
+ };
171558
+ Object.defineProperty(graphqlWs, "__esModule", { value: true });
171559
+ graphqlWs.GraphQLWebSocketClient = void 0;
171560
+ var types_1 = types;
171561
+ var _1 = dist$1;
171562
+ var CONNECTION_INIT = 'connection_init';
171563
+ var CONNECTION_ACK = 'connection_ack';
171564
+ var PING = 'ping';
171565
+ var PONG = 'pong';
171566
+ var SUBSCRIBE = 'subscribe';
171567
+ var NEXT = 'next';
171568
+ var ERROR = 'error';
171569
+ var COMPLETE = 'complete';
171570
+ var GraphQLWebSocketMessage = /** @class */ (function () {
171571
+ function GraphQLWebSocketMessage(type, payload, id) {
171572
+ this._type = type;
171573
+ this._payload = payload;
171574
+ this._id = id;
171575
+ }
171576
+ Object.defineProperty(GraphQLWebSocketMessage.prototype, "type", {
171577
+ get: function () { return this._type; },
171578
+ enumerable: false,
171579
+ configurable: true
171580
+ });
171581
+ Object.defineProperty(GraphQLWebSocketMessage.prototype, "id", {
171582
+ get: function () { return this._id; },
171583
+ enumerable: false,
171584
+ configurable: true
171585
+ });
171586
+ Object.defineProperty(GraphQLWebSocketMessage.prototype, "payload", {
171587
+ get: function () { return this._payload; },
171588
+ enumerable: false,
171589
+ configurable: true
171590
+ });
171591
+ Object.defineProperty(GraphQLWebSocketMessage.prototype, "text", {
171592
+ get: function () {
171593
+ var result = { type: this.type };
171594
+ if (this.id != null && this.id != undefined)
171595
+ result.id = this.id;
171596
+ if (this.payload != null && this.payload != undefined)
171597
+ result.payload = this.payload;
171598
+ return JSON.stringify(result);
171599
+ },
171600
+ enumerable: false,
171601
+ configurable: true
171602
+ });
171603
+ GraphQLWebSocketMessage.parse = function (data, f) {
171604
+ var _a = JSON.parse(data), type = _a.type, payload = _a.payload, id = _a.id;
171605
+ return new GraphQLWebSocketMessage(type, f(payload), id);
171606
+ };
171607
+ return GraphQLWebSocketMessage;
171608
+ }());
171609
+ var GraphQLWebSocketClient = /** @class */ (function () {
171610
+ function GraphQLWebSocketClient(socket, _a) {
171611
+ var _this = this;
171612
+ var onInit = _a.onInit, onAcknowledged = _a.onAcknowledged, onPing = _a.onPing, onPong = _a.onPong;
171613
+ this.socketState = { acknowledged: false, lastRequestId: 0, subscriptions: {} };
171614
+ this.socket = socket;
171615
+ socket.onopen = function (e) { return __awaiter(_this, void 0, void 0, function () {
171616
+ var _a, _b, _c, _d;
171617
+ return __generator(this, function (_e) {
171618
+ switch (_e.label) {
171619
+ case 0:
171620
+ this.socketState.acknowledged = false;
171621
+ this.socketState.subscriptions = {};
171622
+ _b = (_a = socket).send;
171623
+ _c = ConnectionInit;
171624
+ if (!onInit) return [3 /*break*/, 2];
171625
+ return [4 /*yield*/, onInit()];
171626
+ case 1:
171627
+ _d = _e.sent();
171628
+ return [3 /*break*/, 3];
171629
+ case 2:
171630
+ _d = null;
171631
+ _e.label = 3;
171632
+ case 3:
171633
+ _b.apply(_a, [_c.apply(void 0, [_d]).text]);
171634
+ return [2 /*return*/];
171635
+ }
171636
+ });
171637
+ }); };
171638
+ socket.onclose = function (e) {
171639
+ _this.socketState.acknowledged = false;
171640
+ _this.socketState.subscriptions = {};
171641
+ };
171642
+ socket.onerror = function (e) {
171643
+ console.error(e);
171644
+ };
171645
+ socket.onmessage = function (e) {
171646
+ try {
171647
+ var message = parseMessage(e.data);
171648
+ switch (message.type) {
171649
+ case CONNECTION_ACK: {
171650
+ if (_this.socketState.acknowledged) {
171651
+ console.warn("Duplicate CONNECTION_ACK message ignored");
171652
+ }
171653
+ else {
171654
+ _this.socketState.acknowledged = true;
171655
+ if (onAcknowledged)
171656
+ onAcknowledged(message.payload);
171657
+ }
171658
+ return;
171659
+ }
171660
+ case PING: {
171661
+ if (onPing)
171662
+ onPing(message.payload).then(function (r) { return socket.send(Pong(r).text); });
171663
+ else
171664
+ socket.send(Pong(null).text);
171665
+ return;
171666
+ }
171667
+ case PONG: {
171668
+ if (onPong)
171669
+ onPong(message.payload);
171670
+ return;
171671
+ }
171672
+ }
171673
+ if (!_this.socketState.acknowledged) {
171674
+ // Web-socket connection not acknowledged
171675
+ return;
171676
+ }
171677
+ if (message.id === undefined || message.id === null || !_this.socketState.subscriptions[message.id]) {
171678
+ // No subscription identifer or subscription indentifier is not found
171679
+ return;
171680
+ }
171681
+ var _a = _this.socketState.subscriptions[message.id], query = _a.query, variables = _a.variables, subscriber = _a.subscriber;
171682
+ switch (message.type) {
171683
+ case NEXT: {
171684
+ if (!message.payload.errors && message.payload.data) {
171685
+ subscriber.next && subscriber.next(message.payload.data);
171686
+ }
171687
+ if (message.payload.errors) {
171688
+ subscriber.error && subscriber.error(new types_1.ClientError(__assign(__assign({}, message.payload), { status: 200 }), { query: query, variables: variables }));
171689
+ }
171690
+ else {
171691
+ }
171692
+ return;
171693
+ }
171694
+ case ERROR: {
171695
+ subscriber.error && subscriber.error(new types_1.ClientError({ errors: message.payload, status: 200 }, { query: query, variables: variables }));
171696
+ return;
171697
+ }
171698
+ case COMPLETE: {
171699
+ subscriber.complete && subscriber.complete();
171700
+ delete _this.socketState.subscriptions[message.id];
171701
+ return;
171702
+ }
171703
+ }
171704
+ }
171705
+ catch (e) {
171706
+ // Unexpected errors while handling graphql-ws message
171707
+ console.error(e);
171708
+ socket.close(1006);
171709
+ }
171710
+ socket.close(4400, "Unknown graphql-ws message.");
171711
+ };
171712
+ }
171713
+ GraphQLWebSocketClient.prototype.makeSubscribe = function (query, operationName, variables, subscriber) {
171714
+ var _this = this;
171715
+ var subscriptionId = (this.socketState.lastRequestId++).toString();
171716
+ this.socketState.subscriptions[subscriptionId] = { query: query, variables: variables, subscriber: subscriber };
171717
+ this.socket.send(Subscribe(subscriptionId, { query: query, operationName: operationName, variables: variables }).text);
171718
+ return function () {
171719
+ _this.socket.send(Complete(subscriptionId).text);
171720
+ delete _this.socketState.subscriptions[subscriptionId];
171721
+ };
171722
+ };
171723
+ GraphQLWebSocketClient.prototype.rawRequest = function (query, variables) {
171724
+ var _this = this;
171725
+ return new Promise(function (resolve, reject) {
171726
+ var result;
171727
+ _this.rawSubscribe(query, {
171728
+ next: function (data, extensions) { return (result = { data: data, extensions: extensions }); },
171729
+ error: reject,
171730
+ complete: function () { return resolve(result); },
171731
+ }, variables);
171732
+ });
171733
+ };
171734
+ GraphQLWebSocketClient.prototype.request = function (document, variables) {
171735
+ var _this = this;
171736
+ return new Promise(function (resolve, reject) {
171737
+ var result;
171738
+ _this.subscribe(document, {
171739
+ next: function (data) { return (result = data); },
171740
+ error: reject,
171741
+ complete: function () { return resolve(result); },
171742
+ }, variables);
171743
+ });
171744
+ };
171745
+ GraphQLWebSocketClient.prototype.subscribe = function (document, subscriber, variables) {
171746
+ var _a = _1.resolveRequestDocument(document), query = _a.query, operationName = _a.operationName;
171747
+ return this.makeSubscribe(query, operationName, variables, subscriber);
171748
+ };
171749
+ GraphQLWebSocketClient.prototype.rawSubscribe = function (query, subscriber, variables) {
171750
+ return this.makeSubscribe(query, undefined, variables, subscriber);
171751
+ };
171752
+ GraphQLWebSocketClient.prototype.ping = function (payload) {
171753
+ this.socket.send(Ping(payload).text);
171754
+ };
171755
+ GraphQLWebSocketClient.prototype.close = function () {
171756
+ this.socket.close(1000);
171757
+ };
171758
+ GraphQLWebSocketClient.PROTOCOL = "graphql-transport-ws";
171759
+ return GraphQLWebSocketClient;
171760
+ }());
171761
+ graphqlWs.GraphQLWebSocketClient = GraphQLWebSocketClient;
171762
+ // Helper functions
171763
+ function parseMessage(data, f) {
171764
+ if (f === void 0) { f = function (a) { return a; }; }
171765
+ var m = GraphQLWebSocketMessage.parse(data, f);
171766
+ return m;
171767
+ }
171768
+ function ConnectionInit(payload) {
171769
+ return new GraphQLWebSocketMessage(CONNECTION_INIT, payload);
171770
+ }
171771
+ function Ping(payload) {
171772
+ return new GraphQLWebSocketMessage(PING, payload, undefined);
171773
+ }
171774
+ function Pong(payload) {
171775
+ return new GraphQLWebSocketMessage(PONG, payload, undefined);
171776
+ }
171777
+ function Subscribe(id, payload) {
171778
+ return new GraphQLWebSocketMessage(SUBSCRIBE, payload, id);
171779
+ }
171780
+ function Complete(id) {
171781
+ return new GraphQLWebSocketMessage(COMPLETE, undefined, id);
171782
+ }
171783
+
171450
171784
  (function (exports) {
171451
171785
  var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
171452
171786
  __assign = Object.assign || function(t) {
@@ -171529,7 +171863,7 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
171529
171863
  return (mod && mod.__esModule) ? mod : { "default": mod };
171530
171864
  };
171531
171865
  Object.defineProperty(exports, "__esModule", { value: true });
171532
- exports.gql = exports.batchRequests = exports.request = exports.rawRequest = exports.GraphQLClient = exports.ClientError = void 0;
171866
+ exports.GraphQLWebSocketClient = exports.gql = exports.resolveRequestDocument = exports.batchRequests = exports.request = exports.rawRequest = exports.GraphQLClient = exports.ClientError = void 0;
171533
171867
  var cross_fetch_1 = __importStar(nodePonyfill.exports), CrossFetch = cross_fetch_1;
171534
171868
  var parser_1 = require$$1;
171535
171869
  var printer_1 = require$$2;
@@ -171663,7 +171997,7 @@ var GraphQLClient = /** @class */ (function () {
171663
171997
  url: url,
171664
171998
  query: rawRequestOptions.query,
171665
171999
  variables: rawRequestOptions.variables,
171666
- headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(rawRequestOptions.requestHeaders)),
172000
+ headers: __assign(__assign({}, resolveHeaders(callOrIdentity(headers))), resolveHeaders(rawRequestOptions.requestHeaders)),
171667
172001
  operationName: operationName,
171668
172002
  fetch: fetch,
171669
172003
  method: method,
@@ -171689,7 +172023,7 @@ var GraphQLClient = /** @class */ (function () {
171689
172023
  url: url,
171690
172024
  query: query,
171691
172025
  variables: requestOptions.variables,
171692
- headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(requestOptions.requestHeaders)),
172026
+ headers: __assign(__assign({}, resolveHeaders(callOrIdentity(headers))), resolveHeaders(requestOptions.requestHeaders)),
171693
172027
  operationName: operationName,
171694
172028
  fetch: fetch,
171695
172029
  method: method,
@@ -171726,7 +172060,7 @@ var GraphQLClient = /** @class */ (function () {
171726
172060
  url: url,
171727
172061
  query: queries,
171728
172062
  variables: variables,
171729
- headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(batchRequestOptions.requestHeaders)),
172063
+ headers: __assign(__assign({}, resolveHeaders(callOrIdentity(headers))), resolveHeaders(batchRequestOptions.requestHeaders)),
171730
172064
  operationName: undefined,
171731
172065
  fetch: fetch,
171732
172066
  method: method,
@@ -171772,7 +172106,7 @@ exports.GraphQLClient = GraphQLClient;
171772
172106
  function makeRequest(_a) {
171773
172107
  var url = _a.url, query = _a.query, variables = _a.variables, headers = _a.headers, operationName = _a.operationName, fetch = _a.fetch, _b = _a.method, method = _b === void 0 ? 'POST' : _b, fetchOptions = _a.fetchOptions;
171774
172108
  return __awaiter(this, void 0, void 0, function () {
171775
- var fetcher, isBathchingQuery, response, result, successfullyReceivedData, headers_1, status_1, errorResult;
172109
+ var fetcher, isBathchingQuery, response, result, successfullyReceivedData, successfullyPassedErrorPolicy, headers_1, status_1, rest, data, errorResult;
171776
172110
  return __generator(this, function (_c) {
171777
172111
  switch (_c.label) {
171778
172112
  case 0:
@@ -171796,9 +172130,12 @@ function makeRequest(_a) {
171796
172130
  var data = _a.data;
171797
172131
  return !data;
171798
172132
  }) : !!result.data;
171799
- if (response.ok && !result.errors && successfullyReceivedData) {
172133
+ successfullyPassedErrorPolicy = !result.errors || fetchOptions.errorPolicy === 'all' || fetchOptions.errorPolicy === 'ignore';
172134
+ if (response.ok && successfullyPassedErrorPolicy && successfullyReceivedData) {
171800
172135
  headers_1 = response.headers, status_1 = response.status;
171801
- return [2 /*return*/, __assign(__assign({}, (isBathchingQuery ? { data: result } : result)), { headers: headers_1, status: status_1 })];
172136
+ rest = __rest(result, ["errors"]);
172137
+ data = fetchOptions.errorPolicy === 'ignore' ? rest : result;
172138
+ return [2 /*return*/, __assign(__assign({}, (isBathchingQuery ? { data: data } : data)), { headers: headers_1, status: status_1 })];
171802
172139
  }
171803
172140
  else {
171804
172141
  errorResult = typeof result === 'string' ? { error: result } : result;
@@ -171893,6 +172230,10 @@ function resolveRequestDocument(document) {
171893
172230
  var operationName = extractOperationName(document);
171894
172231
  return { query: printer_1.print(document), operationName: operationName };
171895
172232
  }
172233
+ exports.resolveRequestDocument = resolveRequestDocument;
172234
+ function callOrIdentity(value) {
172235
+ return typeof value === 'function' ? value() : value;
172236
+ }
171896
172237
  /**
171897
172238
  * Convenience passthrough template tag to get the benefits of tooling for the gql template tag. This does not actually parse the input into a GraphQL DocumentNode like graphql-tag package does. It just returns the string with any variables given interpolated. Can save you a bit of performance and having to install another package.
171898
172239
  *
@@ -171924,6 +172265,8 @@ function HeadersInstanceToPlainObject(headers) {
171924
172265
  });
171925
172266
  return o;
171926
172267
  }
172268
+ var graphql_ws_1 = graphqlWs;
172269
+ Object.defineProperty(exports, "GraphQLWebSocketClient", { enumerable: true, get: function () { return graphql_ws_1.GraphQLWebSocketClient; } });
171927
172270
 
171928
172271
  }(dist$1));
171929
172272
 
@@ -171940,16 +172283,32 @@ async function request$1(query, session, variables) {
171940
172283
  const url = adminUrl(session.storeFqdn, version);
171941
172284
  const headers = await buildHeaders(session.token);
171942
172285
  debug$5(`
171943
- Sending Admin GraphQL request:
171944
- ${query}
172286
+ Sending Admin GraphQL request:
172287
+ ${query}
171945
172288
 
171946
- With variables:
171947
- ${variables ? JSON.stringify(variables, null, 2) : ""}
172289
+ With variables:
172290
+ ${variables ? JSON.stringify(variables, null, 2) : ""}
171948
172291
 
171949
- And headers:
171950
- ${sanitizedHeadersOutput(headers)}
172292
+ And headers:
172293
+ ${sanitizedHeadersOutput(headers)}
171951
172294
  `);
171952
- return dist$1.request(url, query, variables, headers);
172295
+ try {
172296
+ const response = await dist$1.request(url, query, variables, headers);
172297
+ return response;
172298
+ } catch (error) {
172299
+ if (error instanceof dist$1.ClientError) {
172300
+ const errorMessage = `
172301
+ The Admin GraphQL API responded unsuccessfully with the HTTP status ${error.response.status} and errors:
172302
+
172303
+ ${colorJson(error.response.errors)}
172304
+ `;
172305
+ const abortError = new Abort(errorMessage);
172306
+ abortError.stack = error.stack;
172307
+ throw abortError;
172308
+ } else {
172309
+ throw error;
172310
+ }
172311
+ }
171953
172312
  }
171954
172313
  async function fetchApiVersion(session) {
171955
172314
  const url = adminUrl(session.storeFqdn, "unstable");
@@ -171984,28 +172343,6 @@ var admin = /*#__PURE__*/Object.freeze({
171984
172343
  request: request$1
171985
172344
  });
171986
172345
 
171987
- async function request(query, token, variables) {
171988
- const fqdn = await partners$1();
171989
- const url = `https://${fqdn}/api/cli/graphql`;
171990
- const headers = await buildHeaders(token);
171991
- debug$5(`
171992
- Sending Partners GraphQL request:
171993
- ${query}
171994
-
171995
- With variables:
171996
- ${variables ? JSON.stringify(variables, null, 2) : ""}
171997
-
171998
- And headers:
171999
- ${sanitizedHeadersOutput(headers)}
172000
- `);
172001
- return dist$1.request(url, query, variables, headers);
172002
- }
172003
-
172004
- var partners = /*#__PURE__*/Object.freeze({
172005
- __proto__: null,
172006
- request: request
172007
- });
172008
-
172009
172346
  const FindOrganizationQuery = dist$1.gql`
172010
172347
  query FindOrganization($id: ID!) {
172011
172348
  organizations(id: $id, first: 1) {
@@ -172245,6 +172582,84 @@ const FindProductVariantQuery = dist$1.gql`
172245
172582
  }
172246
172583
  `;
172247
172584
 
172585
+ const ScriptServiceProxyQuery = dist$1.gql`
172586
+ query ProxyRequest($api_key: String, $query: String!, $variables: String) {
172587
+ scriptServiceProxy(apiKey: $api_key, query: $query, variables: $variables)
172588
+ }
172589
+ `;
172590
+
172591
+ const GetAppFunctionsQuery = dist$1.gql`
172592
+ query GetAppScripts($appKey: String!, $extensionPointName: ExtensionPointName!) {
172593
+ appScripts(appKeys: [$appKey], extensionPointName: $extensionPointName) {
172594
+ uuid
172595
+ title
172596
+ }
172597
+ }
172598
+ `;
172599
+
172600
+ const ModuleUploadUrlGenerateMutation = dist$1.gql`
172601
+ mutation moduleUploadUrlGenerate {
172602
+ moduleUploadUrlGenerate {
172603
+ details {
172604
+ url
172605
+ headers
172606
+ humanizedMaxSize
172607
+ }
172608
+ userErrors {
172609
+ field
172610
+ message
172611
+ }
172612
+ }
172613
+ }
172614
+ `;
172615
+
172616
+ const AppFunctionSetMutation = dist$1.gql`
172617
+ mutation AppScriptSet(
172618
+ $uuid: String
172619
+ $extensionPointName: ExtensionPointName!
172620
+ $title: String!
172621
+ $description: String
172622
+ $force: Boolean
172623
+ $schemaMajorVersion: String
172624
+ $schemaMinorVersion: String
172625
+ $scriptConfigVersion: String!
172626
+ $configurationUi: Boolean!
172627
+ $configurationDefinition: String!
172628
+ $moduleUploadUrl: String!
172629
+ $library: LibraryInput
172630
+ $inputQuery: String
172631
+ ) {
172632
+ appScriptSet(
172633
+ uuid: $uuid
172634
+ extensionPointName: $extensionPointName
172635
+ title: $title
172636
+ description: $description
172637
+ force: $force
172638
+ schemaMajorVersion: $schemaMajorVersion
172639
+ schemaMinorVersion: $schemaMinorVersion
172640
+ scriptConfigVersion: $scriptConfigVersion
172641
+ configurationUi: $configurationUi
172642
+ configurationDefinition: $configurationDefinition
172643
+ moduleUploadUrl: $moduleUploadUrl
172644
+ library: $library
172645
+ inputQuery: $inputQuery
172646
+ ) {
172647
+ userErrors {
172648
+ field
172649
+ message
172650
+ tag
172651
+ }
172652
+ appScript {
172653
+ uuid
172654
+ appKey
172655
+ configSchema
172656
+ extensionPointName
172657
+ title
172658
+ }
172659
+ }
172660
+ }
172661
+ `;
172662
+
172248
172663
  var index = /*#__PURE__*/Object.freeze({
172249
172664
  __proto__: null,
172250
172665
  FindOrganizationQuery: FindOrganizationQuery,
@@ -172260,7 +172675,61 @@ var index = /*#__PURE__*/Object.freeze({
172260
172675
  ExtensionCreateQuery: ExtensionCreateQuery,
172261
172676
  ExtensionSpecificationsQuery: ExtensionSpecificationsQuery,
172262
172677
  AllAppExtensionRegistrationsQuery: AllAppExtensionRegistrationsQuery,
172263
- FindProductVariantQuery: FindProductVariantQuery
172678
+ FindProductVariantQuery: FindProductVariantQuery,
172679
+ ScriptServiceProxyQuery: ScriptServiceProxyQuery,
172680
+ GetAppFunctionsQuery: GetAppFunctionsQuery,
172681
+ ModuleUploadUrlGenerateMutation: ModuleUploadUrlGenerateMutation,
172682
+ AppFunctionSetMutation: AppFunctionSetMutation
172683
+ });
172684
+
172685
+ async function request(query, token, variables) {
172686
+ const fqdn = await partners$1();
172687
+ const url = `https://${fqdn}/api/cli/graphql`;
172688
+ const headers = await buildHeaders(token);
172689
+ debug$5(`
172690
+ Sending Partners GraphQL request:
172691
+ ${query}
172692
+
172693
+ With variables:
172694
+ ${variables ? JSON.stringify(variables, null, 2) : ""}
172695
+
172696
+ And headers:
172697
+ ${sanitizedHeadersOutput(headers)}
172698
+ `);
172699
+ try {
172700
+ const response = await dist$1.request(url, query, variables, headers);
172701
+ return response;
172702
+ } catch (error) {
172703
+ if (error instanceof dist$1.ClientError) {
172704
+ const errorMessage = `
172705
+ The Partners GraphQL API responded unsuccessfully with the HTTP status ${error.response.status} and errors:
172706
+
172707
+ ${colorJson(error.response.errors)}
172708
+ `;
172709
+ const abortError = new Abort(errorMessage);
172710
+ abortError.stack = error.stack;
172711
+ throw abortError;
172712
+ } else {
172713
+ throw error;
172714
+ }
172715
+ }
172716
+ }
172717
+ async function functionProxyRequest(apiKey, query, token, variables) {
172718
+ const proxyVariables = {
172719
+ api_key: apiKey,
172720
+ query,
172721
+ variables: JSON.stringify(variables) || "{}"
172722
+ };
172723
+ const proxyQuery = ScriptServiceProxyQuery;
172724
+ const res = await request(proxyQuery, token, proxyVariables);
172725
+ const json = JSON.parse(res.scriptServiceProxy);
172726
+ return json;
172727
+ }
172728
+
172729
+ var partners = /*#__PURE__*/Object.freeze({
172730
+ __proto__: null,
172731
+ request: request,
172732
+ functionProxyRequest: functionProxyRequest
172264
172733
  });
172265
172734
 
172266
172735
  var api = /*#__PURE__*/Object.freeze({
@@ -172518,9 +172987,10 @@ var semver = /*#__PURE__*/Object.freeze({
172518
172987
  });
172519
172988
 
172520
172989
  const RubyCLIVersion = "2.16.0";
172990
+ const ThemeCheckVersion = "1.10.2";
172521
172991
  const MinBundlerVersion = "2.3.8";
172522
172992
  async function execCLI(args, adminSession) {
172523
- await installDependencies();
172993
+ await installCLIDependencies();
172524
172994
  const env = {
172525
172995
  ...process.env,
172526
172996
  SHOPIFY_CLI_ADMIN_AUTH_TOKEN: adminSession?.token,
@@ -172529,21 +172999,69 @@ async function execCLI(args, adminSession) {
172529
172999
  spawn$1("bundle", ["exec", "shopify"].concat(args), {
172530
173000
  stdio: "inherit",
172531
173001
  shell: true,
172532
- cwd: rubyCLIPath(),
173002
+ cwd: shopifyCLIDirectory(),
172533
173003
  env
172534
173004
  });
172535
173005
  }
172536
- async function installDependencies() {
172537
- const exists = await exists$1(rubyCLIPath());
172538
- const renderer = isUnitTest() || exists ? "silent" : "default";
173006
+ async function execThemeCheckCLI({
173007
+ directories,
173008
+ args,
173009
+ stdout,
173010
+ stderr
173011
+ }) {
173012
+ await installThemeCheckCLIDependencies(stdout);
173013
+ const processes = directories.map(async (directory) => {
173014
+ const files = await out(join$3(directory, "/**/*"));
173015
+ const fileCount = files.filter((file2) => !file2.match(/\.toml$/)).length;
173016
+ if (fileCount === 0)
173017
+ return;
173018
+ const customStderr = new Writable$1({
173019
+ write(chunk, ...args2) {
173020
+ if (chunk.toString("ascii").match(/^Checking/)) {
173021
+ stdout.write(chunk, ...args2);
173022
+ } else {
173023
+ stderr.write(chunk, ...args2);
173024
+ }
173025
+ }
173026
+ });
173027
+ await exec$2("bundle", ["exec", "theme-check"].concat([directory, ...args || []]), {
173028
+ stdout,
173029
+ stderr: customStderr,
173030
+ cwd: themeCheckDirectory()
173031
+ });
173032
+ });
173033
+ return Promise.all(processes);
173034
+ }
173035
+ async function installThemeCheckCLIDependencies(stdout) {
173036
+ const exists = await exists$1(themeCheckDirectory());
173037
+ if (!exists)
173038
+ stdout.write("Installing theme dependencies...");
173039
+ const list = new Listr([
173040
+ {
173041
+ title: "Installing theme dependencies",
173042
+ task: async () => {
173043
+ await validateRubyEnv();
173044
+ await createThemeCheckCLIWorkingDirectory();
173045
+ await createThemeCheckGemfile();
173046
+ await bundleInstallThemeCheck();
173047
+ }
173048
+ }
173049
+ ], { renderer: "silent" });
173050
+ await list.run();
173051
+ if (!exists)
173052
+ stdout.write("Installed theme dependencies!");
173053
+ }
173054
+ async function installCLIDependencies() {
173055
+ const exists = await exists$1(shopifyCLIDirectory());
173056
+ const renderer = exists ? "silent" : "default";
172539
173057
  const list = new Listr([
172540
173058
  {
172541
173059
  title: "Installing theme dependencies",
172542
173060
  task: async () => {
172543
173061
  await validateRubyEnv();
172544
- await createWorkingDirectory();
172545
- await createGemfile();
172546
- await bundleInstall();
173062
+ await createShopifyCLIWorkingDirectory();
173063
+ await createShopifyCLIGemfile();
173064
+ await bundleInstallShopifyCLI();
172547
173065
  }
172548
173066
  }
172549
173067
  ], { renderer });
@@ -172569,25 +173087,41 @@ async function getBundlerVersion() {
172569
173087
  throw new Abort("Bundler not found", "Make sure you have Bundler installed on your system: https://bundler.io/");
172570
173088
  }
172571
173089
  }
172572
- function createWorkingDirectory() {
172573
- return mkdir(rubyCLIPath());
173090
+ function createShopifyCLIWorkingDirectory() {
173091
+ return mkdir(shopifyCLIDirectory());
172574
173092
  }
172575
- async function createGemfile() {
172576
- const gemPath = join$3(rubyCLIPath(), "Gemfile");
173093
+ function createThemeCheckCLIWorkingDirectory() {
173094
+ return mkdir(themeCheckDirectory());
173095
+ }
173096
+ async function createShopifyCLIGemfile() {
173097
+ const gemPath = join$3(shopifyCLIDirectory(), "Gemfile");
172577
173098
  await write$1(gemPath, `source 'https://rubygems.org'
172578
173099
  gem 'shopify-cli', '${RubyCLIVersion}'`);
172579
173100
  }
172580
- async function bundleInstall() {
172581
- await exec$2("bundle", ["config", "set", "--local", "path", rubyCLIPath()], { cwd: rubyCLIPath() });
172582
- await exec$2("bundle", ["install"], { cwd: rubyCLIPath() });
173101
+ async function createThemeCheckGemfile() {
173102
+ const gemPath = join$3(themeCheckDirectory(), "Gemfile");
173103
+ await write$1(gemPath, `source 'https://rubygems.org'
173104
+ gem 'theme-check', '${ThemeCheckVersion}'`);
173105
+ }
173106
+ async function bundleInstallShopifyCLI() {
173107
+ await exec$2("bundle", ["config", "set", "--local", "path", shopifyCLIDirectory()], { cwd: shopifyCLIDirectory() });
173108
+ await exec$2("bundle", ["install"], { cwd: shopifyCLIDirectory() });
173109
+ }
173110
+ async function bundleInstallThemeCheck() {
173111
+ await exec$2("bundle", ["config", "set", "--local", "path", themeCheckDirectory()], { cwd: themeCheckDirectory() });
173112
+ await exec$2("bundle", ["install"], { cwd: themeCheckDirectory() });
172583
173113
  }
172584
- function rubyCLIPath() {
173114
+ function shopifyCLIDirectory() {
172585
173115
  return join$3(constants$2.paths.directories.cache.vendor.path(), "ruby-cli", RubyCLIVersion);
172586
173116
  }
173117
+ function themeCheckDirectory() {
173118
+ return join$3(constants$2.paths.directories.cache.vendor.path(), "theme-check", ThemeCheckVersion);
173119
+ }
172587
173120
 
172588
173121
  var ruby = /*#__PURE__*/Object.freeze({
172589
173122
  __proto__: null,
172590
- execCLI: execCLI
173123
+ execCLI: execCLI,
173124
+ execThemeCheckCLI: execThemeCheckCLI
172591
173125
  });
172592
173126
 
172593
173127
  async function readPackageJSON(directory) {
@@ -172885,6 +173419,12 @@ var dotEnv = /*#__PURE__*/Object.freeze({
172885
173419
  write: write
172886
173420
  });
172887
173421
 
173422
+ var abort = /*#__PURE__*/Object.freeze({
173423
+ __proto__: null,
173424
+ Controller: AbortController$1,
173425
+ Signal: AbortSignal
173426
+ });
173427
+
172888
173428
  const TUNNEL_PLUGINS = ["@shopify/plugin-ngrok"];
172889
173429
  async function lookupTunnelPlugin(plugins) {
172890
173430
  const tunnelPlugin = plugins.find((plugin) => TUNNEL_PLUGINS.includes(plugin.name));
@@ -172899,5 +173439,5 @@ var plugins = /*#__PURE__*/Object.freeze({
172899
173439
  lookupTunnelPlugin: lookupTunnelPlugin
172900
173440
  });
172901
173441
 
172902
- export { npm as A, port as B, cli as C, id as D, temporary as E, FormData$3 as F, dotEnv as G, constants$2 as H, plugins as I, File$1 as a, string as b, github as c, dependency as d, error$j as e, file$1 as f, git as g, os$2 as h, environment as i, session as j, schema$2 as k, toml as l, store as m, api as n, output as o, path$w as p, http$2 as q, archiver as r, system as s, template as t, ui as u, version as v, checksum as w, ruby as x, yaml as y, semver as z };
172903
- //# sourceMappingURL=index-117ce1ba.js.map
173442
+ export { npm as A, port as B, cli as C, id as D, temporary as E, FormData$3 as F, dotEnv as G, abort as H, constants$2 as I, plugins as J, File$1 as a, string as b, github as c, dependency as d, error$j as e, file$1 as f, git as g, os$2 as h, environment as i, session as j, schema$2 as k, toml as l, store as m, api as n, output as o, path$w as p, http$2 as q, archiver as r, system as s, template as t, ui as u, version as v, checksum as w, ruby as x, yaml as y, semver as z };
173443
+ //# sourceMappingURL=index-cc1e1cdd.js.map