@shopify/cli-kit 2.0.14 → 3.0.4

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 = "2.0.14";
12320
+ var version$4 = "3.0.4";
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 = "2.0.14";
12436
+ var version$3 = "3.0.4";
12436
12437
 
12437
- var version$2 = "2.0.14";
12438
+ var version$2 = "3.0.4";
12438
12439
 
12439
- var version$1 = "2.0.14";
12440
+ var version$1 = "3.0.4";
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;
@@ -21123,20 +21178,23 @@ const token = {
21123
21178
  subheading: (value) => {
21124
21179
  return new ContentToken(value, {}, 4 /* SubHeading */);
21125
21180
  },
21181
+ italic: (value) => {
21182
+ return new ContentToken(value, {}, 5 /* Italic */);
21183
+ },
21126
21184
  errorText: (value) => {
21127
- return new ContentToken(value, {}, 5 /* ErrorText */);
21185
+ return new ContentToken(value, {}, 6 /* ErrorText */);
21128
21186
  },
21129
21187
  cyan: (value) => {
21130
- return new ContentToken(value, {}, 7 /* Cyan */);
21188
+ return new ContentToken(value, {}, 8 /* Cyan */);
21131
21189
  },
21132
21190
  yellow: (value) => {
21133
- return new ContentToken(value, {}, 6 /* Yellow */);
21191
+ return new ContentToken(value, {}, 7 /* Yellow */);
21134
21192
  },
21135
21193
  magenta: (value) => {
21136
- return new ContentToken(value, {}, 8 /* Magenta */);
21194
+ return new ContentToken(value, {}, 9 /* Magenta */);
21137
21195
  },
21138
21196
  green: (value) => {
21139
- return new ContentToken(value, {}, 9 /* Green */);
21197
+ return new ContentToken(value, {}, 10 /* Green */);
21140
21198
  },
21141
21199
  command: (dependencyManager, scriptName, ...scriptArgs) => {
21142
21200
  return new ContentToken(formatPackageManagerCommand(dependencyManager, scriptName, scriptArgs), {}, 0 /* Command */);
@@ -21192,19 +21250,22 @@ function content(strings, ...keys) {
21192
21250
  case 4 /* SubHeading */:
21193
21251
  output += colors$9.underline(enumToken.value);
21194
21252
  break;
21195
- case 5 /* ErrorText */:
21253
+ case 5 /* Italic */:
21254
+ output += colors$9.italic(enumToken.value);
21255
+ break;
21256
+ case 6 /* ErrorText */:
21196
21257
  output += colors$9.bold.redBright(enumToken.value);
21197
21258
  break;
21198
- case 6 /* Yellow */:
21259
+ case 7 /* Yellow */:
21199
21260
  output += colors$9.yellow(enumToken.value);
21200
21261
  break;
21201
- case 7 /* Cyan */:
21262
+ case 8 /* Cyan */:
21202
21263
  output += colors$9.cyan(enumToken.value);
21203
21264
  break;
21204
- case 8 /* Magenta */:
21265
+ case 9 /* Magenta */:
21205
21266
  output += colors$9.magenta(enumToken.value);
21206
21267
  break;
21207
- case 9 /* Green */:
21268
+ case 10 /* Green */:
21208
21269
  output += colors$9.green(enumToken.value);
21209
21270
  break;
21210
21271
  }
@@ -21267,6 +21328,9 @@ const warn = (content2) => {
21267
21328
  const newline = () => {
21268
21329
  console.log();
21269
21330
  };
21331
+ const colorJson = (json) => {
21332
+ return colorJson$1(json);
21333
+ };
21270
21334
  const error$k = async (content2) => {
21271
21335
  if (shouldOutput("error")) {
21272
21336
  if (!content2.message) {
@@ -21320,7 +21384,7 @@ function stringifyMessage(message2) {
21320
21384
  return message2;
21321
21385
  }
21322
21386
  }
21323
- const message = (content2, level = "info") => {
21387
+ const message = (content2, level) => {
21324
21388
  if (shouldOutput(level)) {
21325
21389
  consoleLog(stringifyMessage(content2));
21326
21390
  }
@@ -21404,6 +21468,7 @@ var output = /*#__PURE__*/Object.freeze({
21404
21468
  debug: debug$5,
21405
21469
  warn: warn,
21406
21470
  newline: newline,
21471
+ colorJson: colorJson,
21407
21472
  error: error$k,
21408
21473
  stringifyMessage: stringifyMessage,
21409
21474
  concurrent: concurrent,
@@ -21490,15 +21555,15 @@ function __extends$2(d, b) {
21490
21555
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
21491
21556
  }
21492
21557
 
21493
- var __assign$1 = function() {
21494
- __assign$1 = Object.assign || function __assign(t) {
21558
+ var __assign$2 = function() {
21559
+ __assign$2 = Object.assign || function __assign(t) {
21495
21560
  for (var s, i = 1, n = arguments.length; i < n; i++) {
21496
21561
  s = arguments[i];
21497
21562
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
21498
21563
  }
21499
21564
  return t;
21500
21565
  };
21501
- return __assign$1.apply(this, arguments);
21566
+ return __assign$2.apply(this, arguments);
21502
21567
  };
21503
21568
 
21504
21569
  function __values$1(o) {
@@ -26334,14 +26399,14 @@ const prompt = async (questions) => {
26334
26399
  async function nonEmptyDirectoryPrompt(directory) {
26335
26400
  if (await exists$1(directory)) {
26336
26401
  const options = [
26337
- { name: "Yes, remove the files", value: "overwrite" },
26338
- { name: "No, abort the command", value: "abort" }
26402
+ { name: "No, don\u2019t delete the files", value: "abort" },
26403
+ { name: "Yes, delete the files", value: "overwrite" }
26339
26404
  ];
26340
26405
  const relativeDirectory = relative(process.cwd(), directory);
26341
26406
  const questions = {
26342
26407
  type: "select",
26343
26408
  name: "value",
26344
- message: `${relativeDirectory} is not an empty directory. Do you want to remove the existing files and continue?`,
26409
+ message: `${relativeDirectory} is not an empty directory. Do you want to delete the existing files and continue?`,
26345
26410
  choices: options
26346
26411
  };
26347
26412
  const choice = await prompt([questions]);
@@ -26409,18 +26474,18 @@ function __extends$1(d, b) {
26409
26474
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
26410
26475
  }
26411
26476
 
26412
- var __assign = function() {
26413
- __assign = Object.assign || function __assign(t) {
26477
+ var __assign$1 = function() {
26478
+ __assign$1 = Object.assign || function __assign(t) {
26414
26479
  for (var s, i = 1, n = arguments.length; i < n; i++) {
26415
26480
  s = arguments[i];
26416
26481
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
26417
26482
  }
26418
26483
  return t;
26419
26484
  };
26420
- return __assign.apply(this, arguments);
26485
+ return __assign$1.apply(this, arguments);
26421
26486
  };
26422
26487
 
26423
- function __awaiter(thisArg, _arguments, P, generator) {
26488
+ function __awaiter$1(thisArg, _arguments, P, generator) {
26424
26489
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
26425
26490
  return new (P || (P = Promise))(function (resolve, reject) {
26426
26491
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -26430,7 +26495,7 @@ function __awaiter(thisArg, _arguments, P, generator) {
26430
26495
  });
26431
26496
  }
26432
26497
 
26433
- function __generator(thisArg, body) {
26498
+ function __generator$1(thisArg, body) {
26434
26499
  var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
26435
26500
  return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26436
26501
  function verb(n) { return function (v) { return step([n, v]); }; }
@@ -26732,8 +26797,8 @@ function requireResolve (file) {
26732
26797
  var statAsync$1 = promisify$2(stat$6);
26733
26798
  var readFileAsync = promisify$2(readFile$3);
26734
26799
  function exists(filepath) {
26735
- return __awaiter(this, void 0, void 0, function () {
26736
- return __generator(this, function (_a) {
26800
+ return __awaiter$1(this, void 0, void 0, function () {
26801
+ return __generator$1(this, function (_a) {
26737
26802
  switch (_a.label) {
26738
26803
  case 0:
26739
26804
  _a.trys.push([0, 2, , 3]);
@@ -27831,7 +27896,7 @@ var Expression = /** @class */ (function () {
27831
27896
  Expression.prototype.evaluate = function (ctx, lenient) {
27832
27897
  var operands, _a, _b, token, r, l, result, _c, _d, e_1_1;
27833
27898
  var e_1, _e;
27834
- return __generator(this, function (_f) {
27899
+ return __generator$1(this, function (_f) {
27835
27900
  switch (_f.label) {
27836
27901
  case 0:
27837
27902
  assert(ctx, 'unable to evaluate: context not defined');
@@ -27928,7 +27993,7 @@ function evalRangeToken(token, ctx) {
27928
27993
  function toPostfix(tokens) {
27929
27994
  var ops, tokens_1, tokens_1_1, token, e_2_1;
27930
27995
  var e_2, _a;
27931
- return __generator(this, function (_b) {
27996
+ return __generator$1(this, function (_b) {
27932
27997
  switch (_b.label) {
27933
27998
  case 0:
27934
27999
  ops = [];
@@ -28298,7 +28363,7 @@ var Tokenizer = /** @class */ (function () {
28298
28363
  };
28299
28364
  Tokenizer.prototype.readExpressionTokens = function () {
28300
28365
  var operand, operator, operand_1;
28301
- return __generator(this, function (_a) {
28366
+ return __generator$1(this, function (_a) {
28302
28367
  switch (_a.label) {
28303
28368
  case 0:
28304
28369
  operand = this.readValue();
@@ -28638,7 +28703,7 @@ var Tokenizer = /** @class */ (function () {
28638
28703
  };
28639
28704
  Tokenizer.prototype.readFileNameTemplate = function (options) {
28640
28705
  var outputDelimiterLeft, htmlStopStrings, htmlStopStringSet;
28641
- return __generator(this, function (_a) {
28706
+ return __generator$1(this, function (_a) {
28642
28707
  switch (_a.label) {
28643
28708
  case 0:
28644
28709
  outputDelimiterLeft = options.outputDelimiterLeft;
@@ -28772,7 +28837,7 @@ var Hash = /** @class */ (function () {
28772
28837
  Hash.prototype.render = function (ctx) {
28773
28838
  var hash, _a, _b, key, _c, _d, _e, e_2_1;
28774
28839
  var e_2, _f;
28775
- return __generator(this, function (_g) {
28840
+ return __generator$1(this, function (_g) {
28776
28841
  switch (_g.label) {
28777
28842
  case 0:
28778
28843
  hash = {};
@@ -28868,7 +28933,7 @@ var Value = /** @class */ (function () {
28868
28933
  Value.prototype.value = function (ctx, lenient) {
28869
28934
  var val, _a, _b, filter, e_1_1;
28870
28935
  var e_1, _c;
28871
- return __generator(this, function (_d) {
28936
+ return __generator$1(this, function (_d) {
28872
28937
  switch (_d.label) {
28873
28938
  case 0:
28874
28939
  lenient = lenient || (ctx.opts.lenientIf && this.filters.length > 0 && this.filters[0].name === 'default');
@@ -28991,7 +29056,7 @@ var assign = {
28991
29056
  },
28992
29057
  render: function (ctx) {
28993
29058
  var _a, _b;
28994
- return __generator(this, function (_c) {
29059
+ return __generator$1(this, function (_c) {
28995
29060
  switch (_c.label) {
28996
29061
  case 0:
28997
29062
  _a = ctx.bottom();
@@ -29070,7 +29135,7 @@ var For = {
29070
29135
  render: function (ctx, emitter) {
29071
29136
  var r, collection, _a, continueKey, hash, modifiers, scope, collection_1, collection_1_1, item, e_1_1;
29072
29137
  var e_1, _b;
29073
- return __generator(this, function (_c) {
29138
+ return __generator$1(this, function (_c) {
29074
29139
  switch (_c.label) {
29075
29140
  case 0:
29076
29141
  r = this.liquid.renderer;
@@ -29170,7 +29235,7 @@ var capture = {
29170
29235
  },
29171
29236
  render: function (ctx) {
29172
29237
  var r, html;
29173
- return __generator(this, function (_a) {
29238
+ return __generator$1(this, function (_a) {
29174
29239
  switch (_a.label) {
29175
29240
  case 0:
29176
29241
  r = this.liquid.renderer;
@@ -29223,7 +29288,7 @@ var Case = {
29223
29288
  render: function (ctx, emitter) {
29224
29289
  var r, cond, _a, _b, _c, branch, val, e_1_1;
29225
29290
  var e_1, _d;
29226
- return __generator(this, function (_e) {
29291
+ return __generator$1(this, function (_e) {
29227
29292
  switch (_e.label) {
29228
29293
  case 0:
29229
29294
  r = this.liquid.renderer;
@@ -29338,7 +29403,7 @@ var render = {
29338
29403
  render: function (ctx, emitter) {
29339
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;
29340
29405
  var e_1, _f;
29341
- return __generator(this, function (_g) {
29406
+ return __generator$1(this, function (_g) {
29342
29407
  switch (_g.label) {
29343
29408
  case 0:
29344
29409
  _a = this, liquid = _a.liquid, hash = _a.hash;
@@ -29348,7 +29413,7 @@ var render = {
29348
29413
  assert(filepath, function () { return "illegal filename \"".concat(filepath, "\""); });
29349
29414
  childCtx = new Context({}, ctx.opts, { sync: ctx.sync, globals: ctx.globals, strictVariables: ctx.strictVariables });
29350
29415
  scope = childCtx.bottom();
29351
- _b = __assign;
29416
+ _b = __assign$1;
29352
29417
  _c = [scope];
29353
29418
  return [4 /*yield*/, hash.render(ctx)];
29354
29419
  case 2:
@@ -29468,7 +29533,7 @@ var include = {
29468
29533
  },
29469
29534
  render: function (ctx, emitter) {
29470
29535
  var _a, liquid, hash, withVar, renderer, filepath, saved, scope, templates;
29471
- return __generator(this, function (_b) {
29536
+ return __generator$1(this, function (_b) {
29472
29537
  switch (_b.label) {
29473
29538
  case 0:
29474
29539
  _a = this, liquid = _a.liquid, hash = _a.hash, withVar = _a.withVar;
@@ -29576,7 +29641,7 @@ var If = {
29576
29641
  render: function (ctx, emitter) {
29577
29642
  var r, _a, _b, _c, predicate, templates, value, e_1_1;
29578
29643
  var e_1, _d;
29579
- return __generator(this, function (_e) {
29644
+ return __generator$1(this, function (_e) {
29580
29645
  switch (_e.label) {
29581
29646
  case 0:
29582
29647
  r = this.liquid.renderer;
@@ -29647,7 +29712,7 @@ var layout = {
29647
29712
  },
29648
29713
  render: function (ctx, emitter) {
29649
29714
  var _a, liquid, hash, file, renderer, filepath, templates, html, blocks, _b, _c;
29650
- return __generator(this, function (_d) {
29715
+ return __generator$1(this, function (_d) {
29651
29716
  switch (_d.label) {
29652
29717
  case 0:
29653
29718
  _a = this, liquid = _a.liquid, hash = _a.hash, file = _a.file;
@@ -29727,7 +29792,7 @@ var block$1 = {
29727
29792
  },
29728
29793
  render: function (ctx, emitter) {
29729
29794
  var blockRender;
29730
- return __generator(this, function (_a) {
29795
+ return __generator$1(this, function (_a) {
29731
29796
  switch (_a.label) {
29732
29797
  case 0:
29733
29798
  blockRender = this.getBlockRender(ctx);
@@ -29746,7 +29811,7 @@ var block$1 = {
29746
29811
  var _a = this, liquid = _a.liquid, tpls = _a.tpls;
29747
29812
  var renderChild = ctx.getRegister('blocks')[this.block];
29748
29813
  var renderCurrent = function (superBlock, emitter) {
29749
- return __generator(this, function (_a) {
29814
+ return __generator$1(this, function (_a) {
29750
29815
  switch (_a.label) {
29751
29816
  case 0:
29752
29817
  // add {{ block.super }} support when rendering
@@ -29837,7 +29902,7 @@ var tablerow = {
29837
29902
  },
29838
29903
  render: function (ctx, emitter) {
29839
29904
  var collection, _a, hash, offset, limit, cols, r, tablerowloop, scope, idx;
29840
- return __generator(this, function (_b) {
29905
+ return __generator$1(this, function (_b) {
29841
29906
  switch (_b.label) {
29842
29907
  case 0:
29843
29908
  _a = toEnumerable;
@@ -29910,7 +29975,7 @@ var unless = {
29910
29975
  render: function (ctx, emitter) {
29911
29976
  var r, _a, _b, _c, predicate, test_1, templates, value, e_1_1;
29912
29977
  var e_1, _d;
29913
- return __generator(this, function (_e) {
29978
+ return __generator$1(this, function (_e) {
29914
29979
  switch (_e.label) {
29915
29980
  case 0:
29916
29981
  r = this.liquid.renderer;
@@ -29971,7 +30036,7 @@ var echo = {
29971
30036
  },
29972
30037
  render: function (ctx, emitter) {
29973
30038
  var val;
29974
- return __generator(this, function (_a) {
30039
+ return __generator$1(this, function (_a) {
29975
30040
  switch (_a.label) {
29976
30041
  case 0: return [4 /*yield*/, this.value.value(ctx, false)];
29977
30042
  case 1:
@@ -29990,7 +30055,7 @@ var liquid = {
29990
30055
  this.tpls = this.liquid.parser.parseTokens(tokens);
29991
30056
  },
29992
30057
  render: function (ctx, emitter) {
29993
- return __generator(this, function (_a) {
30058
+ return __generator$1(this, function (_a) {
29994
30059
  switch (_a.label) {
29995
30060
  case 0: return [4 /*yield*/, this.liquid.renderer.renderTemplates(this.tpls, ctx, emitter)];
29996
30061
  case 1:
@@ -30077,7 +30142,7 @@ function normalize$1(options) {
30077
30142
  cache = options.cache ? new LRU$1(1024) : undefined;
30078
30143
  options.cache = cache;
30079
30144
  }
30080
- 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);
30081
30146
  if (!options.fs.dirname && options.relativeReference) {
30082
30147
  console.warn('[LiquidJS] `fs.dirname` is required for relativeReference, set relativeReference to `false` to suppress this warning, or provide implementation for `fs.dirname`');
30083
30148
  options.relativeReference = false;
@@ -30148,7 +30213,7 @@ var Context = /** @class */ (function () {
30148
30213
  });
30149
30214
  };
30150
30215
  Context.prototype.getAll = function () {
30151
- 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); }, {});
30152
30217
  };
30153
30218
  Context.prototype.get = function (paths) {
30154
30219
  var scope = this.findScope(paths[0]);
@@ -30253,7 +30318,7 @@ var Loader = /** @class */ (function () {
30253
30318
  Loader.prototype.lookup = function (file, type, sync, currentFile) {
30254
30319
  var fs, dirs, _a, _b, filepath, _c, e_1_1;
30255
30320
  var e_1, _d;
30256
- return __generator(this, function (_e) {
30321
+ return __generator$1(this, function (_e) {
30257
30322
  switch (_e.label) {
30258
30323
  case 0:
30259
30324
  fs = this.options.fs;
@@ -30298,7 +30363,7 @@ var Loader = /** @class */ (function () {
30298
30363
  Loader.prototype.candidates = function (file, dirs, currentFile, enforceRoot) {
30299
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;
30300
30365
  var e_2, _b, e_3, _c;
30301
- return __generator(this, function (_d) {
30366
+ return __generator$1(this, function (_d) {
30302
30367
  switch (_d.label) {
30303
30368
  case 0:
30304
30369
  _a = this.options, fs = _a.fs, extname = _a.extname;
@@ -30446,7 +30511,7 @@ var Render = /** @class */ (function () {
30446
30511
  Render.prototype.renderTemplates = function (templates, ctx, emitter) {
30447
30512
  var templates_1, templates_1_1, tpl, html, e_1, err, e_2_1;
30448
30513
  var e_2, _a;
30449
- return __generator(this, function (_b) {
30514
+ return __generator$1(this, function (_b) {
30450
30515
  switch (_b.label) {
30451
30516
  case 0:
30452
30517
  if (!emitter) {
@@ -30520,7 +30585,7 @@ var Tag = /** @class */ (function (_super) {
30520
30585
  }
30521
30586
  Tag.prototype.render = function (ctx, emitter) {
30522
30587
  var hash, impl;
30523
- return __generator(this, function (_a) {
30588
+ return __generator$1(this, function (_a) {
30524
30589
  switch (_a.label) {
30525
30590
  case 0: return [4 /*yield*/, new Hash(this.token.args).render(ctx)];
30526
30591
  case 1:
@@ -30553,7 +30618,7 @@ var Output = /** @class */ (function (_super) {
30553
30618
  }
30554
30619
  Output.prototype.render = function (ctx, emitter) {
30555
30620
  var val;
30556
- return __generator(this, function (_a) {
30621
+ return __generator$1(this, function (_a) {
30557
30622
  switch (_a.label) {
30558
30623
  case 0: return [4 /*yield*/, this.value.value(ctx, false)];
30559
30624
  case 1:
@@ -30574,7 +30639,7 @@ var HTML = /** @class */ (function (_super) {
30574
30639
  return _this;
30575
30640
  }
30576
30641
  HTML.prototype.render = function (ctx, emitter) {
30577
- return __generator(this, function (_a) {
30642
+ return __generator$1(this, function (_a) {
30578
30643
  emitter.write(this.str);
30579
30644
  return [2 /*return*/];
30580
30645
  });
@@ -30624,7 +30689,7 @@ var Parser$2 = /** @class */ (function () {
30624
30689
  Parser.prototype._parseFileCached = function (file, sync, type, currentFile) {
30625
30690
  var key, tpls, task;
30626
30691
  if (type === void 0) { type = LookupType.Root; }
30627
- return __generator(this, function (_a) {
30692
+ return __generator$1(this, function (_a) {
30628
30693
  switch (_a.label) {
30629
30694
  case 0:
30630
30695
  key = this.loader.shouldLoadRelative(file)
@@ -30654,7 +30719,7 @@ var Parser$2 = /** @class */ (function () {
30654
30719
  Parser.prototype._parseFile = function (file, sync, type, currentFile) {
30655
30720
  var filepath, _a, _b, _c;
30656
30721
  if (type === void 0) { type = LookupType.Root; }
30657
- return __generator(this, function (_d) {
30722
+ return __generator$1(this, function (_d) {
30658
30723
  switch (_d.label) {
30659
30724
  case 0: return [4 /*yield*/, this.loader.lookup(file, type, sync, currentFile)];
30660
30725
  case 1:
@@ -30728,14 +30793,14 @@ var Liquid = /** @class */ (function () {
30728
30793
  return this.renderer.renderTemplates(tpl, ctx);
30729
30794
  };
30730
30795
  Liquid.prototype.render = function (tpl, scope, renderOptions) {
30731
- return __awaiter(this, void 0, void 0, function () {
30732
- return __generator(this, function (_a) {
30733
- 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 })))];
30734
30799
  });
30735
30800
  });
30736
30801
  };
30737
30802
  Liquid.prototype.renderSync = function (tpl, scope, renderOptions) {
30738
- 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 })));
30739
30804
  };
30740
30805
  Liquid.prototype.renderToNodeStream = function (tpl, scope, renderOptions) {
30741
30806
  if (renderOptions === void 0) { renderOptions = {}; }
@@ -30747,14 +30812,14 @@ var Liquid = /** @class */ (function () {
30747
30812
  return this._render(tpl, scope, renderOptions);
30748
30813
  };
30749
30814
  Liquid.prototype.parseAndRender = function (html, scope, renderOptions) {
30750
- return __awaiter(this, void 0, void 0, function () {
30751
- return __generator(this, function (_a) {
30752
- 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 })))];
30753
30818
  });
30754
30819
  });
30755
30820
  };
30756
30821
  Liquid.prototype.parseAndRenderSync = function (html, scope, renderOptions) {
30757
- 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 })));
30758
30823
  };
30759
30824
  Liquid.prototype._parsePartialFile = function (file, sync, currentFile) {
30760
30825
  return this.parser.parseFile(file, sync, LookupType.Partials, currentFile);
@@ -30763,8 +30828,8 @@ var Liquid = /** @class */ (function () {
30763
30828
  return this.parser.parseFile(file, sync, LookupType.Layouts, currentFile);
30764
30829
  };
30765
30830
  Liquid.prototype.parseFile = function (file) {
30766
- return __awaiter(this, void 0, void 0, function () {
30767
- return __generator(this, function (_a) {
30831
+ return __awaiter$1(this, void 0, void 0, function () {
30832
+ return __generator$1(this, function (_a) {
30768
30833
  return [2 /*return*/, toPromise(this.parser.parseFile(file, false))];
30769
30834
  });
30770
30835
  });
@@ -30773,9 +30838,9 @@ var Liquid = /** @class */ (function () {
30773
30838
  return toValue(this.parser.parseFile(file, true));
30774
30839
  };
30775
30840
  Liquid.prototype.renderFile = function (file, ctx, renderOptions) {
30776
- return __awaiter(this, void 0, void 0, function () {
30841
+ return __awaiter$1(this, void 0, void 0, function () {
30777
30842
  var templates;
30778
- return __generator(this, function (_a) {
30843
+ return __generator$1(this, function (_a) {
30779
30844
  switch (_a.label) {
30780
30845
  case 0: return [4 /*yield*/, this.parseFile(file)];
30781
30846
  case 1:
@@ -30790,9 +30855,9 @@ var Liquid = /** @class */ (function () {
30790
30855
  return this.renderSync(templates, ctx, renderOptions);
30791
30856
  };
30792
30857
  Liquid.prototype.renderFileToNodeStream = function (file, scope, renderOptions) {
30793
- return __awaiter(this, void 0, void 0, function () {
30858
+ return __awaiter$1(this, void 0, void 0, function () {
30794
30859
  var templates;
30795
- return __generator(this, function (_a) {
30860
+ return __generator$1(this, function (_a) {
30796
30861
  switch (_a.label) {
30797
30862
  case 0: return [4 /*yield*/, this.parseFile(file)];
30798
30863
  case 1:
@@ -30807,8 +30872,8 @@ var Liquid = /** @class */ (function () {
30807
30872
  return value.value(ctx, false);
30808
30873
  };
30809
30874
  Liquid.prototype.evalValue = function (str, ctx) {
30810
- return __awaiter(this, void 0, void 0, function () {
30811
- return __generator(this, function (_a) {
30875
+ return __awaiter$1(this, void 0, void 0, function () {
30876
+ return __generator$1(this, function (_a) {
30812
30877
  return [2 /*return*/, toPromise(this._evalValue(str, ctx))];
30813
30878
  });
30814
30879
  });
@@ -30929,7 +30994,7 @@ function pascalCaseTransform(input, index) {
30929
30994
  }
30930
30995
  function pascalCase(input, options) {
30931
30996
  if (options === void 0) { options = {}; }
30932
- return noCase(input, __assign$1({ delimiter: "", transform: pascalCaseTransform }, options));
30997
+ return noCase(input, __assign$2({ delimiter: "", transform: pascalCaseTransform }, options));
30933
30998
  }
30934
30999
 
30935
31000
  function camelCaseTransform(input, index) {
@@ -30939,7 +31004,7 @@ function camelCaseTransform(input, index) {
30939
31004
  }
30940
31005
  function camelCase(input, options) {
30941
31006
  if (options === void 0) { options = {}; }
30942
- return pascalCase(input, __assign$1({ transform: camelCaseTransform }, options));
31007
+ return pascalCase(input, __assign$2({ transform: camelCaseTransform }, options));
30943
31008
  }
30944
31009
 
30945
31010
  /**
@@ -30954,22 +31019,22 @@ function upperCase(str) {
30954
31019
 
30955
31020
  function constantCase(input, options) {
30956
31021
  if (options === void 0) { options = {}; }
30957
- return noCase(input, __assign$1({ delimiter: "_", transform: upperCase }, options));
31022
+ return noCase(input, __assign$2({ delimiter: "_", transform: upperCase }, options));
30958
31023
  }
30959
31024
 
30960
31025
  function dotCase(input, options) {
30961
31026
  if (options === void 0) { options = {}; }
30962
- return noCase(input, __assign$1({ delimiter: "." }, options));
31027
+ return noCase(input, __assign$2({ delimiter: "." }, options));
30963
31028
  }
30964
31029
 
30965
31030
  function paramCase(input, options) {
30966
31031
  if (options === void 0) { options = {}; }
30967
- return dotCase(input, __assign$1({ delimiter: "-" }, options));
31032
+ return dotCase(input, __assign$2({ delimiter: "-" }, options));
30968
31033
  }
30969
31034
 
30970
31035
  function snakeCase(input, options) {
30971
31036
  if (options === void 0) { options = {}; }
30972
- return dotCase(input, __assign$1({ delimiter: "_" }, options));
31037
+ return dotCase(input, __assign$2({ delimiter: "_" }, options));
30973
31038
  }
30974
31039
 
30975
31040
  function randomHex(size) {
@@ -35610,7 +35675,7 @@ function isTaskError(result) {
35610
35675
  function getErrorMessage(result) {
35611
35676
  return Buffer.concat([...result.stdOut, ...result.stdErr]);
35612
35677
  }
35613
- function errorDetectionHandler(overwrite = false, isError = isTaskError, errorMessage = getErrorMessage) {
35678
+ function errorDetectionHandler(overwrite, isError = isTaskError, errorMessage = getErrorMessage) {
35614
35679
  return (error, result) => {
35615
35680
  if (!overwrite && error || !isError(result)) {
35616
35681
  return error;
@@ -40123,7 +40188,7 @@ try {
40123
40188
  const POOL_SIZE = 65536;
40124
40189
 
40125
40190
  /** @param {(Blob | Uint8Array)[]} parts */
40126
- async function * toIterator (parts, clone = true) {
40191
+ async function * toIterator (parts, clone) {
40127
40192
  for (const part of parts) {
40128
40193
  if ('stream' in part) {
40129
40194
  yield * (/** @type {AsyncIterableIterator<Uint8Array>} */ (part.stream()));
@@ -40665,7 +40730,7 @@ class Body$1 {
40665
40730
  return formData;
40666
40731
  }
40667
40732
 
40668
- const {toFormData} = await import('./multipart-parser-e0ecbeb6.js');
40733
+ const {toFormData} = await import('./multipart-parser-b4bae580.js');
40669
40734
  return toFormData(this.body, ct);
40670
40735
  }
40671
40736
 
@@ -53708,14 +53773,14 @@ function async$2(callback)
53708
53773
  }
53709
53774
 
53710
53775
  // API
53711
- var abort_1 = abort$2;
53776
+ var abort_1 = abort$3;
53712
53777
 
53713
53778
  /**
53714
53779
  * Aborts leftover active jobs
53715
53780
  *
53716
53781
  * @param {object} state - current state object
53717
53782
  */
53718
- function abort$2(state)
53783
+ function abort$3(state)
53719
53784
  {
53720
53785
  Object.keys(state.jobs).forEach(clean$1.bind(state));
53721
53786
 
@@ -53738,7 +53803,7 @@ function clean$1(key)
53738
53803
  }
53739
53804
 
53740
53805
  var async$1 = async_1
53741
- , abort$1 = abort_1
53806
+ , abort$2 = abort_1
53742
53807
  ;
53743
53808
 
53744
53809
  // API
@@ -53774,7 +53839,7 @@ function iterate$2(list, iterator, state, callback)
53774
53839
  // don't process rest of the results
53775
53840
  // stop still active jobs
53776
53841
  // and reset the list
53777
- abort$1(state);
53842
+ abort$2(state);
53778
53843
  }
53779
53844
  else
53780
53845
  {
@@ -53851,7 +53916,7 @@ function state(list, sortMethod)
53851
53916
  return initState;
53852
53917
  }
53853
53918
 
53854
- var abort = abort_1
53919
+ var abort$1 = abort_1
53855
53920
  , async = async_1
53856
53921
  ;
53857
53922
 
@@ -53875,7 +53940,7 @@ function terminator$2(callback)
53875
53940
  this.index = this.size;
53876
53941
 
53877
53942
  // abort jobs
53878
- abort(this);
53943
+ abort$1(this);
53879
53944
 
53880
53945
  // send back results we have so far
53881
53946
  async(callback)(null, this.results);
@@ -54584,7 +54649,8 @@ function parseRepoUrl(src) {
54584
54649
  const subDirectory = match[6]?.slice(1);
54585
54650
  const ref = match[7] || "HEAD";
54586
54651
  const ssh = `git@${normalizedSite}:${user}/${name}`;
54587
- return { site: normalizedSite, user, name, ref, subDirectory, ssh };
54652
+ const http = `https://${normalizedSite}/${user}/${name}`;
54653
+ return { site: normalizedSite, user, name, ref, subDirectory, ssh, http };
54588
54654
  }
54589
54655
 
54590
54656
  var github = /*#__PURE__*/Object.freeze({
@@ -61711,7 +61777,7 @@ __exportStar(core$4, exports);
61711
61777
  var parseBody$1 = {};
61712
61778
 
61713
61779
  Object.defineProperty(parseBody$1, "__esModule", { value: true });
61714
- const types_1$2 = types$3;
61780
+ const types_1$3 = types$3;
61715
61781
  const parseBody = (response, responseType, parseJson, encoding) => {
61716
61782
  const { rawBody } = response;
61717
61783
  try {
@@ -61724,13 +61790,13 @@ const parseBody = (response, responseType, parseJson, encoding) => {
61724
61790
  if (responseType === 'buffer') {
61725
61791
  return rawBody;
61726
61792
  }
61727
- throw new types_1$2.ParseError({
61793
+ throw new types_1$3.ParseError({
61728
61794
  message: `Unknown body type '${responseType}'`,
61729
61795
  name: 'Error'
61730
61796
  }, response);
61731
61797
  }
61732
61798
  catch (error) {
61733
- throw new types_1$2.ParseError(error, response);
61799
+ throw new types_1$3.ParseError(error, response);
61734
61800
  }
61735
61801
  };
61736
61802
  parseBody$1.default = parseBody;
@@ -61915,10 +61981,10 @@ __exportStar(types$3, exports);
61915
61981
  var createRejection$1 = {};
61916
61982
 
61917
61983
  Object.defineProperty(createRejection$1, "__esModule", { value: true });
61918
- const types_1$1 = types$3;
61984
+ const types_1$2 = types$3;
61919
61985
  function createRejection(error, ...beforeErrorGroups) {
61920
61986
  const promise = (async () => {
61921
- if (error instanceof types_1$1.RequestError) {
61987
+ if (error instanceof types_1$2.RequestError) {
61922
61988
  try {
61923
61989
  for (const hooks of beforeErrorGroups) {
61924
61990
  if (hooks) {
@@ -83499,11 +83565,11 @@ exports.DiscrError = void 0;
83499
83565
 
83500
83566
  Object.defineProperty(discriminator, "__esModule", { value: true });
83501
83567
  const codegen_1 = codegen;
83502
- const types_1 = types$1;
83568
+ const types_1$1 = types$1;
83503
83569
  const compile_1 = compile;
83504
83570
  const util_1 = util$1;
83505
83571
  const error = {
83506
- message: ({ params: { discrError, tagName } }) => discrError === types_1.DiscrError.Tag
83572
+ message: ({ params: { discrError, tagName } }) => discrError === types_1$1.DiscrError.Tag
83507
83573
  ? `tag "${tagName}" must be string`
83508
83574
  : `value of tag "${tagName}" must be in oneOf`,
83509
83575
  params: ({ params: { discrError, tag, tagName } }) => (0, codegen_1._) `{error: ${discrError}, tag: ${tagName}, tagValue: ${tag}}`,
@@ -83528,7 +83594,7 @@ const def = {
83528
83594
  throw new Error("discriminator: requires oneOf keyword");
83529
83595
  const valid = gen.let("valid", false);
83530
83596
  const tag = gen.const("tag", (0, codegen_1._) `${data}${(0, codegen_1.getProperty)(tagName)}`);
83531
- 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 }));
83532
83598
  cxt.ok(valid);
83533
83599
  function validateMapping() {
83534
83600
  const mapping = getMapping();
@@ -83538,7 +83604,7 @@ const def = {
83538
83604
  gen.assign(valid, applyTagSchema(mapping[tagValue]));
83539
83605
  }
83540
83606
  gen.else();
83541
- cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName });
83607
+ cxt.error(false, { discrError: types_1$1.DiscrError.Mapping, tag, tagName });
83542
83608
  gen.endIf();
83543
83609
  }
83544
83610
  function applyTagSchema(schemaProp) {
@@ -84261,7 +84327,7 @@ var mimicFn_1 = mimicFn$1;
84261
84327
 
84262
84328
  const mimicFn = mimicFn_1;
84263
84329
 
84264
- var debounceFn = (inputFunction, options = {}) => {
84330
+ var debounceFn = (inputFunction, options) => {
84265
84331
  if (typeof inputFunction !== 'function') {
84266
84332
  throw new TypeError(`Expected the first argument to be a function, got \`${typeof inputFunction}\``);
84267
84333
  }
@@ -84833,6 +84899,7 @@ function setAppInfo(options) {
84833
84899
  apps[index] = {
84834
84900
  appId: options.appId,
84835
84901
  directory: options.directory,
84902
+ title: options.title ?? app.title,
84836
84903
  storeFqdn: options.storeFqdn ?? app.storeFqdn,
84837
84904
  orgId: options.orgId ?? app.orgId
84838
84905
  };
@@ -170611,7 +170678,7 @@ const printDocASTReducer = {
170611
170678
  * print all items together separated by separator if provided
170612
170679
  */
170613
170680
 
170614
- function join(maybeArray, separator = '') {
170681
+ function join(maybeArray, separator) {
170615
170682
  var _maybeArray$filter$jo;
170616
170683
 
170617
170684
  return (_maybeArray$filter$jo =
@@ -171439,6 +171506,281 @@ var ClientError = /** @class */ (function (_super) {
171439
171506
  }(Error));
171440
171507
  types.ClientError = ClientError;
171441
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
+
171442
171784
  (function (exports) {
171443
171785
  var __assign = (commonjsGlobal && commonjsGlobal.__assign) || function () {
171444
171786
  __assign = Object.assign || function(t) {
@@ -171521,7 +171863,7 @@ var __importDefault = (commonjsGlobal && commonjsGlobal.__importDefault) || func
171521
171863
  return (mod && mod.__esModule) ? mod : { "default": mod };
171522
171864
  };
171523
171865
  Object.defineProperty(exports, "__esModule", { value: true });
171524
- 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;
171525
171867
  var cross_fetch_1 = __importStar(nodePonyfill.exports), CrossFetch = cross_fetch_1;
171526
171868
  var parser_1 = require$$1;
171527
171869
  var printer_1 = require$$2;
@@ -171655,7 +171997,7 @@ var GraphQLClient = /** @class */ (function () {
171655
171997
  url: url,
171656
171998
  query: rawRequestOptions.query,
171657
171999
  variables: rawRequestOptions.variables,
171658
- headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(rawRequestOptions.requestHeaders)),
172000
+ headers: __assign(__assign({}, resolveHeaders(callOrIdentity(headers))), resolveHeaders(rawRequestOptions.requestHeaders)),
171659
172001
  operationName: operationName,
171660
172002
  fetch: fetch,
171661
172003
  method: method,
@@ -171681,7 +172023,7 @@ var GraphQLClient = /** @class */ (function () {
171681
172023
  url: url,
171682
172024
  query: query,
171683
172025
  variables: requestOptions.variables,
171684
- headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(requestOptions.requestHeaders)),
172026
+ headers: __assign(__assign({}, resolveHeaders(callOrIdentity(headers))), resolveHeaders(requestOptions.requestHeaders)),
171685
172027
  operationName: operationName,
171686
172028
  fetch: fetch,
171687
172029
  method: method,
@@ -171718,7 +172060,7 @@ var GraphQLClient = /** @class */ (function () {
171718
172060
  url: url,
171719
172061
  query: queries,
171720
172062
  variables: variables,
171721
- headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(batchRequestOptions.requestHeaders)),
172063
+ headers: __assign(__assign({}, resolveHeaders(callOrIdentity(headers))), resolveHeaders(batchRequestOptions.requestHeaders)),
171722
172064
  operationName: undefined,
171723
172065
  fetch: fetch,
171724
172066
  method: method,
@@ -171764,7 +172106,7 @@ exports.GraphQLClient = GraphQLClient;
171764
172106
  function makeRequest(_a) {
171765
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;
171766
172108
  return __awaiter(this, void 0, void 0, function () {
171767
- 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;
171768
172110
  return __generator(this, function (_c) {
171769
172111
  switch (_c.label) {
171770
172112
  case 0:
@@ -171788,9 +172130,12 @@ function makeRequest(_a) {
171788
172130
  var data = _a.data;
171789
172131
  return !data;
171790
172132
  }) : !!result.data;
171791
- if (response.ok && !result.errors && successfullyReceivedData) {
172133
+ successfullyPassedErrorPolicy = !result.errors || fetchOptions.errorPolicy === 'all' || fetchOptions.errorPolicy === 'ignore';
172134
+ if (response.ok && successfullyPassedErrorPolicy && successfullyReceivedData) {
171792
172135
  headers_1 = response.headers, status_1 = response.status;
171793
- 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 })];
171794
172139
  }
171795
172140
  else {
171796
172141
  errorResult = typeof result === 'string' ? { error: result } : result;
@@ -171885,6 +172230,10 @@ function resolveRequestDocument(document) {
171885
172230
  var operationName = extractOperationName(document);
171886
172231
  return { query: printer_1.print(document), operationName: operationName };
171887
172232
  }
172233
+ exports.resolveRequestDocument = resolveRequestDocument;
172234
+ function callOrIdentity(value) {
172235
+ return typeof value === 'function' ? value() : value;
172236
+ }
171888
172237
  /**
171889
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.
171890
172239
  *
@@ -171916,6 +172265,8 @@ function HeadersInstanceToPlainObject(headers) {
171916
172265
  });
171917
172266
  return o;
171918
172267
  }
172268
+ var graphql_ws_1 = graphqlWs;
172269
+ Object.defineProperty(exports, "GraphQLWebSocketClient", { enumerable: true, get: function () { return graphql_ws_1.GraphQLWebSocketClient; } });
171919
172270
 
171920
172271
  }(dist$1));
171921
172272
 
@@ -171932,16 +172283,32 @@ async function request$1(query, session, variables) {
171932
172283
  const url = adminUrl(session.storeFqdn, version);
171933
172284
  const headers = await buildHeaders(session.token);
171934
172285
  debug$5(`
171935
- Sending Admin GraphQL request:
171936
- ${query}
172286
+ Sending Admin GraphQL request:
172287
+ ${query}
171937
172288
 
171938
- With variables:
171939
- ${variables ? JSON.stringify(variables, null, 2) : ""}
172289
+ With variables:
172290
+ ${variables ? JSON.stringify(variables, null, 2) : ""}
171940
172291
 
171941
- And headers:
171942
- ${sanitizedHeadersOutput(headers)}
172292
+ And headers:
172293
+ ${sanitizedHeadersOutput(headers)}
171943
172294
  `);
171944
- 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
+ }
171945
172312
  }
171946
172313
  async function fetchApiVersion(session) {
171947
172314
  const url = adminUrl(session.storeFqdn, "unstable");
@@ -171976,28 +172343,6 @@ var admin = /*#__PURE__*/Object.freeze({
171976
172343
  request: request$1
171977
172344
  });
171978
172345
 
171979
- async function request(query, token, variables) {
171980
- const fqdn = await partners$1();
171981
- const url = `https://${fqdn}/api/cli/graphql`;
171982
- const headers = await buildHeaders(token);
171983
- debug$5(`
171984
- Sending Partners GraphQL request:
171985
- ${query}
171986
-
171987
- With variables:
171988
- ${variables ? JSON.stringify(variables, null, 2) : ""}
171989
-
171990
- And headers:
171991
- ${sanitizedHeadersOutput(headers)}
171992
- `);
171993
- return dist$1.request(url, query, variables, headers);
171994
- }
171995
-
171996
- var partners = /*#__PURE__*/Object.freeze({
171997
- __proto__: null,
171998
- request: request
171999
- });
172000
-
172001
172346
  const FindOrganizationQuery = dist$1.gql`
172002
172347
  query FindOrganization($id: ID!) {
172003
172348
  organizations(id: $id, first: 1) {
@@ -172188,6 +172533,36 @@ const ExtensionCreateQuery = dist$1.gql`
172188
172533
  }
172189
172534
  `;
172190
172535
 
172536
+ const ExtensionSpecificationsQuery = dist$1.gql`
172537
+ query fetchSpecifications($api_key: String!) {
172538
+ extensionSpecifications(apiKey: $api_key) {
172539
+ name
172540
+ identifier
172541
+ options {
172542
+ managementExperience
172543
+ }
172544
+ features {
172545
+ argo {
172546
+ surface
172547
+ }
172548
+ }
172549
+ }
172550
+ }
172551
+ `;
172552
+
172553
+ const AllAppExtensionRegistrationsQuery = dist$1.gql`
172554
+ query allAppExtensionRegistrations($apiKey: String!) {
172555
+ app(apiKey: $apiKey) {
172556
+ extensionRegistrations {
172557
+ id
172558
+ uuid
172559
+ title
172560
+ type
172561
+ }
172562
+ }
172563
+ }
172564
+ `;
172565
+
172191
172566
  const FindProductVariantQuery = dist$1.gql`
172192
172567
  query {
172193
172568
  products(first: 1) {
@@ -172207,6 +172582,84 @@ const FindProductVariantQuery = dist$1.gql`
172207
172582
  }
172208
172583
  `;
172209
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
+
172210
172663
  var index = /*#__PURE__*/Object.freeze({
172211
172664
  __proto__: null,
172212
172665
  FindOrganizationQuery: FindOrganizationQuery,
@@ -172220,7 +172673,63 @@ var index = /*#__PURE__*/Object.freeze({
172220
172673
  AllStoresByOrganizationQuery: AllStoresByOrganizationQuery,
172221
172674
  ConvertDevToTestStoreQuery: ConvertDevToTestStoreQuery,
172222
172675
  ExtensionCreateQuery: ExtensionCreateQuery,
172223
- FindProductVariantQuery: FindProductVariantQuery
172676
+ ExtensionSpecificationsQuery: ExtensionSpecificationsQuery,
172677
+ AllAppExtensionRegistrationsQuery: AllAppExtensionRegistrationsQuery,
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
172224
172733
  });
172225
172734
 
172226
172735
  var api = /*#__PURE__*/Object.freeze({
@@ -172478,9 +172987,10 @@ var semver = /*#__PURE__*/Object.freeze({
172478
172987
  });
172479
172988
 
172480
172989
  const RubyCLIVersion = "2.16.0";
172990
+ const ThemeCheckVersion = "1.10.2";
172481
172991
  const MinBundlerVersion = "2.3.8";
172482
172992
  async function execCLI(args, adminSession) {
172483
- await installDependencies();
172993
+ await installCLIDependencies();
172484
172994
  const env = {
172485
172995
  ...process.env,
172486
172996
  SHOPIFY_CLI_ADMIN_AUTH_TOKEN: adminSession?.token,
@@ -172489,21 +172999,69 @@ async function execCLI(args, adminSession) {
172489
172999
  spawn$1("bundle", ["exec", "shopify"].concat(args), {
172490
173000
  stdio: "inherit",
172491
173001
  shell: true,
172492
- cwd: rubyCLIPath(),
173002
+ cwd: shopifyCLIDirectory(),
172493
173003
  env
172494
173004
  });
172495
173005
  }
172496
- async function installDependencies() {
172497
- const exists = await exists$1(rubyCLIPath());
172498
- 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...");
172499
173039
  const list = new Listr([
172500
173040
  {
172501
173041
  title: "Installing theme dependencies",
172502
173042
  task: async () => {
172503
173043
  await validateRubyEnv();
172504
- await createWorkingDirectory();
172505
- await createGemfile();
172506
- await bundleInstall();
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";
173057
+ const list = new Listr([
173058
+ {
173059
+ title: "Installing theme dependencies",
173060
+ task: async () => {
173061
+ await validateRubyEnv();
173062
+ await createShopifyCLIWorkingDirectory();
173063
+ await createShopifyCLIGemfile();
173064
+ await bundleInstallShopifyCLI();
172507
173065
  }
172508
173066
  }
172509
173067
  ], { renderer });
@@ -172529,25 +173087,41 @@ async function getBundlerVersion() {
172529
173087
  throw new Abort("Bundler not found", "Make sure you have Bundler installed on your system: https://bundler.io/");
172530
173088
  }
172531
173089
  }
172532
- function createWorkingDirectory() {
172533
- return mkdir(rubyCLIPath());
173090
+ function createShopifyCLIWorkingDirectory() {
173091
+ return mkdir(shopifyCLIDirectory());
172534
173092
  }
172535
- async function createGemfile() {
172536
- 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");
172537
173098
  await write$1(gemPath, `source 'https://rubygems.org'
172538
173099
  gem 'shopify-cli', '${RubyCLIVersion}'`);
172539
173100
  }
172540
- async function bundleInstall() {
172541
- await exec$2("bundle", ["config", "set", "--local", "path", rubyCLIPath()], { cwd: rubyCLIPath() });
172542
- 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() });
172543
173113
  }
172544
- function rubyCLIPath() {
173114
+ function shopifyCLIDirectory() {
172545
173115
  return join$3(constants$2.paths.directories.cache.vendor.path(), "ruby-cli", RubyCLIVersion);
172546
173116
  }
173117
+ function themeCheckDirectory() {
173118
+ return join$3(constants$2.paths.directories.cache.vendor.path(), "theme-check", ThemeCheckVersion);
173119
+ }
172547
173120
 
172548
173121
  var ruby = /*#__PURE__*/Object.freeze({
172549
173122
  __proto__: null,
172550
- execCLI: execCLI
173123
+ execCLI: execCLI,
173124
+ execThemeCheckCLI: execThemeCheckCLI
172551
173125
  });
172552
173126
 
172553
173127
  async function readPackageJSON(directory) {
@@ -172845,6 +173419,12 @@ var dotEnv = /*#__PURE__*/Object.freeze({
172845
173419
  write: write
172846
173420
  });
172847
173421
 
173422
+ var abort = /*#__PURE__*/Object.freeze({
173423
+ __proto__: null,
173424
+ Controller: AbortController$1,
173425
+ Signal: AbortSignal
173426
+ });
173427
+
172848
173428
  const TUNNEL_PLUGINS = ["@shopify/plugin-ngrok"];
172849
173429
  async function lookupTunnelPlugin(plugins) {
172850
173430
  const tunnelPlugin = plugins.find((plugin) => TUNNEL_PLUGINS.includes(plugin.name));
@@ -172859,5 +173439,5 @@ var plugins = /*#__PURE__*/Object.freeze({
172859
173439
  lookupTunnelPlugin: lookupTunnelPlugin
172860
173440
  });
172861
173441
 
172862
- 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 };
172863
- //# sourceMappingURL=index-cf216492.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-47b13eba.js.map