@shopify/create-app 3.68.0 → 3.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/{chokidar-4TKDAB27.js → chokidar-OESTCX4H.js} +571 -8
  2. package/dist/{chunk-C5I6OCGC.js → chunk-2A7GNM7F.js} +2 -2
  3. package/dist/{chunk-JPBCRPG7.js → chunk-7N2ECBWK.js} +3 -3
  4. package/dist/{chunk-EWVVUMVS.js → chunk-AVCU5ZOP.js} +9 -9
  5. package/dist/{chunk-VZ5DQVYW.js → chunk-AZIUHI45.js} +93 -5
  6. package/dist/{chunk-T2GATXSP.js → chunk-BB6N2XSA.js} +2 -2
  7. package/dist/{chunk-7BOEG3VG.js → chunk-CJOZ7NTT.js} +7 -7
  8. package/dist/{chunk-NZDBLGNM.js → chunk-G6AY2JW5.js} +2 -3
  9. package/dist/{chunk-BG6FYFQK.js → chunk-L7M22NDW.js} +2 -2
  10. package/dist/{chunk-F27QYMO7.js → chunk-MX4RJDBM.js} +591 -20
  11. package/dist/{chunk-ZFVK6EQX.js → chunk-NB4NLOEJ.js} +142 -703
  12. package/dist/{chunk-MAWDESEZ.js → chunk-NQUHO34K.js} +140 -38
  13. package/dist/{chunk-EY2NO5UP.js → chunk-UWDJJNDC.js} +4 -4
  14. package/dist/{chunk-TOQEXS2N.js → chunk-XMQLNGN7.js} +142 -860
  15. package/dist/{constants-TR6ABVLJ.js → constants-GVJLI6RE.js} +3 -3
  16. package/dist/{custom-oclif-loader-M54JZXX3.js → custom-oclif-loader-FZACFF7D.js} +10 -12
  17. package/dist/{del-SR7JNKRM.js → del-42HQA7PR.js} +5 -5
  18. package/dist/{error-handler-AAI2P4B2.js → error-handler-R2NFQW6E.js} +12 -14
  19. package/dist/hooks/postrun.js +13 -14
  20. package/dist/hooks/prerun.js +11 -13
  21. package/dist/index.js +10859 -10056
  22. package/dist/lib-H5ZGVBFQ.js +11 -0
  23. package/dist/{local-XWESY2WL.js → local-G7IECLW7.js} +8 -12
  24. package/dist/{node-package-manager-SPDRX34D.js → node-package-manager-5YDNPKRT.js} +9 -11
  25. package/dist/out-ZDSLKX4N.js +7 -0
  26. package/dist/{path-T2RCZTRE.js → path-G6AAF6UV.js} +2 -2
  27. package/dist/{system-N4GMXNKO.js → system-M33YAFGP.js} +8 -10
  28. package/dist/tsconfig.tsbuildinfo +1 -1
  29. package/dist/{ui-PM2VNG6W.js → ui-VEBUA4SR.js} +8 -10
  30. package/oclif.manifest.json +1 -1
  31. package/package.json +3 -3
  32. package/dist/chunk-2AW6NZQ5.js +0 -101
  33. package/dist/chunk-QETDXAFX.js +0 -106
  34. package/dist/lib-H3ZZGS7I.js +0 -1322
  35. package/dist/lib-N6KQZBCQ.js +0 -12
  36. package/dist/out-66YUO4CT.js +0 -7
@@ -12,11 +12,10 @@ import {
12
12
  removeSession,
13
13
  setCachedPartnerAccountStatus,
14
14
  setSession
15
- } from "./chunk-EY2NO5UP.js";
15
+ } from "./chunk-UWDJJNDC.js";
16
16
  import {
17
17
  AbortError,
18
18
  BugError,
19
- CancelExecution,
20
19
  Environment,
21
20
  FatalError,
22
21
  addPublicMetadata,
@@ -25,7 +24,6 @@ import {
25
24
  cloudEnvironment,
26
25
  currentProcessIsGlobal,
27
26
  execa,
28
- findPathUp,
29
27
  firstPartyDev,
30
28
  import_ts_error,
31
29
  isCloudEnvironment,
@@ -41,25 +39,21 @@ import {
41
39
  outputInfo,
42
40
  outputToken,
43
41
  outputWarn,
44
- readFile,
45
- renderConfirmationPrompt,
46
42
  runWithTimer,
47
43
  serviceEnvironment,
48
44
  spinFqdn,
49
45
  stringifyMessage,
50
- themeToken,
51
- useDeviceAuth
52
- } from "./chunk-MAWDESEZ.js";
46
+ themeToken
47
+ } from "./chunk-NQUHO34K.js";
53
48
  import {
54
49
  defaultThemeKitAccessDomain,
55
50
  environmentVariables,
56
51
  sessionConstants,
57
52
  systemEnvironmentVariables
58
- } from "./chunk-NZDBLGNM.js";
53
+ } from "./chunk-G6AY2JW5.js";
59
54
  import {
60
- cwd,
61
- moduleDirectory
62
- } from "./chunk-T2GATXSP.js";
55
+ cwd
56
+ } from "./chunk-BB6N2XSA.js";
63
57
  import {
64
58
  __commonJS,
65
59
  __require,
@@ -24426,11 +24420,11 @@ var require_url_state_machine = __commonJS({
24426
24420
  function isSpecialScheme(scheme) {
24427
24421
  return specialSchemes[scheme] !== void 0;
24428
24422
  }
24429
- function isSpecial(url2) {
24430
- return isSpecialScheme(url2.scheme);
24423
+ function isSpecial(url) {
24424
+ return isSpecialScheme(url.scheme);
24431
24425
  }
24432
- function isNotSpecial(url2) {
24433
- return !isSpecialScheme(url2.scheme);
24426
+ function isNotSpecial(url) {
24427
+ return !isSpecialScheme(url.scheme);
24434
24428
  }
24435
24429
  function defaultPort(scheme) {
24436
24430
  return specialSchemes[scheme];
@@ -24590,30 +24584,30 @@ var require_url_state_machine = __commonJS({
24590
24584
  });
24591
24585
  return result === null || result === "" ? failure : result;
24592
24586
  }
24593
- function trimControlChars(url2) {
24594
- return url2.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/ug, "");
24587
+ function trimControlChars(url) {
24588
+ return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/ug, "");
24595
24589
  }
24596
- function trimTabAndNewline(url2) {
24597
- return url2.replace(/\u0009|\u000A|\u000D/ug, "");
24590
+ function trimTabAndNewline(url) {
24591
+ return url.replace(/\u0009|\u000A|\u000D/ug, "");
24598
24592
  }
24599
- function shortenPath(url2) {
24600
- let { path } = url2;
24601
- path.length !== 0 && (url2.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0]) || path.pop());
24593
+ function shortenPath(url) {
24594
+ let { path } = url;
24595
+ path.length !== 0 && (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0]) || path.pop());
24602
24596
  }
24603
- function includesCredentials(url2) {
24604
- return url2.username !== "" || url2.password !== "";
24597
+ function includesCredentials(url) {
24598
+ return url.username !== "" || url.password !== "";
24605
24599
  }
24606
- function cannotHaveAUsernamePasswordPort(url2) {
24607
- return url2.host === null || url2.host === "" || url2.scheme === "file";
24600
+ function cannotHaveAUsernamePasswordPort(url) {
24601
+ return url.host === null || url.host === "" || url.scheme === "file";
24608
24602
  }
24609
- function hasAnOpaquePath(url2) {
24610
- return typeof url2.path == "string";
24603
+ function hasAnOpaquePath(url) {
24604
+ return typeof url.path == "string";
24611
24605
  }
24612
24606
  function isNormalizedWindowsDriveLetter(string) {
24613
24607
  return /^[A-Za-z]:$/u.test(string);
24614
24608
  }
24615
- function URLStateMachine(input, base, encodingOverride, url2, stateOverride) {
24616
- if (this.pointer = 0, this.input = input, this.base = base || null, this.encodingOverride = encodingOverride || "utf-8", this.stateOverride = stateOverride, this.url = url2, this.failure = !1, this.parseError = !1, !this.url) {
24609
+ function URLStateMachine(input, base, encodingOverride, url, stateOverride) {
24610
+ if (this.pointer = 0, this.input = input, this.base = base || null, this.encodingOverride = encodingOverride || "utf-8", this.stateOverride = stateOverride, this.url = url, this.failure = !1, this.parseError = !1, !this.url) {
24617
24611
  this.url = {
24618
24612
  scheme: "",
24619
24613
  username: "",
@@ -24800,28 +24794,28 @@ var require_url_state_machine = __commonJS({
24800
24794
  URLStateMachine.prototype["parse fragment"] = function(c) {
24801
24795
  return isNaN(c) || (c === p("%") && (!infra.isASCIIHex(this.input[this.pointer + 1]) || !infra.isASCIIHex(this.input[this.pointer + 2])) && (this.parseError = !0), this.url.fragment += utf8PercentEncodeCodePoint(c, isFragmentPercentEncode)), !0;
24802
24796
  };
24803
- function serializeURL(url2, excludeFragment) {
24804
- let output = `${url2.scheme}:`;
24805
- return url2.host !== null && (output += "//", (url2.username !== "" || url2.password !== "") && (output += url2.username, url2.password !== "" && (output += `:${url2.password}`), output += "@"), output += serializeHost(url2.host), url2.port !== null && (output += `:${url2.port}`)), url2.host === null && !hasAnOpaquePath(url2) && url2.path.length > 1 && url2.path[0] === "" && (output += "/."), output += serializePath(url2), url2.query !== null && (output += `?${url2.query}`), !excludeFragment && url2.fragment !== null && (output += `#${url2.fragment}`), output;
24797
+ function serializeURL(url, excludeFragment) {
24798
+ let output = `${url.scheme}:`;
24799
+ return url.host !== null && (output += "//", (url.username !== "" || url.password !== "") && (output += url.username, url.password !== "" && (output += `:${url.password}`), output += "@"), output += serializeHost(url.host), url.port !== null && (output += `:${url.port}`)), url.host === null && !hasAnOpaquePath(url) && url.path.length > 1 && url.path[0] === "" && (output += "/."), output += serializePath(url), url.query !== null && (output += `?${url.query}`), !excludeFragment && url.fragment !== null && (output += `#${url.fragment}`), output;
24806
24800
  }
24807
24801
  function serializeOrigin(tuple) {
24808
24802
  let result = `${tuple.scheme}://`;
24809
24803
  return result += serializeHost(tuple.host), tuple.port !== null && (result += `:${tuple.port}`), result;
24810
24804
  }
24811
- function serializePath(url2) {
24812
- if (hasAnOpaquePath(url2))
24813
- return url2.path;
24805
+ function serializePath(url) {
24806
+ if (hasAnOpaquePath(url))
24807
+ return url.path;
24814
24808
  let output = "";
24815
- for (let segment of url2.path)
24809
+ for (let segment of url.path)
24816
24810
  output += `/${segment}`;
24817
24811
  return output;
24818
24812
  }
24819
24813
  module2.exports.serializeURL = serializeURL;
24820
24814
  module2.exports.serializePath = serializePath;
24821
- module2.exports.serializeURLOrigin = function(url2) {
24822
- switch (url2.scheme) {
24815
+ module2.exports.serializeURLOrigin = function(url) {
24816
+ switch (url.scheme) {
24823
24817
  case "blob": {
24824
- let pathURL = module2.exports.parseURL(serializePath(url2));
24818
+ let pathURL = module2.exports.parseURL(serializePath(url));
24825
24819
  return pathURL === null || pathURL.scheme !== "http" && pathURL.scheme !== "https" ? "null" : module2.exports.serializeURLOrigin(pathURL);
24826
24820
  }
24827
24821
  case "ftp":
@@ -24830,9 +24824,9 @@ var require_url_state_machine = __commonJS({
24830
24824
  case "ws":
24831
24825
  case "wss":
24832
24826
  return serializeOrigin({
24833
- scheme: url2.scheme,
24834
- host: url2.host,
24835
- port: url2.port
24827
+ scheme: url.scheme,
24828
+ host: url.host,
24829
+ port: url.port
24836
24830
  });
24837
24831
  case "file":
24838
24832
  return "null";
@@ -24845,11 +24839,11 @@ var require_url_state_machine = __commonJS({
24845
24839
  let usm = new URLStateMachine(input, options2.baseURL, options2.encodingOverride, options2.url, options2.stateOverride);
24846
24840
  return usm.failure ? null : usm.url;
24847
24841
  };
24848
- module2.exports.setTheUsername = function(url2, username2) {
24849
- url2.username = utf8PercentEncodeString(username2, isUserinfoPercentEncode);
24842
+ module2.exports.setTheUsername = function(url, username2) {
24843
+ url.username = utf8PercentEncodeString(username2, isUserinfoPercentEncode);
24850
24844
  };
24851
- module2.exports.setThePassword = function(url2, password) {
24852
- url2.password = utf8PercentEncodeString(password, isUserinfoPercentEncode);
24845
+ module2.exports.setThePassword = function(url, password) {
24846
+ url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode);
24853
24847
  };
24854
24848
  module2.exports.serializeHost = serializeHost;
24855
24849
  module2.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
@@ -25386,18 +25380,18 @@ var require_URL_impl = __commonJS({
25386
25380
  // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error
25387
25381
  // messages in the constructor that distinguish between the different causes of failure.
25388
25382
  constructor(globalObject, constructorArgs) {
25389
- let url2 = constructorArgs[0], base = constructorArgs[1], parsedBase = null;
25383
+ let url = constructorArgs[0], base = constructorArgs[1], parsedBase = null;
25390
25384
  if (base !== void 0 && (parsedBase = usm.basicURLParse(base), parsedBase === null))
25391
25385
  throw new TypeError(`Invalid base URL: ${base}`);
25392
- let parsedURL = usm.basicURLParse(url2, { baseURL: parsedBase });
25386
+ let parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
25393
25387
  if (parsedURL === null)
25394
- throw new TypeError(`Invalid URL: ${url2}`);
25388
+ throw new TypeError(`Invalid URL: ${url}`);
25395
25389
  let query = parsedURL.query !== null ? parsedURL.query : "";
25396
25390
  this._url = parsedURL, this._query = URLSearchParams2.createImpl(globalObject, [query], { doNotStripQMark: !0 }), this._query._url = this;
25397
25391
  }
25398
- static canParse(url2, base) {
25392
+ static canParse(url, base) {
25399
25393
  let parsedBase = null;
25400
- return !(base !== void 0 && (parsedBase = usm.basicURLParse(base), parsedBase === null) || usm.basicURLParse(url2, { baseURL: parsedBase }) === null);
25394
+ return !(base !== void 0 && (parsedBase = usm.basicURLParse(base), parsedBase === null) || usm.basicURLParse(url, { baseURL: parsedBase }) === null);
25401
25395
  }
25402
25396
  get href() {
25403
25397
  return usm.serializeURL(this._url);
@@ -25432,8 +25426,8 @@ var require_URL_impl = __commonJS({
25432
25426
  usm.cannotHaveAUsernamePasswordPort(this._url) || usm.setThePassword(this._url, v);
25433
25427
  }
25434
25428
  get host() {
25435
- let url2 = this._url;
25436
- return url2.host === null ? "" : url2.port === null ? usm.serializeHost(url2.host) : `${usm.serializeHost(url2.host)}:${usm.serializeInteger(url2.port)}`;
25429
+ let url = this._url;
25430
+ return url.host === null ? "" : url.port === null ? usm.serializeHost(url.host) : `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`;
25437
25431
  }
25438
25432
  set host(v) {
25439
25433
  usm.hasAnOpaquePath(this._url) || usm.basicURLParse(v, { url: this._url, stateOverride: "host" });
@@ -25460,13 +25454,13 @@ var require_URL_impl = __commonJS({
25460
25454
  return this._url.query === null || this._url.query === "" ? "" : `?${this._url.query}`;
25461
25455
  }
25462
25456
  set search(v) {
25463
- let url2 = this._url;
25457
+ let url = this._url;
25464
25458
  if (v === "") {
25465
- url2.query = null, this._query._list = [], this._potentiallyStripTrailingSpacesFromAnOpaquePath();
25459
+ url.query = null, this._query._list = [], this._potentiallyStripTrailingSpacesFromAnOpaquePath();
25466
25460
  return;
25467
25461
  }
25468
25462
  let input = v[0] === "?" ? v.substring(1) : v;
25469
- url2.query = "", usm.basicURLParse(input, { url: url2, stateOverride: "query" }), this._query._list = urlencoded.parseUrlencodedString(input);
25463
+ url.query = "", usm.basicURLParse(input, { url, stateOverride: "query" }), this._query._list = urlencoded.parseUrlencodedString(input);
25470
25464
  }
25471
25465
  get searchParams() {
25472
25466
  return this._query;
@@ -25536,7 +25530,7 @@ var require_URL = __commonJS({
25536
25530
  return;
25537
25531
  let ctorRegistry = utils.initCtorRegistry(globalObject);
25538
25532
  class URL2 {
25539
- constructor(url2) {
25533
+ constructor(url) {
25540
25534
  if (arguments.length < 1)
25541
25535
  throw new globalObject.TypeError(
25542
25536
  `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`
@@ -25732,7 +25726,7 @@ var require_URL = __commonJS({
25732
25726
  globals: globalObject
25733
25727
  }), esValue[implSymbol].hash = V;
25734
25728
  }
25735
- static canParse(url2) {
25729
+ static canParse(url) {
25736
25730
  if (arguments.length < 1)
25737
25731
  throw new globalObject.TypeError(
25738
25732
  `Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`
@@ -26496,11 +26490,11 @@ var require_lib2 = __commonJS({
26496
26490
  let orig = new URL$1(original).protocol, dest = new URL$1(destination).protocol;
26497
26491
  return orig === dest;
26498
26492
  };
26499
- function fetch4(url2, opts) {
26493
+ function fetch4(url, opts) {
26500
26494
  if (!fetch4.Promise)
26501
26495
  throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
26502
26496
  return Body2.Promise = fetch4.Promise, new fetch4.Promise(function(resolve, reject) {
26503
- let request = new Request2(url2, opts), options2 = getNodeRequestOptions2(request), send = (options2.protocol === "https:" ? https3 : http3).request, signal = request.signal, response = null, abort = function() {
26497
+ let request = new Request2(url, opts), options2 = getNodeRequestOptions2(request), send = (options2.protocol === "https:" ? https3 : http3).request, signal = request.signal, response = null, abort = function() {
26504
26498
  let error = new AbortError3("The user aborted a request.");
26505
26499
  reject(error), request.body && request.body instanceof Stream3.Readable && destroyStream(request.body, error), !(!response || !response.body) && response.body.emit("error", error);
26506
26500
  };
@@ -26663,8 +26657,8 @@ var require_lib2 = __commonJS({
26663
26657
  var require_node_ponyfill = __commonJS({
26664
26658
  "../../node_modules/.pnpm/cross-fetch@3.1.8/node_modules/cross-fetch/dist/node-ponyfill.js"(exports2, module2) {
26665
26659
  init_cjs_shims();
26666
- var nodeFetch = require_lib2(), realFetch = nodeFetch.default || nodeFetch, fetch4 = function(url2, options2) {
26667
- return /^\/\//.test(url2) && (url2 = "https:" + url2), realFetch.call(this, url2, options2);
26660
+ var nodeFetch = require_lib2(), realFetch = nodeFetch.default || nodeFetch, fetch4 = function(url, options2) {
26661
+ return /^\/\//.test(url) && (url = "https:" + url), realFetch.call(this, url, options2);
26668
26662
  };
26669
26663
  fetch4.ponyfill = !0;
26670
26664
  module2.exports = exports2 = fetch4;
@@ -26840,428 +26834,6 @@ var require_form_data2 = __commonJS({
26840
26834
  }
26841
26835
  });
26842
26836
 
26843
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/utils.js
26844
- var require_utils2 = __commonJS({
26845
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/utils.js"(exports2, module2) {
26846
- "use strict";
26847
- init_cjs_shims();
26848
- var cp = __require("child_process"), UNIT_MB = 1024 * 1024, utils = {
26849
- /**
26850
- * exec command with maxBuffer size
26851
- */
26852
- exec(cmd, callback) {
26853
- cp.exec(cmd, {
26854
- maxBuffer: 2 * UNIT_MB,
26855
- windowsHide: !0
26856
- }, callback);
26857
- },
26858
- /**
26859
- * spawn command
26860
- */
26861
- spawn(cmd, args, options2) {
26862
- return cp.spawn(cmd, args, options2);
26863
- },
26864
- /**
26865
- * Strip top lines of text
26866
- *
26867
- * @param {String} text
26868
- * @param {Number} num
26869
- * @return {String}
26870
- */
26871
- stripLine(text, num) {
26872
- let idx = 0;
26873
- for (; num-- > 0; ) {
26874
- let nIdx = text.indexOf(`
26875
- `, idx);
26876
- nIdx >= 0 && (idx = nIdx + 1);
26877
- }
26878
- return idx > 0 ? text.substring(idx) : text;
26879
- },
26880
- /**
26881
- * Split string and stop at max parts
26882
- *
26883
- * @param {Number} line
26884
- * @param {Number} max
26885
- * @return {Array}
26886
- */
26887
- split(line, max) {
26888
- let cols = line.trim().split(/\s+/);
26889
- return cols.length > max && (cols[max - 1] = cols.slice(max - 1).join(" ")), cols;
26890
- },
26891
- /**
26892
- * Extract columns from table text
26893
- *
26894
- * Example:
26895
- *
26896
- * ```
26897
- * extractColumns(text, [0, 2], 3)
26898
- * ```
26899
- *
26900
- * From:
26901
- * ```
26902
- * foo bar bar2
26903
- * valx valy valz
26904
- * ```
26905
- *
26906
- * To:
26907
- * ```
26908
- * [ ['foo', 'bar2'], ['valx', 'valz'] ]
26909
- * ```
26910
- *
26911
- * @param {String} text raw table text
26912
- * @param {Array} idxes the column index list to extract
26913
- * @param {Number} max max column number of table
26914
- * @return {Array}
26915
- */
26916
- extractColumns(text, idxes, max) {
26917
- let lines = text.split(/(\r\n|\n|\r)/), columns = [];
26918
- return max || (max = Math.max.apply(null, idxes) + 1), lines.forEach((line) => {
26919
- let cols = utils.split(line, max), column = [];
26920
- idxes.forEach((idx) => {
26921
- column.push(cols[idx] || "");
26922
- }), columns.push(column);
26923
- }), columns;
26924
- },
26925
- /**
26926
- * parse table text to array
26927
- *
26928
- * From:
26929
- * ```
26930
- * Header1 : foo
26931
- * Header2 : bar
26932
- * Header3 : val
26933
- *
26934
- * Header1 : foo2
26935
- * Header2 : bar2
26936
- * Header3 : val2
26937
- * ```
26938
- *
26939
- * To:
26940
- * ```
26941
- * [{ Header1: 'foo', Header2: 'bar', Header3: 'val' }, ...]
26942
- * ```
26943
- *
26944
- * @param {String} data raw table data
26945
- * @return {Array}
26946
- */
26947
- parseTable(data) {
26948
- let lines = data.split(/(\r\n\r\n|\r\n\n|\n\r\n)|\n\n/).filter((line) => line.trim().length > 0).map((e) => e.split(/(\r\n|\n|\r)/).filter((line) => line.trim().length > 0));
26949
- return lines.forEach((line) => {
26950
- for (let index = 0; line[index]; ) {
26951
- let entry = line[index];
26952
- entry.startsWith(" ") ? (line[index - 1] += entry.trimLeft(), line.splice(index, 1)) : index += 1;
26953
- }
26954
- }), lines.map((line) => {
26955
- let row = {};
26956
- return line.forEach((string) => {
26957
- let splitterIndex = string.indexOf(":"), key = string.slice(0, splitterIndex).trim();
26958
- row[key] = string.slice(splitterIndex + 1).trim();
26959
- }), row;
26960
- });
26961
- }
26962
- };
26963
- module2.exports = utils;
26964
- }
26965
- });
26966
-
26967
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find_pid.js
26968
- var require_find_pid = __commonJS({
26969
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find_pid.js"(exports2, module2) {
26970
- "use strict";
26971
- init_cjs_shims();
26972
- var os = __require("os"), fs = __require("fs"), utils = require_utils2(), ensureDir = (path) => new Promise((resolve, reject) => {
26973
- fs.existsSync(path) ? resolve() : fs.mkdir(path, (err2) => {
26974
- err2 ? reject(err2) : resolve();
26975
- });
26976
- }), finders = {
26977
- darwin(port) {
26978
- return new Promise((resolve, reject) => {
26979
- utils.exec("netstat -anv -p TCP && netstat -anv -p UDP", function(err2, stdout, stderr) {
26980
- if (err2)
26981
- reject(err2);
26982
- else {
26983
- if (err2 = stderr.toString().trim(), err2) {
26984
- reject(err2);
26985
- return;
26986
- }
26987
- let data = utils.stripLine(stdout.toString(), 2), found = utils.extractColumns(data, [0, 3, 8], 10).filter((row) => !!String(row[0]).match(/^(udp|tcp)/)).find((row) => {
26988
- let matches = String(row[1]).match(/\.(\d+)$/);
26989
- if (matches && matches[1] === String(port))
26990
- return !0;
26991
- });
26992
- found && found[2].length ? resolve(parseInt(found[2], 10)) : reject(new Error(`pid of port (${port}) not found`));
26993
- }
26994
- });
26995
- });
26996
- },
26997
- freebsd: "darwin",
26998
- sunos: "darwin",
26999
- linux(port) {
27000
- return new Promise((resolve, reject) => {
27001
- let cmd = "netstat -tunlp";
27002
- utils.exec(cmd, function(err2, stdout, stderr) {
27003
- if (err2)
27004
- reject(err2);
27005
- else {
27006
- let warn = stderr.toString().trim();
27007
- warn && console.warn(warn);
27008
- let data = utils.stripLine(stdout.toString(), 2), columns = utils.extractColumns(data, [3, 6], 7).find((column) => {
27009
- let matches = String(column[0]).match(/:(\d+)$/);
27010
- if (matches && matches[1] === String(port))
27011
- return !0;
27012
- });
27013
- if (columns && columns[1]) {
27014
- let pid = columns[1].split("/", 1)[0];
27015
- pid.length ? resolve(parseInt(pid, 10)) : reject(new Error(`pid of port (${port}) not found`));
27016
- } else
27017
- reject(new Error(`pid of port (${port}) not found`));
27018
- }
27019
- });
27020
- });
27021
- },
27022
- win32(port) {
27023
- return new Promise((resolve, reject) => {
27024
- utils.exec("netstat -ano", function(err2, stdout, stderr) {
27025
- if (err2)
27026
- reject(err2);
27027
- else {
27028
- if (err2 = stderr.toString().trim(), err2) {
27029
- reject(err2);
27030
- return;
27031
- }
27032
- let data = utils.stripLine(stdout.toString(), 4), columns = utils.extractColumns(data, [1, 4], 5).find((column) => {
27033
- let matches = String(column[0]).match(/:(\d+)$/);
27034
- if (matches && matches[1] === String(port))
27035
- return !0;
27036
- });
27037
- columns && columns[1].length && parseInt(columns[1], 10) > 0 ? resolve(parseInt(columns[1], 10)) : reject(new Error(`pid of port (${port}) not found`));
27038
- }
27039
- });
27040
- });
27041
- },
27042
- android(port) {
27043
- return new Promise((resolve, reject) => {
27044
- let dir = os.tmpdir() + "/.find-process", file = dir + "/" + process.pid, cmd = 'netstat -tunp >> "' + file + '"';
27045
- ensureDir(dir).then(() => {
27046
- utils.exec(cmd, () => {
27047
- fs.readFile(file, "utf8", (err2, data) => {
27048
- if (fs.unlink(file, () => {
27049
- }), err2)
27050
- reject(err2);
27051
- else {
27052
- data = utils.stripLine(data, 2);
27053
- let columns = utils.extractColumns(data, [3, 6], 7).find((column) => {
27054
- let matches = String(column[0]).match(/:(\d+)$/);
27055
- if (matches && matches[1] === String(port))
27056
- return !0;
27057
- });
27058
- if (columns && columns[1]) {
27059
- let pid = columns[1].split("/", 1)[0];
27060
- pid.length ? resolve(parseInt(pid, 10)) : reject(new Error(`pid of port (${port}) not found`));
27061
- } else
27062
- reject(new Error(`pid of port (${port}) not found`));
27063
- }
27064
- });
27065
- });
27066
- });
27067
- });
27068
- }
27069
- };
27070
- function findPidByPort(port) {
27071
- let platform = process.platform;
27072
- return new Promise((resolve, reject) => {
27073
- if (!(platform in finders))
27074
- return reject(new Error(`platform ${platform} is unsupported`));
27075
- let findPid = finders[platform];
27076
- typeof findPid == "string" && (findPid = finders[findPid]), findPid(port).then(resolve, reject);
27077
- });
27078
- }
27079
- module2.exports = findPidByPort;
27080
- }
27081
- });
27082
-
27083
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find_process.js
27084
- var require_find_process = __commonJS({
27085
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find_process.js"(exports2, module2) {
27086
- "use strict";
27087
- init_cjs_shims();
27088
- var path = __require("path"), utils = require_utils2();
27089
- function matchName(text, name) {
27090
- return name ? text && text.match ? text.match(name) : !1 : !0;
27091
- }
27092
- function fetchBin(cmd) {
27093
- let pieces = cmd.split(path.sep), last = pieces[pieces.length - 1];
27094
- last && (pieces[pieces.length - 1] = last.split(" ")[0]);
27095
- let fixed = [];
27096
- for (let part of pieces) {
27097
- let optIdx = part.indexOf(" -");
27098
- if (optIdx >= 0) {
27099
- fixed.push(part.substring(0, optIdx).trim());
27100
- break;
27101
- } else if (part.endsWith(" ")) {
27102
- fixed.push(part.trim());
27103
- break;
27104
- }
27105
- fixed.push(part);
27106
- }
27107
- return fixed.join(path.sep);
27108
- }
27109
- function fetchName(fullpath) {
27110
- if (process.platform === "darwin") {
27111
- let idx = fullpath.indexOf(".app/");
27112
- if (idx >= 0)
27113
- return path.basename(fullpath.substring(0, idx));
27114
- }
27115
- return path.basename(fullpath);
27116
- }
27117
- var finders = {
27118
- darwin(cond) {
27119
- return new Promise((resolve, reject) => {
27120
- let cmd;
27121
- "pid" in cond ? cmd = `ps -p ${cond.pid} -ww -o pid,ppid,uid,gid,args` : cmd = "ps ax -ww -o pid,ppid,uid,gid,args", utils.exec(cmd, function(err2, stdout, stderr) {
27122
- if (err2)
27123
- "pid" in cond ? resolve([]) : reject(err2);
27124
- else {
27125
- if (err2 = stderr.toString().trim(), err2) {
27126
- reject(err2);
27127
- return;
27128
- }
27129
- let data = utils.stripLine(stdout.toString(), 1), list = utils.extractColumns(data, [0, 1, 2, 3, 4], 5).filter((column) => column[0] && cond.pid ? column[0] === String(cond.pid) : column[4] && cond.name ? matchName(column[4], cond.name) : !!column[0]).map((column) => {
27130
- let cmd2 = String(column[4]), bin = fetchBin(cmd2);
27131
- return {
27132
- pid: parseInt(column[0], 10),
27133
- ppid: parseInt(column[1], 10),
27134
- uid: parseInt(column[2], 10),
27135
- gid: parseInt(column[3], 10),
27136
- name: fetchName(bin),
27137
- bin,
27138
- cmd: column[4]
27139
- };
27140
- });
27141
- cond.strict && cond.name && (list = list.filter((item) => item.name === cond.name)), resolve(list);
27142
- }
27143
- });
27144
- });
27145
- },
27146
- linux: "darwin",
27147
- sunos: "darwin",
27148
- freebsd: "darwin",
27149
- win32(cond) {
27150
- return new Promise((resolve, reject) => {
27151
- let cmd = "Get-CimInstance -className win32_process | select Name,ProcessId,ParentProcessId,CommandLine,ExecutablePath", lines = [], proc = utils.spawn("powershell.exe", ["/c", cmd], { detached: !1, windowsHide: !0 });
27152
- proc.stdout.on("data", (data) => {
27153
- lines.push(data.toString());
27154
- }), proc.on("close", (code) => {
27155
- if (code !== 0)
27156
- return reject(new Error("Command '" + cmd + "' terminated with code: " + code));
27157
- let list = utils.parseTable(lines.join("")).filter((row) => {
27158
- if ("pid" in cond)
27159
- return row.ProcessId === String(cond.pid);
27160
- if (cond.name) {
27161
- let rowName = row.Name || "";
27162
- return cond.strict ? rowName === cond.name || rowName.endsWith(".exe") && rowName.slice(0, -4) === cond.name : matchName(row.CommandLine || rowName, cond.name);
27163
- } else
27164
- return !0;
27165
- }).map((row) => ({
27166
- pid: parseInt(row.ProcessId, 10),
27167
- ppid: parseInt(row.ParentProcessId, 10),
27168
- // uid: void 0,
27169
- // gid: void 0,
27170
- bin: row.ExecutablePath,
27171
- name: row.Name || "",
27172
- cmd: row.CommandLine
27173
- }));
27174
- resolve(list);
27175
- });
27176
- });
27177
- },
27178
- android(cond) {
27179
- return new Promise((resolve, reject) => {
27180
- let cmd = "ps";
27181
- utils.exec(cmd, function(err2, stdout, stderr) {
27182
- if (err2)
27183
- "pid" in cond ? resolve([]) : reject(err2);
27184
- else {
27185
- if (err2 = stderr.toString().trim(), err2) {
27186
- reject(err2);
27187
- return;
27188
- }
27189
- let data = utils.stripLine(stdout.toString(), 1), list = utils.extractColumns(data, [0, 3], 4).filter((column) => column[0] && cond.pid ? column[0] === String(cond.pid) : column[1] && cond.name ? matchName(column[1], cond.name) : !!column[0]).map((column) => {
27190
- let cmd2 = String(column[1]), bin = fetchBin(cmd2);
27191
- return {
27192
- pid: parseInt(column[0], 10),
27193
- // ppid: void 0,
27194
- // uid: void 0,
27195
- // gid: void 0,
27196
- name: fetchName(bin),
27197
- bin,
27198
- cmd: cmd2
27199
- };
27200
- });
27201
- cond.strict && cond.name && (list = list.filter((item) => item.name === cond.name)), resolve(list);
27202
- }
27203
- });
27204
- });
27205
- }
27206
- };
27207
- function findProcess2(cond) {
27208
- let platform = process.platform;
27209
- return new Promise((resolve, reject) => {
27210
- if (!(platform in finders))
27211
- return reject(new Error(`platform ${platform} is unsupported`));
27212
- let find = finders[platform];
27213
- typeof find == "string" && (find = finders[find]), find(cond).then(resolve, reject);
27214
- });
27215
- }
27216
- module2.exports = findProcess2;
27217
- }
27218
- });
27219
-
27220
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find.js
27221
- var require_find = __commonJS({
27222
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find.js"(exports2, module2) {
27223
- "use strict";
27224
- init_cjs_shims();
27225
- var findPid = require_find_pid(), findProcess2 = require_find_process(), findBy = {
27226
- port(port, strict) {
27227
- return findPid(port, strict).then((pid) => findBy.pid(pid, strict), () => []);
27228
- },
27229
- pid(pid, strict) {
27230
- return findProcess2({
27231
- pid,
27232
- strict
27233
- });
27234
- },
27235
- name(name, strict) {
27236
- return findProcess2({
27237
- name,
27238
- strict
27239
- });
27240
- }
27241
- };
27242
- function find(by, value, strict) {
27243
- return new Promise((resolve, reject) => {
27244
- if (!(by in findBy))
27245
- reject(new Error(`do not support find by "${by}"`));
27246
- else {
27247
- let isNumber = /^\d+$/.test(value);
27248
- by === "pid" && !isNumber ? reject(new Error("pid must be a number")) : by === "port" && !isNumber ? reject(new Error("port must be a number")) : findBy[by](value, strict).then(resolve, reject);
27249
- }
27250
- });
27251
- }
27252
- module2.exports = find;
27253
- }
27254
- });
27255
-
27256
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/index.js
27257
- var require_find_process2 = __commonJS({
27258
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/index.js"(exports2, module2) {
27259
- "use strict";
27260
- init_cjs_shims();
27261
- module2.exports = require_find();
27262
- }
27263
- });
27264
-
27265
26837
  // ../../node_modules/.pnpm/bottleneck@2.19.5/node_modules/bottleneck/lib/parser.js
27266
26838
  var require_parser2 = __commonJS({
27267
26839
  "../../node_modules/.pnpm/bottleneck@2.19.5/node_modules/bottleneck/lib/parser.js"(exports2) {
@@ -29719,7 +29291,7 @@ var require_lib3 = __commonJS({
29719
29291
 
29720
29292
  // ../cli-kit/dist/public/common/version.js
29721
29293
  init_cjs_shims();
29722
- var CLI_KIT_VERSION = "3.68.0";
29294
+ var CLI_KIT_VERSION = "3.69.0";
29723
29295
 
29724
29296
  // ../cli-kit/dist/private/node/analytics.js
29725
29297
  init_cjs_shims();
@@ -32640,8 +32212,8 @@ async function shouldRejectUnauthorizedRequests() {
32640
32212
 
32641
32213
  // ../cli-kit/dist/private/node/api/urls.js
32642
32214
  init_cjs_shims();
32643
- function sanitizeURL(url2) {
32644
- let parsedUrl = new URL(url2);
32215
+ function sanitizeURL(url) {
32216
+ let parsedUrl = new URL(url);
32645
32217
  return parsedUrl.searchParams.has("subject_token") && parsedUrl.searchParams.set("subject_token", "****"), parsedUrl.searchParams.has("token") && parsedUrl.searchParams.set("token", "****"), parsedUrl.toString();
32646
32218
  }
32647
32219
 
@@ -32900,7 +32472,7 @@ var resolveHeaders = (headers) => {
32900
32472
  }), acc), []);
32901
32473
  return `query=${encodeURIComponent(params_.jsonSerializer.stringify(payload))}`;
32902
32474
  }, createHttpMethodFetcher = (method) => async (params) => {
32903
- let { url: url2, query, variables, operationName, fetch: fetch4, fetchOptions, middleware } = params, headers = { ...params.headers }, queryParams = "", body;
32475
+ let { url, query, variables, operationName, fetch: fetch4, fetchOptions, middleware } = params, headers = { ...params.headers }, queryParams = "", body;
32904
32476
  method === "POST" ? (body = createRequestBody_default(query, variables, operationName, fetchOptions.jsonSerializer), typeof body == "string" && (headers["Content-Type"] = "application/json")) : queryParams = buildRequestConfig({
32905
32477
  query,
32906
32478
  variables,
@@ -32912,20 +32484,20 @@ var resolveHeaders = (headers) => {
32912
32484
  headers,
32913
32485
  body,
32914
32486
  ...fetchOptions
32915
- }, urlResolved = url2, initResolved = init;
32487
+ }, urlResolved = url, initResolved = init;
32916
32488
  if (middleware) {
32917
- let result = await Promise.resolve(middleware({ ...init, url: url2, operationName, variables })), { url: urlNew, ...initNew } = result;
32489
+ let result = await Promise.resolve(middleware({ ...init, url, operationName, variables })), { url: urlNew, ...initNew } = result;
32918
32490
  urlResolved = urlNew, initResolved = initNew;
32919
32491
  }
32920
32492
  return queryParams && (urlResolved = `${urlResolved}?${queryParams}`), await fetch4(urlResolved, initResolved);
32921
32493
  }, GraphQLClient = class {
32922
- constructor(url2, requestConfig = {}) {
32923
- this.url = url2, this.requestConfig = requestConfig, this.rawRequest = async (...args) => {
32924
- let [queryOrOptions, variables, requestHeaders] = args, rawRequestOptions = parseRawRequestArgs(queryOrOptions, variables, requestHeaders), { headers, fetch: fetch4 = CrossFetch.default, method = "POST", requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig, { url: url3 } = this;
32494
+ constructor(url, requestConfig = {}) {
32495
+ this.url = url, this.requestConfig = requestConfig, this.rawRequest = async (...args) => {
32496
+ let [queryOrOptions, variables, requestHeaders] = args, rawRequestOptions = parseRawRequestArgs(queryOrOptions, variables, requestHeaders), { headers, fetch: fetch4 = CrossFetch.default, method = "POST", requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig, { url: url2 } = this;
32925
32497
  rawRequestOptions.signal !== void 0 && (fetchOptions.signal = rawRequestOptions.signal);
32926
32498
  let { operationName } = resolveRequestDocument(rawRequestOptions.query);
32927
32499
  return makeRequest({
32928
- url: url3,
32500
+ url: url2,
32929
32501
  query: rawRequestOptions.query,
32930
32502
  variables: rawRequestOptions.variables,
32931
32503
  headers: {
@@ -32943,11 +32515,11 @@ var resolveHeaders = (headers) => {
32943
32515
  };
32944
32516
  }
32945
32517
  async request(documentOrOptions, ...variablesAndRequestHeaders) {
32946
- let [variables, requestHeaders] = variablesAndRequestHeaders, requestOptions = parseRequestArgs(documentOrOptions, variables, requestHeaders), { headers, fetch: fetch4 = CrossFetch.default, method = "POST", requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig, { url: url2 } = this;
32518
+ let [variables, requestHeaders] = variablesAndRequestHeaders, requestOptions = parseRequestArgs(documentOrOptions, variables, requestHeaders), { headers, fetch: fetch4 = CrossFetch.default, method = "POST", requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig, { url } = this;
32947
32519
  requestOptions.signal !== void 0 && (fetchOptions.signal = requestOptions.signal);
32948
32520
  let { query, operationName } = resolveRequestDocument(requestOptions.document);
32949
32521
  return makeRequest({
32950
- url: url2,
32522
+ url,
32951
32523
  query,
32952
32524
  variables: requestOptions.variables,
32953
32525
  headers: {
@@ -33042,8 +32614,8 @@ var allAPIs = ["admin", "storefront-renderer", "partners", "business-platform",
33042
32614
  function responseHeaderIsInteresting(header) {
33043
32615
  return interestingResponseHeaders.has(header);
33044
32616
  }
33045
- async function makeVerboseRequest({ request, url: url2 }) {
33046
- let t0 = performance.now(), duration = 0, responseHeaders = {}, sanitizedUrl = sanitizeURL(url2), response = {};
32617
+ async function makeVerboseRequest({ request, url }) {
32618
+ let t0 = performance.now(), duration = 0, responseHeaders = {}, sanitizedUrl = sanitizeURL(url), response = {};
33047
32619
  try {
33048
32620
  response = await request(), response.headers.forEach((value, key) => {
33049
32621
  responseHeaderIsInteresting(key) && (responseHeaders[key] = value);
@@ -33051,11 +32623,11 @@ async function makeVerboseRequest({ request, url: url2 }) {
33051
32623
  } catch (err2) {
33052
32624
  let t12 = performance.now();
33053
32625
  if (duration = Math.round(t12 - t0), err2 instanceof ClientError) {
33054
- if (err2.response?.headers)
33055
- for (let [key, value] of err2.response?.headers)
32626
+ if (err2.response.headers)
32627
+ for (let [key, value] of err2.response.headers)
33056
32628
  responseHeaderIsInteresting(key) && (responseHeaders[key] = value);
33057
32629
  let sanitizedHeaders = sanitizedHeadersOutput(responseHeaders);
33058
- if (err2.response.errors?.some((error) => error.extensions?.code === "429") || err2.response.status === 429) {
32630
+ if (err2.response.errors?.some((error) => error.extensions.code === "429") || err2.response.status === 429) {
33059
32631
  let delayMs;
33060
32632
  try {
33061
32633
  delayMs = responseHeaders["retry-after"] ? Number.parseInt(responseHeaders["retry-after"], 10) : void 0;
@@ -33099,8 +32671,8 @@ async function makeVerboseRequest({ request, url: url2 }) {
33099
32671
  requestId: responseHeaders["x-request-id"]
33100
32672
  };
33101
32673
  }
33102
- async function simpleRequestWithDebugLog({ request, url: url2 }, errorHandler2) {
33103
- let result = await makeVerboseRequest({ request, url: url2 });
32674
+ async function simpleRequestWithDebugLog({ request, url }, errorHandler2) {
32675
+ let result = await makeVerboseRequest({ request, url });
33104
32676
  switch (outputDebug(`Request to ${result.sanitizedUrl} completed in ${result.duration} ms
33105
32677
  With response headers:
33106
32678
  ${result.sanitizedHeaders}
@@ -33115,10 +32687,10 @@ ${result.sanitizedHeaders}
33115
32687
  throw errorHandler2 ? errorHandler2(result.clientError, result.requestId) : result.clientError;
33116
32688
  }
33117
32689
  }
33118
- async function retryAwareRequest({ request, url: url2 }, errorHandler2, retryOptions = {
32690
+ async function retryAwareRequest({ request, url }, errorHandler2, retryOptions = {
33119
32691
  scheduleDelay: setTimeout
33120
32692
  }) {
33121
- let retriesUsed = 0, limitRetriesTo = retryOptions.limitRetriesTo ?? DEFAULT_RETRY_LIMIT, result = await makeVerboseRequest({ request, url: url2 });
32693
+ let retriesUsed = 0, limitRetriesTo = retryOptions.limitRetriesTo ?? DEFAULT_RETRY_LIMIT, result = await makeVerboseRequest({ request, url });
33122
32694
  for (outputDebug(`Request to ${result.sanitizedUrl} completed in ${result.duration} ms
33123
32695
  With response headers:
33124
32696
  ${result.sanitizedHeaders}
@@ -33133,9 +32705,11 @@ ${result.sanitizedHeaders}
33133
32705
  throw outputDebug(`${limitRetriesTo} retries exhausted for request to ${result.sanitizedUrl}`), errorHandler2 ? errorHandler2(result.clientError, result.requestId) : result.clientError;
33134
32706
  retriesUsed += 1;
33135
32707
  let retryDelayMs = result.delayMs ?? retryOptions.defaultDelayMs ?? DEFAULT_RETRY_DELAY_MS;
33136
- outputDebug(`Scheduling retry request #${retriesUsed} to ${result.sanitizedUrl} in ${retryDelayMs} ms`), result = await new Promise((resolve) => retryOptions.scheduleDelay(() => {
33137
- resolve(makeVerboseRequest({ request, url: url2 }));
33138
- }, retryDelayMs));
32708
+ outputDebug(`Scheduling retry request #${retriesUsed} to ${result.sanitizedUrl} in ${retryDelayMs} ms`), result = await new Promise((resolve) => {
32709
+ retryOptions.scheduleDelay(() => {
32710
+ resolve(makeVerboseRequest({ request, url }));
32711
+ }, retryDelayMs);
32712
+ });
33139
32713
  }
33140
32714
  }
33141
32715
 
@@ -33571,12 +33145,12 @@ var INTERNALS2 = Symbol("Response internals"), Response = class _Response extend
33571
33145
  * @param {number} status An optional status code for the response (e.g., 302.)
33572
33146
  * @returns {Response} A Response object.
33573
33147
  */
33574
- static redirect(url2, status = 302) {
33148
+ static redirect(url, status = 302) {
33575
33149
  if (!isRedirect(status))
33576
33150
  throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
33577
33151
  return new _Response(null, {
33578
33152
  headers: {
33579
- location: new URL(url2).toString()
33153
+ location: new URL(url).toString()
33580
33154
  },
33581
33155
  status
33582
33156
  });
@@ -33627,8 +33201,8 @@ var getSearch = (parsedURL) => {
33627
33201
  // ../../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/referrer.js
33628
33202
  init_cjs_shims();
33629
33203
  import { isIP } from "node:net";
33630
- function stripURLForUseAsAReferrer(url2, originOnly = !1) {
33631
- return url2 == null || (url2 = new URL(url2), /^(about|blob|data):$/.test(url2.protocol)) ? "no-referrer" : (url2.username = "", url2.password = "", url2.hash = "", originOnly && (url2.pathname = "", url2.search = ""), url2);
33204
+ function stripURLForUseAsAReferrer(url, originOnly = !1) {
33205
+ return url == null || (url = new URL(url), /^(about|blob|data):$/.test(url.protocol)) ? "no-referrer" : (url.username = "", url.password = "", url.hash = "", originOnly && (url.pathname = "", url.search = ""), url);
33632
33206
  }
33633
33207
  var ReferrerPolicy = /* @__PURE__ */ new Set([
33634
33208
  "",
@@ -33646,14 +33220,14 @@ function validateReferrerPolicy(referrerPolicy) {
33646
33220
  throw new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`);
33647
33221
  return referrerPolicy;
33648
33222
  }
33649
- function isOriginPotentiallyTrustworthy(url2) {
33650
- if (/^(http|ws)s:$/.test(url2.protocol))
33223
+ function isOriginPotentiallyTrustworthy(url) {
33224
+ if (/^(http|ws)s:$/.test(url.protocol))
33651
33225
  return !0;
33652
- let hostIp = url2.host.replace(/(^\[)|(]$)/g, ""), hostIPVersion = isIP(hostIp);
33653
- return hostIPVersion === 4 && /^127\./.test(hostIp) || hostIPVersion === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp) ? !0 : url2.host === "localhost" || url2.host.endsWith(".localhost") ? !1 : url2.protocol === "file:";
33226
+ let hostIp = url.host.replace(/(^\[)|(]$)/g, ""), hostIPVersion = isIP(hostIp);
33227
+ return hostIPVersion === 4 && /^127\./.test(hostIp) || hostIPVersion === 6 && /^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(hostIp) ? !0 : url.host === "localhost" || url.host.endsWith(".localhost") ? !1 : url.protocol === "file:";
33654
33228
  }
33655
- function isUrlPotentiallyTrustworthy(url2) {
33656
- return /^about:(blank|srcdoc)$/.test(url2) || url2.protocol === "data:" || /^(blob|filesystem):$/.test(url2.protocol) ? !0 : isOriginPotentiallyTrustworthy(url2);
33229
+ function isUrlPotentiallyTrustworthy(url) {
33230
+ return /^about:(blank|srcdoc)$/.test(url) || url.protocol === "data:" || /^(blob|filesystem):$/.test(url.protocol) ? !0 : isOriginPotentiallyTrustworthy(url);
33657
33231
  }
33658
33232
  function determineRequestsReferrer(request, { referrerURLCallback, referrerOriginCallback } = {}) {
33659
33233
  if (request.referrer === "no-referrer" || request.referrerPolicy === "")
@@ -33828,11 +33402,11 @@ var AbortError2 = class extends FetchBaseError {
33828
33402
 
33829
33403
  // ../../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/index.js
33830
33404
  var supportedSchemas = /* @__PURE__ */ new Set(["data:", "http:", "https:"]);
33831
- async function fetch(url2, options_) {
33405
+ async function fetch(url, options_) {
33832
33406
  return new Promise((resolve, reject) => {
33833
- let request = new Request(url2, options_), { parsedURL, options: options2 } = getNodeRequestOptions(request);
33407
+ let request = new Request(url, options_), { parsedURL, options: options2 } = getNodeRequestOptions(request);
33834
33408
  if (!supportedSchemas.has(parsedURL.protocol))
33835
- throw new TypeError(`node-fetch cannot load ${url2}. URL scheme "${parsedURL.protocol.replace(/:$/, "")}" is not supported.`);
33409
+ throw new TypeError(`node-fetch cannot load ${url}. URL scheme "${parsedURL.protocol.replace(/:$/, "")}" is not supported.`);
33836
33410
  if (parsedURL.protocol === "data:") {
33837
33411
  let data = dist_default(request.url), response2 = new Response(data, { headers: { "Content-Type": data.typeFull } });
33838
33412
  resolve(response2);
@@ -34003,11 +33577,11 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
34003
33577
  function formData() {
34004
33578
  return new import_form_data2.default();
34005
33579
  }
34006
- async function fetch2(url2, init) {
34007
- return runWithTimer("cmd_all_timing_network_ms")(() => simpleRequestWithDebugLog({ url: url2.toString(), request: () => fetch(url2, init) }));
33580
+ async function fetch2(url, init) {
33581
+ return runWithTimer("cmd_all_timing_network_ms")(() => simpleRequestWithDebugLog({ url: url.toString(), request: () => fetch(url, init) }));
34008
33582
  }
34009
- async function shopifyFetch(url2, init) {
34010
- let sanitizedUrl = sanitizeURL(url2.toString()), options2 = {
33583
+ async function shopifyFetch(url, init) {
33584
+ let sanitizedUrl = sanitizeURL(url.toString()), options2 = {
34011
33585
  ...init ?? {},
34012
33586
  headers: {
34013
33587
  ...await buildHeaders(),
@@ -34016,10 +33590,10 @@ async function shopifyFetch(url2, init) {
34016
33590
  };
34017
33591
  return outputDebug(outputContent`Sending ${options2.method ?? "GET"} request to URL ${sanitizedUrl}
34018
33592
  With request headers:
34019
- ${sanitizedHeadersOutput(options2?.headers ?? {})}
33593
+ ${sanitizedHeadersOutput(options2.headers ?? {})}
34020
33594
  `), runWithTimer("cmd_all_timing_network_ms")(async () => simpleRequestWithDebugLog({
34021
- url: url2.toString(),
34022
- request: async () => fetch(url2, { ...init, agent: await httpsAgent() })
33595
+ url: url.toString(),
33596
+ request: async () => fetch(url, { ...init, agent: await httpsAgent() })
34023
33597
  }));
34024
33598
  }
34025
33599
 
@@ -34368,24 +33942,12 @@ function decodeJwt(jwt) {
34368
33942
  // ../cli-kit/dist/public/node/crypto.js
34369
33943
  init_cjs_shims();
34370
33944
  import crypto from "crypto";
34371
- function randomHex(size) {
34372
- return crypto.randomBytes(size).toString("hex");
34373
- }
34374
- function base64URLEncode(str) {
34375
- return str.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/[=]/g, "");
34376
- }
34377
- function sha256(str) {
34378
- return crypto.createHash("sha256").update(str).digest();
34379
- }
34380
33945
  function hashString(str) {
34381
33946
  return crypto.createHash("sha1").update(str).digest("hex");
34382
33947
  }
34383
33948
  function fileHash(buff) {
34384
33949
  return crypto.createHash("md5").update(buff).digest("hex");
34385
33950
  }
34386
- function randomBytes(size) {
34387
- return crypto.randomBytes(size);
34388
- }
34389
33951
  function randomUUID() {
34390
33952
  return crypto.randomUUID();
34391
33953
  }
@@ -34399,16 +33961,6 @@ var InvalidGrantError = class extends import_ts_error.ExtendableError {
34399
33961
  }, InvalidRequestError = class extends import_ts_error.ExtendableError {
34400
33962
  }, InvalidTargetError = class extends AbortError {
34401
33963
  };
34402
- async function exchangeCodeForAccessToken(codeData) {
34403
- let clientId2 = await clientId(), params = {
34404
- grant_type: "authorization_code",
34405
- code: codeData.code,
34406
- redirect_uri: "http://127.0.0.1:3456",
34407
- client_id: clientId2,
34408
- code_verifier: codeData.codeVerifier
34409
- }, value = (await tokenRequest(params)).mapError(tokenRequestErrorHandler).valueOrBug();
34410
- return buildIdentityToken(value);
34411
- }
34412
33964
  async function exchangeAccessForApplicationTokens(identityToken, scopes, store2) {
34413
33965
  let token = identityToken.accessToken, appManagementEnabled = isTruthy(process.env.USE_APP_MANAGEMENT_API), [partners, storefront, businessPlatform, admin, appManagement] = await Promise.all([
34414
33966
  requestAppToken("partners", token, scopes.partners),
@@ -34478,9 +34030,9 @@ If you're the store owner, then you need to log in to the store directly using t
34478
34030
  return error === "invalid_grant" ? new InvalidGrantError() : error === "invalid_request" ? new InvalidRequestError() : error === "invalid_target" ? new InvalidTargetError(invalidTargetErrorMessage) : new AbortError(error);
34479
34031
  }
34480
34032
  async function tokenRequest(params) {
34481
- let fqdn = await identityFqdn(), url2 = new URL(`https://${fqdn}/oauth/token`);
34482
- url2.search = new URLSearchParams(Object.entries(params)).toString();
34483
- let res = await shopifyFetch(url2.href, { method: "POST" }), payload = await res.json();
34033
+ let fqdn = await identityFqdn(), url = new URL(`https://${fqdn}/oauth/token`);
34034
+ url.search = new URLSearchParams(Object.entries(params)).toString();
34035
+ let res = await shopifyFetch(url.href, { method: "POST" }), payload = await res.json();
34484
34036
  return res.ok ? ok(payload) : err(payload.error);
34485
34037
  }
34486
34038
  function buildIdentityToken(result, existingUserId) {
@@ -34503,288 +34055,6 @@ function buildApplicationToken(result) {
34503
34055
  };
34504
34056
  }
34505
34057
 
34506
- // ../cli-kit/dist/private/node/session/authorize.js
34507
- init_cjs_shims();
34508
-
34509
- // ../cli-kit/dist/private/node/session/redirect-listener.js
34510
- init_cjs_shims();
34511
-
34512
- // ../cli-kit/dist/private/node/session/post-auth.js
34513
- init_cjs_shims();
34514
- var HTMLFileNames = [
34515
- "empty-url.html",
34516
- "auth-error.html",
34517
- "missing-code.html",
34518
- "missing-state.html",
34519
- "success.html"
34520
- ], StylesheetFilename = "style.css", FaviconFileName = "favicon.svg", getFilePath = async (fileName) => {
34521
- let filePath = await findPathUp(`assets/${fileName}`, {
34522
- type: "file",
34523
- cwd: moduleDirectory(import.meta.url)
34524
- });
34525
- if (!filePath)
34526
- throw RedirectPageAssetNotFoundError();
34527
- return filePath;
34528
- }, getEmptyUrlHTML = async () => {
34529
- let filePath = await getFilePath(HTMLFileNames[0]);
34530
- return readFile(filePath);
34531
- }, getAuthErrorHTML = async () => {
34532
- let filePath = await getFilePath(HTMLFileNames[1]);
34533
- return readFile(filePath);
34534
- }, getMissingCodeHTML = async () => {
34535
- let filePath = await getFilePath(HTMLFileNames[2]);
34536
- return readFile(filePath);
34537
- }, getMissingStateHTML = async () => {
34538
- let filePath = await getFilePath(HTMLFileNames[3]);
34539
- return readFile(filePath);
34540
- }, getSuccessHTML = async () => {
34541
- let filePath = await getFilePath(HTMLFileNames[4]);
34542
- return readFile(filePath);
34543
- }, getStylesheet = async () => {
34544
- let filePath = await getFilePath(StylesheetFilename);
34545
- return readFile(filePath);
34546
- }, getFavicon = async () => {
34547
- let filePath = await getFilePath(FaviconFileName);
34548
- return readFile(filePath);
34549
- }, EmptyUrlString = "We received the authentication redirect but the URL is empty.", MissingCodeString = "The authentication can't continue because the redirect doesn't include the code.", MissingStateString = "The authentication can't continue because the redirect doesn't include the state.", RedirectPageAssetNotFoundError = () => new BugError("Redirect page asset not found");
34550
-
34551
- // ../cli-kit/dist/private/node/session/redirect-listener.js
34552
- import url from "url";
34553
- import { createServer } from "http";
34554
- var ResponseTimeoutSeconds = 10, ServerStopDelaySeconds = 0.5, RedirectListener = class _RedirectListener {
34555
- static createServer(callback) {
34556
- return createServer(async (request, response) => {
34557
- let requestUrl = request.url;
34558
- if (requestUrl?.includes("favicon")) {
34559
- let faviconFile = await getFavicon();
34560
- return response.setHeader("Content-Type", "image/svg+xml"), response.write(faviconFile), response.end(), {};
34561
- } else if (requestUrl === "/style.css") {
34562
- let stylesheetFile = await getStylesheet();
34563
- return response.setHeader("Content-Type", "text/css"), response.write(stylesheetFile), response.end(), {};
34564
- }
34565
- let respond = async (contents, error, state, code) => (response.setHeader("Content-Type", "text/html"), response.write(contents), response.end(), callback(error, state, code), {});
34566
- if (!requestUrl) {
34567
- let file2 = await getEmptyUrlHTML(), err2 = new BugError(EmptyUrlString);
34568
- return respond(file2, err2, void 0, void 0);
34569
- }
34570
- let queryObject = url.parse(requestUrl, !0).query;
34571
- if (queryObject.error && queryObject.error_description) {
34572
- let file2 = await getAuthErrorHTML(), err2 = new AbortError(`${queryObject.error_description}`);
34573
- return respond(file2, err2, void 0, void 0);
34574
- }
34575
- if (!queryObject.code) {
34576
- let file2 = await getMissingCodeHTML(), err2 = new BugError(MissingCodeString);
34577
- return respond(file2, err2, void 0, void 0);
34578
- }
34579
- if (!queryObject.state) {
34580
- let file2 = await getMissingStateHTML(), err2 = new BugError(MissingStateString);
34581
- return respond(file2, err2, void 0, void 0);
34582
- }
34583
- let file = await getSuccessHTML();
34584
- return respond(file, void 0, `${queryObject.code}`, `${queryObject.state}`);
34585
- });
34586
- }
34587
- constructor(options2) {
34588
- this.port = options2.port, this.host = options2.host, this.server = _RedirectListener.createServer(options2.callback);
34589
- }
34590
- start() {
34591
- this.server.listen({ port: this.port, host: this.host }, () => {
34592
- });
34593
- }
34594
- async stop() {
34595
- await this.server.close();
34596
- }
34597
- };
34598
- async function listenRedirect(host, port, url2) {
34599
- return await new Promise((resolve, reject) => {
34600
- let timeout = setTimeout(() => {
34601
- outputInfo(outputContent`${`
34602
- Auto-open timed out. Open the login page: `}${outputToken.link("Log in to Shopify Partners", url2)}\n`);
34603
- }, ResponseTimeoutSeconds * 1e3), callback = (error, code, state) => {
34604
- clearTimeout(timeout), setTimeout(() => {
34605
- redirectListener.stop(), error ? reject(error) : resolve({ code, state });
34606
- }, ServerStopDelaySeconds * 1e3);
34607
- }, redirectListener = new RedirectListener({ host, port, callback });
34608
- redirectListener.start();
34609
- });
34610
- }
34611
-
34612
- // ../../node_modules/.pnpm/get-port-please@3.0.1/node_modules/get-port-please/dist/index.mjs
34613
- init_cjs_shims();
34614
- import { createServer as createServer2 } from "node:net";
34615
- import { networkInterfaces } from "node:os";
34616
- var unsafePorts = /* @__PURE__ */ new Set([
34617
- 1,
34618
- 7,
34619
- 9,
34620
- 11,
34621
- 13,
34622
- 15,
34623
- 17,
34624
- 19,
34625
- 20,
34626
- 21,
34627
- 22,
34628
- 23,
34629
- 25,
34630
- 37,
34631
- 42,
34632
- 43,
34633
- 53,
34634
- 69,
34635
- 77,
34636
- 79,
34637
- 87,
34638
- 95,
34639
- 101,
34640
- 102,
34641
- 103,
34642
- 104,
34643
- 109,
34644
- 110,
34645
- 111,
34646
- 113,
34647
- 115,
34648
- 117,
34649
- 119,
34650
- 123,
34651
- 135,
34652
- 137,
34653
- 139,
34654
- 143,
34655
- 161,
34656
- 179,
34657
- 389,
34658
- 427,
34659
- 465,
34660
- 512,
34661
- 513,
34662
- 514,
34663
- 515,
34664
- 526,
34665
- 530,
34666
- 531,
34667
- 532,
34668
- 540,
34669
- 548,
34670
- 554,
34671
- 556,
34672
- 563,
34673
- 587,
34674
- 601,
34675
- 636,
34676
- 989,
34677
- 990,
34678
- 993,
34679
- 995,
34680
- 1719,
34681
- 1720,
34682
- 1723,
34683
- 2049,
34684
- 3659,
34685
- 4045,
34686
- 5060,
34687
- 5061,
34688
- 6e3,
34689
- 6566,
34690
- 6665,
34691
- 6666,
34692
- 6667,
34693
- 6668,
34694
- 6669,
34695
- 6697,
34696
- 10080
34697
- ]);
34698
- function isUnsafePort(port) {
34699
- return unsafePorts.has(port);
34700
- }
34701
- function isSafePort(port) {
34702
- return !isUnsafePort(port);
34703
- }
34704
- function log(...arguments_) {
34705
- console.log("[get-port]", ...arguments_);
34706
- }
34707
- async function getRandomPort(host) {
34708
- let port = await checkPort(0, host);
34709
- if (port === !1)
34710
- throw new Error("Unable to obtain an available random port number!");
34711
- return port;
34712
- }
34713
- async function checkPort(port, host = process.env.HOST, _verbose) {
34714
- if (host || (host = getLocalHosts([void 0, "0.0.0.0"])), !Array.isArray(host))
34715
- return _checkPort(port, host);
34716
- for (let _host of host) {
34717
- let _port = await _checkPort(port, _host);
34718
- if (_port === !1)
34719
- return port < 1024 && _verbose && log("Unable to listen to priviliged port:", `${_host}:${port}`), !1;
34720
- port === 0 && _port !== 0 && (port = _port);
34721
- }
34722
- return port;
34723
- }
34724
- function _checkPort(port, host) {
34725
- return new Promise((resolve) => {
34726
- let server = createServer2();
34727
- server.unref(), server.on("error", (error) => {
34728
- error.code === "EINVAL" || error.code === "EADDRNOTAVAIL" ? resolve(port !== 0 && isSafePort(port) && port) : resolve(!1);
34729
- }), server.listen({ port, host }, () => {
34730
- let { port: port2 } = server.address();
34731
- server.close(() => {
34732
- resolve(isSafePort(port2) && port2);
34733
- });
34734
- });
34735
- });
34736
- }
34737
- function getLocalHosts(additional) {
34738
- let hosts = new Set(additional);
34739
- for (let _interface of Object.values(networkInterfaces()))
34740
- for (let config of _interface || [])
34741
- hosts.add(config.address);
34742
- return [...hosts];
34743
- }
34744
-
34745
- // ../cli-kit/dist/private/node/session/authorize.js
34746
- var import_find_process = __toESM(require_find_process2(), 1);
34747
- async function authorize(scopes, state = randomHex(30)) {
34748
- let host = "127.0.0.1", redirectUri = `http://${host}:3456`, fqdn = await identityFqdn(), identityClientId = clientId();
34749
- await validateRedirectionPortAvailability(3456);
34750
- let url2 = `http://${fqdn}/oauth/authorize`, { codeVerifier, codeChallenge } = generateRandomChallengePair(), params = {
34751
- client_id: identityClientId,
34752
- scope: scopes.join(" "),
34753
- redirect_uri: redirectUri,
34754
- state,
34755
- response_type: "code",
34756
- code_challenge_method: "S256",
34757
- code_challenge: codeChallenge
34758
- };
34759
- return outputInfo(`
34760
- To run this command, log in to Shopify.`), outputInfo("\u{1F449} Press any key to open the login page on your browser"), await keypress(), url2 = `${url2}?${new URLSearchParams(params).toString()}`, await openURL(url2), runWithTimer("cmd_all_timing_prompts_ms")(async () => {
34761
- let result = await listenRedirect(host, 3456, url2);
34762
- if (result.state !== state)
34763
- throw new AbortError("The state received from the authentication doesn't match the one that initiated the authentication process.");
34764
- return { code: result.code, codeVerifier };
34765
- });
34766
- }
34767
- function generateRandomChallengePair() {
34768
- let codeVerifier = base64URLEncode(randomBytes(32)), codeChallenge = base64URLEncode(sha256(codeVerifier));
34769
- return { codeVerifier, codeChallenge };
34770
- }
34771
- async function validateRedirectionPortAvailability(port) {
34772
- let { killPortProcess } = await import("./lib-H3ZZGS7I.js");
34773
- if (!await checkPort(port))
34774
- if (await terminateBlockingPortProcessPrompt(port, "Authentication"))
34775
- await killPortProcess(port);
34776
- else
34777
- throw new CancelExecution();
34778
- }
34779
- async function terminateBlockingPortProcessPrompt(port, stepDescription) {
34780
- let processInfo = await (0, import_find_process.default)("port", port), formattedProcessName = processInfo && processInfo.length > 0 && processInfo[0]?.name ? ` (${processInfo[0].name})` : "";
34781
- return renderConfirmationPrompt({
34782
- message: `${stepDescription} requires a port ${port} that's unavailable because it's running another process${formattedProcessName}. Terminate that process?`,
34783
- confirmationMessage: "Yes, terminate process in order to log in now",
34784
- cancellationMessage: "No, cancel command and try later"
34785
- });
34786
- }
34787
-
34788
34058
  // ../cli-kit/dist/private/node/session/store.js
34789
34059
  init_cjs_shims();
34790
34060
  async function store(session) {
@@ -34807,7 +34077,7 @@ async function remove() {
34807
34077
  // ../cli-kit/dist/private/node/session/device-authorization.js
34808
34078
  init_cjs_shims();
34809
34079
  async function requestDeviceAuthorization(scopes) {
34810
- let fqdn = await identityFqdn(), queryParams = { client_id: clientId(), scope: scopes.join(" ") }, url2 = `https://${fqdn}/oauth/device_authorization`, jsonResult = await (await shopifyFetch(url2, {
34080
+ let fqdn = await identityFqdn(), queryParams = { client_id: clientId(), scope: scopes.join(" ") }, url = `https://${fqdn}/oauth/device_authorization`, jsonResult = await (await shopifyFetch(url, {
34811
34081
  method: "POST",
34812
34082
  headers: { "Content-type": "application/x-www-form-urlencoded" },
34813
34083
  body: convertRequestToParams(queryParams)
@@ -34833,18 +34103,26 @@ async function pollForDeviceAuthorization(code, interval = 5) {
34833
34103
  return new Promise((resolve, reject) => {
34834
34104
  let onPoll = async () => {
34835
34105
  let result = await exchangeDeviceCodeForAccessToken(code);
34836
- if (!result.isErr())
34837
- return resolve(result.value);
34106
+ if (!result.isErr()) {
34107
+ resolve(result.value);
34108
+ return;
34109
+ }
34838
34110
  let error = result.error ?? "unknown_failure";
34839
34111
  switch (outputDebug(outputContent`Polling for device authorization... status: ${error}`), error) {
34840
- case "authorization_pending":
34841
- return startPolling();
34112
+ case "authorization_pending": {
34113
+ startPolling();
34114
+ return;
34115
+ }
34842
34116
  case "slow_down":
34843
- return currentIntervalInSeconds += 5, startPolling();
34117
+ currentIntervalInSeconds += 5;
34118
+ {
34119
+ startPolling();
34120
+ return;
34121
+ }
34844
34122
  case "access_denied":
34845
34123
  case "expired_token":
34846
34124
  case "unknown_failure":
34847
- return reject(result);
34125
+ reject(result);
34848
34126
  }
34849
34127
  }, startPolling = () => {
34850
34128
  setTimeout(onPoll, currentIntervalInSeconds * 1e3);
@@ -34863,8 +34141,10 @@ function restRequestBody(requestBody) {
34863
34141
  return JSON.stringify(requestBody);
34864
34142
  }
34865
34143
  function restRequestUrl(session, apiVersion, path, searchParams = {}, env = process.env) {
34866
- let themeKitAccessDomain = env[environmentVariables.themeKitAccessDomain] || defaultThemeKitAccessDomain, url2 = new URL(isThemeAccessSession(session) ? `https://${themeKitAccessDomain}/cli/admin/api/${apiVersion}${path}.json` : `https://${session.storeFqdn}/admin/api/${apiVersion}${path}.json`);
34867
- return Object.entries(searchParams).forEach(([name, value]) => url2.searchParams.set(name, value)), url2.toString();
34144
+ let themeKitAccessDomain = env[environmentVariables.themeKitAccessDomain] || defaultThemeKitAccessDomain, url = new URL(isThemeAccessSession(session) ? `https://${themeKitAccessDomain}/cli/admin/api/${apiVersion}${path}.json` : `https://${session.storeFqdn}/admin/api/${apiVersion}${path}.json`);
34145
+ return Object.entries(searchParams).forEach(([name, value]) => {
34146
+ url.searchParams.set(name, value);
34147
+ }), url.toString();
34868
34148
  }
34869
34149
  function restRequestHeaders(session) {
34870
34150
  let store2 = session.storeFqdn, token = session.token, headers = buildHeaders(session.token);
@@ -34917,15 +34197,23 @@ Request ID: ${requestId}
34917
34197
 
34918
34198
  // ../cli-kit/dist/public/node/api/graphql.js
34919
34199
  async function performGraphQLRequest(options2) {
34920
- let { token, addedHeaders, queryAsString, variables, api, url: url2, responseOptions } = options2, headers = {
34200
+ let { token, addedHeaders, queryAsString, variables, api, url, responseOptions } = options2, headers = {
34921
34201
  ...addedHeaders,
34922
34202
  ...buildHeaders(token)
34923
34203
  };
34924
34204
  debugLogRequestInfo(api, queryAsString, variables, headers);
34925
- let clientOptions = { agent: await httpsAgent(), headers }, client = new GraphQLClient(url2, clientOptions);
34205
+ let clientOptions = { agent: await httpsAgent(), headers }, client = new GraphQLClient(url, clientOptions);
34926
34206
  return runWithTimer("cmd_all_timing_network_ms")(async () => {
34927
- let response = await retryAwareRequest({ request: () => client.rawRequest(queryAsString, variables), url: url2 }, responseOptions?.handleErrors === !1 ? void 0 : errorHandler(api));
34928
- return responseOptions?.onResponse && responseOptions.onResponse(response), response.data;
34207
+ let response = await retryAwareRequest({ request: () => client.rawRequest(queryAsString, variables), url }, responseOptions?.handleErrors === !1 ? void 0 : errorHandler(api));
34208
+ responseOptions?.onResponse && responseOptions.onResponse(response);
34209
+ try {
34210
+ let requestId = response.headers.get("x-request-id");
34211
+ await addPublicMetadata(async () => ({
34212
+ cmd_all_last_graphql_request_id: requestId ?? void 0
34213
+ }));
34214
+ } catch {
34215
+ }
34216
+ return response.data;
34929
34217
  });
34930
34218
  }
34931
34219
  async function graphqlRequest(options2) {
@@ -34971,11 +34259,11 @@ var import_bottleneck = __toESM(require_lib3(), 1), limiter = new import_bottlen
34971
34259
  maxConcurrent: 10
34972
34260
  });
34973
34261
  async function setupRequest(token) {
34974
- let api = "Partners", url2 = `https://${await partnersFqdn()}/api/cli/graphql`;
34262
+ let api = "Partners", url = `https://${await partnersFqdn()}/api/cli/graphql`;
34975
34263
  return {
34976
34264
  token,
34977
34265
  api,
34978
- url: url2,
34266
+ url,
34979
34267
  responseOptions: { onResponse: handleDeprecations }
34980
34268
  };
34981
34269
  }
@@ -35102,14 +34390,10 @@ async function executeCompleteFlow(applications, identityFqdn2) {
35102
34390
  let identityToken, identityTokenInformation = getIdentityTokenInformation();
35103
34391
  if (identityTokenInformation)
35104
34392
  identityToken = buildIdentityTokenFromEnv(scopes, identityTokenInformation);
35105
- else if (useDeviceAuth()) {
34393
+ else {
35106
34394
  outputDebug(outputContent`Requesting device authorization code...`);
35107
34395
  let deviceAuth = await requestDeviceAuthorization(scopes);
35108
34396
  outputDebug(outputContent`Starting polling for the identity token...`), identityToken = await pollForDeviceAuthorization(deviceAuth.deviceCode, deviceAuth.interval);
35109
- } else {
35110
- outputDebug(outputContent`Authorizing through Identity's website...`);
35111
- let code = await authorize(scopes);
35112
- outputDebug(outputContent`Authorization code received. Exchanging it for a CLI token...`), identityToken = await exchangeCodeForAccessToken(code);
35113
34397
  }
35114
34398
  outputDebug(outputContent`CLI token received. Exchanging it for application tokens...`);
35115
34399
  let result = await exchangeAccessForApplicationTokens(identityToken, exchangeScopes, store2), session = {
@@ -35337,8 +34621,6 @@ export {
35337
34621
  ok,
35338
34622
  err,
35339
34623
  exchangeCustomPartnerToken,
35340
- getRandomPort,
35341
- checkPort,
35342
34624
  restRequestBody,
35343
34625
  restRequestUrl,
35344
34626
  restRequestHeaders,
@@ -35375,4 +34657,4 @@ mime-types/index.js:
35375
34657
  * MIT Licensed
35376
34658
  *)
35377
34659
  */
35378
- //# sourceMappingURL=chunk-TOQEXS2N.js.map
34660
+ //# sourceMappingURL=chunk-XMQLNGN7.js.map