@shopify/cli 3.68.1 → 3.69.1

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 (124) hide show
  1. package/dist/assets/graphiql/style.css +58 -0
  2. package/dist/assets/hydrogen/starter/CHANGELOG.md +19 -0
  3. package/dist/assets/hydrogen/starter/app/components/Aside.tsx +24 -1
  4. package/dist/assets/hydrogen/starter/app/components/Header.tsx +13 -6
  5. package/dist/assets/hydrogen/starter/app/components/PageLayout.tsx +5 -3
  6. package/dist/assets/hydrogen/starter/app/components/SearchResultsPredictive.tsx +10 -25
  7. package/dist/assets/hydrogen/starter/app/routes/account.orders.$id.tsx +3 -1
  8. package/dist/assets/hydrogen/starter/package.json +4 -4
  9. package/dist/{chokidar-4TKDAB27.js → chokidar-OESTCX4H.js} +571 -8
  10. package/dist/{chunk-BFQFJ7IZ.js → chunk-27ILOE3X.js} +93 -5
  11. package/dist/{chunk-X4VIZNM7.js → chunk-4P6VDKXH.js} +2 -2
  12. package/dist/{chunk-6RT7XCLB.js → chunk-4UO6LFBD.js} +5 -5
  13. package/dist/{chunk-SFSTMK3J.js → chunk-5W3WRWHE.js} +3 -3
  14. package/dist/{chunk-MS2XBA2O.js → chunk-7SCNBKRX.js} +7 -7
  15. package/dist/{chunk-LAPJDMM4.js → chunk-A3JXD7N7.js} +2 -2
  16. package/dist/{chunk-N2B5M33U.js → chunk-CH6PR2VT.js} +3 -3
  17. package/dist/{chunk-SARPUMOJ.js → chunk-DQISYPN6.js} +4 -4
  18. package/dist/{chunk-3Q52FLVU.js → chunk-DYVC757D.js} +3 -3
  19. package/dist/{chunk-EPBXQ43B.js → chunk-E4FPHMGU.js} +8 -8
  20. package/dist/{chunk-JEUAVIWO.js → chunk-EFRDEP5S.js} +76 -77
  21. package/dist/{chunk-QNE3KDXA.js → chunk-EL4JXI6O.js} +2 -2
  22. package/dist/{chunk-CLB5CEKJ.js → chunk-ERVB6ERU.js} +3 -3
  23. package/dist/{chunk-NPVFC3AI.js → chunk-ITNHP733.js} +4 -4
  24. package/dist/{chunk-O2TXYCMU.js → chunk-JECUABVU.js} +3 -3
  25. package/dist/{chunk-S3KCQ67R.js → chunk-K55EL7HQ.js} +11 -11
  26. package/dist/{chunk-6H3CV7RL.js → chunk-KIVJKHH4.js} +3 -3
  27. package/dist/{chunk-V54N7BU5.js → chunk-KOQHK34U.js} +3 -3
  28. package/dist/{chunk-6MAEOVS3.js → chunk-KWVMII6E.js} +3 -3
  29. package/dist/{chunk-XPDRDFSD.js → chunk-KXCAVMHA.js} +3 -3
  30. package/dist/{chunk-6ZDQFSSJ.js → chunk-LQ7IL4AX.js} +142 -860
  31. package/dist/{chunk-M7RWRKXK.js → chunk-LSXK7YFC.js} +4 -4
  32. package/dist/{chunk-YESRKQ2L.js → chunk-LXEX6UNB.js} +2 -2
  33. package/dist/{chunk-F27QYMO7.js → chunk-MX4RJDBM.js} +591 -20
  34. package/dist/{chunk-ZFVK6EQX.js → chunk-NB4NLOEJ.js} +142 -703
  35. package/dist/{chunk-RUY5HVC5.js → chunk-OA6RDR4W.js} +2 -2
  36. package/dist/{chunk-QAP5YFY6.js → chunk-OFSGLPHJ.js} +2 -2
  37. package/dist/{chunk-NZDBLGNM.js → chunk-P7JUHQKL.js} +1 -2
  38. package/dist/{chunk-3M35CLHM.js → chunk-PZSU4QTH.js} +2 -2
  39. package/dist/{chunk-GLV27A4V.js → chunk-SS3JYL5S.js} +2 -2
  40. package/dist/{chunk-HWFFJANJ.js → chunk-SSVHNTMB.js} +3 -3
  41. package/dist/{chunk-7MDO7W7X.js → chunk-TM426SS3.js} +3 -3
  42. package/dist/{chunk-NOB736ZC.js → chunk-TODOEE5F.js} +3 -3
  43. package/dist/{chunk-7S76TS4X.js → chunk-TRFLZOJU.js} +5 -5
  44. package/dist/{chunk-72AFLINH.js → chunk-VSXWSKVK.js} +4 -4
  45. package/dist/{chunk-YGWIVVUL.js → chunk-VUQJSBXL.js} +161 -39
  46. package/dist/{chunk-GKSNOFYA.js → chunk-WOBGT6C6.js} +2 -2
  47. package/dist/{chunk-BZ2F2UZZ.js → chunk-YEITDZ7O.js} +4 -4
  48. package/dist/{chunk-JF3XJON5.js → chunk-YV6SWFDE.js} +5 -5
  49. package/dist/{chunk-43SYBNY3.js → chunk-ZKXBLV2V.js} +4 -4
  50. package/dist/cli/commands/auth/logout.js +15 -17
  51. package/dist/cli/commands/auth/logout.test.js +16 -18
  52. package/dist/cli/commands/debug/command-flags.js +14 -16
  53. package/dist/cli/commands/demo/catalog.js +15 -17
  54. package/dist/cli/commands/demo/generate-file.js +15 -17
  55. package/dist/cli/commands/demo/index.js +15 -17
  56. package/dist/cli/commands/demo/print-ai-prompt.js +15 -17
  57. package/dist/cli/commands/docs/generate.js +14 -16
  58. package/dist/cli/commands/docs/generate.test.js +14 -16
  59. package/dist/cli/commands/help.js +14 -16
  60. package/dist/cli/commands/kitchen-sink/async.js +15 -17
  61. package/dist/cli/commands/kitchen-sink/async.test.js +15 -17
  62. package/dist/cli/commands/kitchen-sink/index.js +17 -19
  63. package/dist/cli/commands/kitchen-sink/index.test.js +17 -19
  64. package/dist/cli/commands/kitchen-sink/prompts.js +15 -17
  65. package/dist/cli/commands/kitchen-sink/prompts.test.js +15 -17
  66. package/dist/cli/commands/kitchen-sink/static.js +15 -17
  67. package/dist/cli/commands/kitchen-sink/static.test.js +15 -17
  68. package/dist/cli/commands/search.js +15 -17
  69. package/dist/cli/commands/upgrade.js +15 -17
  70. package/dist/cli/commands/version.js +15 -17
  71. package/dist/cli/commands/version.test.js +15 -17
  72. package/dist/cli/services/commands/search.js +7 -9
  73. package/dist/cli/services/commands/search.test.js +7 -9
  74. package/dist/cli/services/commands/version.js +8 -10
  75. package/dist/cli/services/commands/version.test.js +9 -11
  76. package/dist/cli/services/demo.js +7 -9
  77. package/dist/cli/services/demo.test.js +7 -9
  78. package/dist/cli/services/kitchen-sink/async.js +7 -9
  79. package/dist/cli/services/kitchen-sink/prompts.js +7 -9
  80. package/dist/cli/services/kitchen-sink/static.js +7 -9
  81. package/dist/cli/services/upgrade.js +8 -10
  82. package/dist/cli/services/upgrade.test.js +10 -12
  83. package/dist/{constants-TR6ABVLJ.js → constants-T7JXE5K7.js} +2 -2
  84. package/dist/{custom-oclif-loader-KLQXTO4F.js → custom-oclif-loader-ETQSAFQG.js} +9 -11
  85. package/dist/{del-EL3PLWCY.js → del-7ZS2Z64N.js} +4 -4
  86. package/dist/{error-handler-5FD7IHCB.js → error-handler-ITARI4R7.js} +13 -15
  87. package/dist/hooks/postrun.js +14 -15
  88. package/dist/hooks/prerun.js +12 -14
  89. package/dist/index.js +4496 -3687
  90. package/dist/{lib-4WCTNKJK.js → lib-JHUCJTHS.js} +5 -6
  91. package/dist/{local-LNHYBD2A.js → local-JOQLVNNB.js} +7 -11
  92. package/dist/{morph-WDFBUXWF.js → morph-QZYXTRWT.js} +11 -11
  93. package/dist/{node-Y6VIULWD.js → node-XBEXHDBO.js} +18 -20
  94. package/dist/{node-package-manager-6CQ6226U.js → node-package-manager-EQM2DXHD.js} +8 -10
  95. package/dist/out-ZDSLKX4N.js +7 -0
  96. package/dist/{system-LDMV4BPS.js → system-VHEQK233.js} +7 -9
  97. package/dist/tsconfig.tsbuildinfo +1 -1
  98. package/dist/{ui-PA5ER7II.js → ui-SWA4K4YR.js} +7 -9
  99. package/dist/{workerd-APENUASI.js → workerd-QAI4NP7E.js} +17 -19
  100. package/oclif.manifest.json +30 -49
  101. package/package.json +19 -8
  102. package/dist/assets/auth-error.html +0 -23
  103. package/dist/assets/empty-url.html +0 -23
  104. package/dist/assets/favicon.svg +0 -26
  105. package/dist/assets/missing-code.html +0 -23
  106. package/dist/assets/missing-state.html +0 -23
  107. package/dist/assets/style.css +0 -58
  108. package/dist/assets/success.html +0 -20
  109. package/dist/chunk-2AW6NZQ5.js +0 -101
  110. package/dist/chunk-QETDXAFX.js +0 -106
  111. package/dist/lib-H3ZZGS7I.js +0 -1322
  112. package/dist/out-66YUO4CT.js +0 -7
  113. package/dist/templates/theme-extension/assets/thumbs-up.png +0 -0
  114. package/dist/templates/theme-extension/blocks/star_rating.liquid.raw +0 -21
  115. package/dist/templates/theme-extension/locales/en.default.json +0 -10
  116. package/dist/templates/theme-extension/shopify.extension.toml.liquid +0 -3
  117. package/dist/templates/theme-extension/snippets/stars.liquid.raw +0 -10
  118. package/dist/templates/ui-extensions/projects/product_subscription/package.json.liquid +0 -25
  119. package/dist/templates/ui-extensions/projects/product_subscription/shopify.extension.toml.liquid +0 -3
  120. package/dist/templates/ui-extensions/projects/product_subscription/src/index.liquid +0 -46
  121. package/dist/templates/ui-extensions/projects/web_pixel_extension/README.md +0 -23
  122. package/dist/templates/ui-extensions/projects/web_pixel_extension/package.json.liquid +0 -9
  123. package/dist/templates/ui-extensions/projects/web_pixel_extension/shopify.extension.toml.liquid +0 -16
  124. package/dist/templates/ui-extensions/projects/web_pixel_extension/src/index.liquid +0 -10
@@ -5,7 +5,7 @@ import {
5
5
  } from "./chunk-VSLR7ET4.js";
6
6
  import {
7
7
  platformAndArch
8
- } from "./chunk-QAP5YFY6.js";
8
+ } from "./chunk-OFSGLPHJ.js";
9
9
  import {
10
10
  cacheRetrieveOrRepopulate,
11
11
  getCachedPartnerAccountStatus,
@@ -15,17 +15,16 @@ import {
15
15
  removeSession,
16
16
  setCachedPartnerAccountStatus,
17
17
  setSession
18
- } from "./chunk-6MAEOVS3.js";
18
+ } from "./chunk-KWVMII6E.js";
19
19
  import {
20
20
  CLI_KIT_VERSION
21
- } from "./chunk-GKSNOFYA.js";
21
+ } from "./chunk-WOBGT6C6.js";
22
22
  import {
23
23
  z
24
24
  } from "./chunk-NLUGD7PZ.js";
25
25
  import {
26
26
  AbortError,
27
27
  BugError,
28
- CancelExecution,
29
28
  Environment,
30
29
  FatalError,
31
30
  addPublicMetadata,
@@ -33,7 +32,6 @@ import {
33
32
  ciPlatform,
34
33
  cloudEnvironment,
35
34
  currentProcessIsGlobal,
36
- findPathUp,
37
35
  firstPartyDev,
38
36
  import_ts_error,
39
37
  isCloudEnvironment,
@@ -49,24 +47,20 @@ import {
49
47
  outputInfo,
50
48
  outputToken,
51
49
  outputWarn,
52
- readFile,
53
- renderConfirmationPrompt,
54
50
  runWithTimer,
55
51
  serviceEnvironment,
56
52
  spinFqdn,
57
53
  stringifyMessage,
58
- themeToken,
59
- useDeviceAuth
60
- } from "./chunk-YGWIVVUL.js";
54
+ themeToken
55
+ } from "./chunk-VUQJSBXL.js";
61
56
  import {
62
57
  defaultThemeKitAccessDomain,
63
58
  environmentVariables,
64
59
  sessionConstants,
65
60
  systemEnvironmentVariables
66
- } from "./chunk-NZDBLGNM.js";
61
+ } from "./chunk-P7JUHQKL.js";
67
62
  import {
68
- cwd,
69
- moduleDirectory
63
+ cwd
70
64
  } from "./chunk-T2GATXSP.js";
71
65
  import {
72
66
  __commonJS,
@@ -24434,11 +24428,11 @@ var require_url_state_machine = __commonJS({
24434
24428
  function isSpecialScheme(scheme) {
24435
24429
  return specialSchemes[scheme] !== void 0;
24436
24430
  }
24437
- function isSpecial(url2) {
24438
- return isSpecialScheme(url2.scheme);
24431
+ function isSpecial(url) {
24432
+ return isSpecialScheme(url.scheme);
24439
24433
  }
24440
- function isNotSpecial(url2) {
24441
- return !isSpecialScheme(url2.scheme);
24434
+ function isNotSpecial(url) {
24435
+ return !isSpecialScheme(url.scheme);
24442
24436
  }
24443
24437
  function defaultPort(scheme) {
24444
24438
  return specialSchemes[scheme];
@@ -24598,30 +24592,30 @@ var require_url_state_machine = __commonJS({
24598
24592
  });
24599
24593
  return result === null || result === "" ? failure : result;
24600
24594
  }
24601
- function trimControlChars(url2) {
24602
- return url2.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/ug, "");
24595
+ function trimControlChars(url) {
24596
+ return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/ug, "");
24603
24597
  }
24604
- function trimTabAndNewline(url2) {
24605
- return url2.replace(/\u0009|\u000A|\u000D/ug, "");
24598
+ function trimTabAndNewline(url) {
24599
+ return url.replace(/\u0009|\u000A|\u000D/ug, "");
24606
24600
  }
24607
- function shortenPath(url2) {
24608
- let { path } = url2;
24609
- path.length !== 0 && (url2.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0]) || path.pop());
24601
+ function shortenPath(url) {
24602
+ let { path } = url;
24603
+ path.length !== 0 && (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0]) || path.pop());
24610
24604
  }
24611
- function includesCredentials(url2) {
24612
- return url2.username !== "" || url2.password !== "";
24605
+ function includesCredentials(url) {
24606
+ return url.username !== "" || url.password !== "";
24613
24607
  }
24614
- function cannotHaveAUsernamePasswordPort(url2) {
24615
- return url2.host === null || url2.host === "" || url2.scheme === "file";
24608
+ function cannotHaveAUsernamePasswordPort(url) {
24609
+ return url.host === null || url.host === "" || url.scheme === "file";
24616
24610
  }
24617
- function hasAnOpaquePath(url2) {
24618
- return typeof url2.path == "string";
24611
+ function hasAnOpaquePath(url) {
24612
+ return typeof url.path == "string";
24619
24613
  }
24620
24614
  function isNormalizedWindowsDriveLetter(string) {
24621
24615
  return /^[A-Za-z]:$/u.test(string);
24622
24616
  }
24623
- function URLStateMachine(input, base, encodingOverride, url2, stateOverride) {
24624
- 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) {
24617
+ function URLStateMachine(input, base, encodingOverride, url, stateOverride) {
24618
+ 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) {
24625
24619
  this.url = {
24626
24620
  scheme: "",
24627
24621
  username: "",
@@ -24808,28 +24802,28 @@ var require_url_state_machine = __commonJS({
24808
24802
  URLStateMachine.prototype["parse fragment"] = function(c) {
24809
24803
  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;
24810
24804
  };
24811
- function serializeURL(url2, excludeFragment) {
24812
- let output = `${url2.scheme}:`;
24813
- 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;
24805
+ function serializeURL(url, excludeFragment) {
24806
+ let output = `${url.scheme}:`;
24807
+ 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;
24814
24808
  }
24815
24809
  function serializeOrigin(tuple) {
24816
24810
  let result = `${tuple.scheme}://`;
24817
24811
  return result += serializeHost(tuple.host), tuple.port !== null && (result += `:${tuple.port}`), result;
24818
24812
  }
24819
- function serializePath(url2) {
24820
- if (hasAnOpaquePath(url2))
24821
- return url2.path;
24813
+ function serializePath(url) {
24814
+ if (hasAnOpaquePath(url))
24815
+ return url.path;
24822
24816
  let output = "";
24823
- for (let segment of url2.path)
24817
+ for (let segment of url.path)
24824
24818
  output += `/${segment}`;
24825
24819
  return output;
24826
24820
  }
24827
24821
  module2.exports.serializeURL = serializeURL;
24828
24822
  module2.exports.serializePath = serializePath;
24829
- module2.exports.serializeURLOrigin = function(url2) {
24830
- switch (url2.scheme) {
24823
+ module2.exports.serializeURLOrigin = function(url) {
24824
+ switch (url.scheme) {
24831
24825
  case "blob": {
24832
- let pathURL = module2.exports.parseURL(serializePath(url2));
24826
+ let pathURL = module2.exports.parseURL(serializePath(url));
24833
24827
  return pathURL === null || pathURL.scheme !== "http" && pathURL.scheme !== "https" ? "null" : module2.exports.serializeURLOrigin(pathURL);
24834
24828
  }
24835
24829
  case "ftp":
@@ -24838,9 +24832,9 @@ var require_url_state_machine = __commonJS({
24838
24832
  case "ws":
24839
24833
  case "wss":
24840
24834
  return serializeOrigin({
24841
- scheme: url2.scheme,
24842
- host: url2.host,
24843
- port: url2.port
24835
+ scheme: url.scheme,
24836
+ host: url.host,
24837
+ port: url.port
24844
24838
  });
24845
24839
  case "file":
24846
24840
  return "null";
@@ -24853,11 +24847,11 @@ var require_url_state_machine = __commonJS({
24853
24847
  let usm = new URLStateMachine(input, options2.baseURL, options2.encodingOverride, options2.url, options2.stateOverride);
24854
24848
  return usm.failure ? null : usm.url;
24855
24849
  };
24856
- module2.exports.setTheUsername = function(url2, username) {
24857
- url2.username = utf8PercentEncodeString(username, isUserinfoPercentEncode);
24850
+ module2.exports.setTheUsername = function(url, username) {
24851
+ url.username = utf8PercentEncodeString(username, isUserinfoPercentEncode);
24858
24852
  };
24859
- module2.exports.setThePassword = function(url2, password) {
24860
- url2.password = utf8PercentEncodeString(password, isUserinfoPercentEncode);
24853
+ module2.exports.setThePassword = function(url, password) {
24854
+ url.password = utf8PercentEncodeString(password, isUserinfoPercentEncode);
24861
24855
  };
24862
24856
  module2.exports.serializeHost = serializeHost;
24863
24857
  module2.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort;
@@ -25394,18 +25388,18 @@ var require_URL_impl = __commonJS({
25394
25388
  // Unlike the spec, we duplicate some code between the constructor and canParse, because we want to give useful error
25395
25389
  // messages in the constructor that distinguish between the different causes of failure.
25396
25390
  constructor(globalObject, constructorArgs) {
25397
- let url2 = constructorArgs[0], base = constructorArgs[1], parsedBase = null;
25391
+ let url = constructorArgs[0], base = constructorArgs[1], parsedBase = null;
25398
25392
  if (base !== void 0 && (parsedBase = usm.basicURLParse(base), parsedBase === null))
25399
25393
  throw new TypeError(`Invalid base URL: ${base}`);
25400
- let parsedURL = usm.basicURLParse(url2, { baseURL: parsedBase });
25394
+ let parsedURL = usm.basicURLParse(url, { baseURL: parsedBase });
25401
25395
  if (parsedURL === null)
25402
- throw new TypeError(`Invalid URL: ${url2}`);
25396
+ throw new TypeError(`Invalid URL: ${url}`);
25403
25397
  let query = parsedURL.query !== null ? parsedURL.query : "";
25404
25398
  this._url = parsedURL, this._query = URLSearchParams2.createImpl(globalObject, [query], { doNotStripQMark: !0 }), this._query._url = this;
25405
25399
  }
25406
- static canParse(url2, base) {
25400
+ static canParse(url, base) {
25407
25401
  let parsedBase = null;
25408
- return !(base !== void 0 && (parsedBase = usm.basicURLParse(base), parsedBase === null) || usm.basicURLParse(url2, { baseURL: parsedBase }) === null);
25402
+ return !(base !== void 0 && (parsedBase = usm.basicURLParse(base), parsedBase === null) || usm.basicURLParse(url, { baseURL: parsedBase }) === null);
25409
25403
  }
25410
25404
  get href() {
25411
25405
  return usm.serializeURL(this._url);
@@ -25440,8 +25434,8 @@ var require_URL_impl = __commonJS({
25440
25434
  usm.cannotHaveAUsernamePasswordPort(this._url) || usm.setThePassword(this._url, v);
25441
25435
  }
25442
25436
  get host() {
25443
- let url2 = this._url;
25444
- return url2.host === null ? "" : url2.port === null ? usm.serializeHost(url2.host) : `${usm.serializeHost(url2.host)}:${usm.serializeInteger(url2.port)}`;
25437
+ let url = this._url;
25438
+ return url.host === null ? "" : url.port === null ? usm.serializeHost(url.host) : `${usm.serializeHost(url.host)}:${usm.serializeInteger(url.port)}`;
25445
25439
  }
25446
25440
  set host(v) {
25447
25441
  usm.hasAnOpaquePath(this._url) || usm.basicURLParse(v, { url: this._url, stateOverride: "host" });
@@ -25468,13 +25462,13 @@ var require_URL_impl = __commonJS({
25468
25462
  return this._url.query === null || this._url.query === "" ? "" : `?${this._url.query}`;
25469
25463
  }
25470
25464
  set search(v) {
25471
- let url2 = this._url;
25465
+ let url = this._url;
25472
25466
  if (v === "") {
25473
- url2.query = null, this._query._list = [], this._potentiallyStripTrailingSpacesFromAnOpaquePath();
25467
+ url.query = null, this._query._list = [], this._potentiallyStripTrailingSpacesFromAnOpaquePath();
25474
25468
  return;
25475
25469
  }
25476
25470
  let input = v[0] === "?" ? v.substring(1) : v;
25477
- url2.query = "", usm.basicURLParse(input, { url: url2, stateOverride: "query" }), this._query._list = urlencoded.parseUrlencodedString(input);
25471
+ url.query = "", usm.basicURLParse(input, { url, stateOverride: "query" }), this._query._list = urlencoded.parseUrlencodedString(input);
25478
25472
  }
25479
25473
  get searchParams() {
25480
25474
  return this._query;
@@ -25544,7 +25538,7 @@ var require_URL = __commonJS({
25544
25538
  return;
25545
25539
  let ctorRegistry = utils.initCtorRegistry(globalObject);
25546
25540
  class URL2 {
25547
- constructor(url2) {
25541
+ constructor(url) {
25548
25542
  if (arguments.length < 1)
25549
25543
  throw new globalObject.TypeError(
25550
25544
  `Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`
@@ -25740,7 +25734,7 @@ var require_URL = __commonJS({
25740
25734
  globals: globalObject
25741
25735
  }), esValue[implSymbol].hash = V;
25742
25736
  }
25743
- static canParse(url2) {
25737
+ static canParse(url) {
25744
25738
  if (arguments.length < 1)
25745
25739
  throw new globalObject.TypeError(
25746
25740
  `Failed to execute 'canParse' on 'URL': 1 argument required, but only ${arguments.length} present.`
@@ -26504,11 +26498,11 @@ var require_lib2 = __commonJS({
26504
26498
  let orig = new URL$1(original).protocol, dest = new URL$1(destination).protocol;
26505
26499
  return orig === dest;
26506
26500
  };
26507
- function fetch4(url2, opts) {
26501
+ function fetch4(url, opts) {
26508
26502
  if (!fetch4.Promise)
26509
26503
  throw new Error("native promise missing, set fetch.Promise to your favorite alternative");
26510
26504
  return Body2.Promise = fetch4.Promise, new fetch4.Promise(function(resolve, reject) {
26511
- let request = new Request2(url2, opts), options2 = getNodeRequestOptions2(request), send = (options2.protocol === "https:" ? https3 : http3).request, signal = request.signal, response = null, abort = function() {
26505
+ let request = new Request2(url, opts), options2 = getNodeRequestOptions2(request), send = (options2.protocol === "https:" ? https3 : http3).request, signal = request.signal, response = null, abort = function() {
26512
26506
  let error = new AbortError3("The user aborted a request.");
26513
26507
  reject(error), request.body && request.body instanceof Stream3.Readable && destroyStream(request.body, error), !(!response || !response.body) && response.body.emit("error", error);
26514
26508
  };
@@ -26671,8 +26665,8 @@ var require_lib2 = __commonJS({
26671
26665
  var require_node_ponyfill = __commonJS({
26672
26666
  "../../node_modules/.pnpm/cross-fetch@3.1.8/node_modules/cross-fetch/dist/node-ponyfill.js"(exports2, module2) {
26673
26667
  init_cjs_shims();
26674
- var nodeFetch = require_lib2(), realFetch = nodeFetch.default || nodeFetch, fetch4 = function(url2, options2) {
26675
- return /^\/\//.test(url2) && (url2 = "https:" + url2), realFetch.call(this, url2, options2);
26668
+ var nodeFetch = require_lib2(), realFetch = nodeFetch.default || nodeFetch, fetch4 = function(url, options2) {
26669
+ return /^\/\//.test(url) && (url = "https:" + url), realFetch.call(this, url, options2);
26676
26670
  };
26677
26671
  fetch4.ponyfill = !0;
26678
26672
  module2.exports = exports2 = fetch4;
@@ -26848,428 +26842,6 @@ var require_form_data2 = __commonJS({
26848
26842
  }
26849
26843
  });
26850
26844
 
26851
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/utils.js
26852
- var require_utils2 = __commonJS({
26853
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/utils.js"(exports2, module2) {
26854
- "use strict";
26855
- init_cjs_shims();
26856
- var cp = __require("child_process"), UNIT_MB = 1024 * 1024, utils = {
26857
- /**
26858
- * exec command with maxBuffer size
26859
- */
26860
- exec(cmd, callback) {
26861
- cp.exec(cmd, {
26862
- maxBuffer: 2 * UNIT_MB,
26863
- windowsHide: !0
26864
- }, callback);
26865
- },
26866
- /**
26867
- * spawn command
26868
- */
26869
- spawn(cmd, args, options2) {
26870
- return cp.spawn(cmd, args, options2);
26871
- },
26872
- /**
26873
- * Strip top lines of text
26874
- *
26875
- * @param {String} text
26876
- * @param {Number} num
26877
- * @return {String}
26878
- */
26879
- stripLine(text, num) {
26880
- let idx = 0;
26881
- for (; num-- > 0; ) {
26882
- let nIdx = text.indexOf(`
26883
- `, idx);
26884
- nIdx >= 0 && (idx = nIdx + 1);
26885
- }
26886
- return idx > 0 ? text.substring(idx) : text;
26887
- },
26888
- /**
26889
- * Split string and stop at max parts
26890
- *
26891
- * @param {Number} line
26892
- * @param {Number} max
26893
- * @return {Array}
26894
- */
26895
- split(line, max) {
26896
- let cols = line.trim().split(/\s+/);
26897
- return cols.length > max && (cols[max - 1] = cols.slice(max - 1).join(" ")), cols;
26898
- },
26899
- /**
26900
- * Extract columns from table text
26901
- *
26902
- * Example:
26903
- *
26904
- * ```
26905
- * extractColumns(text, [0, 2], 3)
26906
- * ```
26907
- *
26908
- * From:
26909
- * ```
26910
- * foo bar bar2
26911
- * valx valy valz
26912
- * ```
26913
- *
26914
- * To:
26915
- * ```
26916
- * [ ['foo', 'bar2'], ['valx', 'valz'] ]
26917
- * ```
26918
- *
26919
- * @param {String} text raw table text
26920
- * @param {Array} idxes the column index list to extract
26921
- * @param {Number} max max column number of table
26922
- * @return {Array}
26923
- */
26924
- extractColumns(text, idxes, max) {
26925
- let lines = text.split(/(\r\n|\n|\r)/), columns = [];
26926
- return max || (max = Math.max.apply(null, idxes) + 1), lines.forEach((line) => {
26927
- let cols = utils.split(line, max), column = [];
26928
- idxes.forEach((idx) => {
26929
- column.push(cols[idx] || "");
26930
- }), columns.push(column);
26931
- }), columns;
26932
- },
26933
- /**
26934
- * parse table text to array
26935
- *
26936
- * From:
26937
- * ```
26938
- * Header1 : foo
26939
- * Header2 : bar
26940
- * Header3 : val
26941
- *
26942
- * Header1 : foo2
26943
- * Header2 : bar2
26944
- * Header3 : val2
26945
- * ```
26946
- *
26947
- * To:
26948
- * ```
26949
- * [{ Header1: 'foo', Header2: 'bar', Header3: 'val' }, ...]
26950
- * ```
26951
- *
26952
- * @param {String} data raw table data
26953
- * @return {Array}
26954
- */
26955
- parseTable(data) {
26956
- 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));
26957
- return lines.forEach((line) => {
26958
- for (let index = 0; line[index]; ) {
26959
- let entry = line[index];
26960
- entry.startsWith(" ") ? (line[index - 1] += entry.trimLeft(), line.splice(index, 1)) : index += 1;
26961
- }
26962
- }), lines.map((line) => {
26963
- let row = {};
26964
- return line.forEach((string) => {
26965
- let splitterIndex = string.indexOf(":"), key = string.slice(0, splitterIndex).trim();
26966
- row[key] = string.slice(splitterIndex + 1).trim();
26967
- }), row;
26968
- });
26969
- }
26970
- };
26971
- module2.exports = utils;
26972
- }
26973
- });
26974
-
26975
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find_pid.js
26976
- var require_find_pid = __commonJS({
26977
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find_pid.js"(exports2, module2) {
26978
- "use strict";
26979
- init_cjs_shims();
26980
- var os = __require("os"), fs = __require("fs"), utils = require_utils2(), ensureDir = (path) => new Promise((resolve, reject) => {
26981
- fs.existsSync(path) ? resolve() : fs.mkdir(path, (err2) => {
26982
- err2 ? reject(err2) : resolve();
26983
- });
26984
- }), finders = {
26985
- darwin(port) {
26986
- return new Promise((resolve, reject) => {
26987
- utils.exec("netstat -anv -p TCP && netstat -anv -p UDP", function(err2, stdout, stderr) {
26988
- if (err2)
26989
- reject(err2);
26990
- else {
26991
- if (err2 = stderr.toString().trim(), err2) {
26992
- reject(err2);
26993
- return;
26994
- }
26995
- 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) => {
26996
- let matches = String(row[1]).match(/\.(\d+)$/);
26997
- if (matches && matches[1] === String(port))
26998
- return !0;
26999
- });
27000
- found && found[2].length ? resolve(parseInt(found[2], 10)) : reject(new Error(`pid of port (${port}) not found`));
27001
- }
27002
- });
27003
- });
27004
- },
27005
- freebsd: "darwin",
27006
- sunos: "darwin",
27007
- linux(port) {
27008
- return new Promise((resolve, reject) => {
27009
- let cmd = "netstat -tunlp";
27010
- utils.exec(cmd, function(err2, stdout, stderr) {
27011
- if (err2)
27012
- reject(err2);
27013
- else {
27014
- let warn = stderr.toString().trim();
27015
- warn && console.warn(warn);
27016
- let data = utils.stripLine(stdout.toString(), 2), columns = utils.extractColumns(data, [3, 6], 7).find((column) => {
27017
- let matches = String(column[0]).match(/:(\d+)$/);
27018
- if (matches && matches[1] === String(port))
27019
- return !0;
27020
- });
27021
- if (columns && columns[1]) {
27022
- let pid = columns[1].split("/", 1)[0];
27023
- pid.length ? resolve(parseInt(pid, 10)) : reject(new Error(`pid of port (${port}) not found`));
27024
- } else
27025
- reject(new Error(`pid of port (${port}) not found`));
27026
- }
27027
- });
27028
- });
27029
- },
27030
- win32(port) {
27031
- return new Promise((resolve, reject) => {
27032
- utils.exec("netstat -ano", function(err2, stdout, stderr) {
27033
- if (err2)
27034
- reject(err2);
27035
- else {
27036
- if (err2 = stderr.toString().trim(), err2) {
27037
- reject(err2);
27038
- return;
27039
- }
27040
- let data = utils.stripLine(stdout.toString(), 4), columns = utils.extractColumns(data, [1, 4], 5).find((column) => {
27041
- let matches = String(column[0]).match(/:(\d+)$/);
27042
- if (matches && matches[1] === String(port))
27043
- return !0;
27044
- });
27045
- columns && columns[1].length && parseInt(columns[1], 10) > 0 ? resolve(parseInt(columns[1], 10)) : reject(new Error(`pid of port (${port}) not found`));
27046
- }
27047
- });
27048
- });
27049
- },
27050
- android(port) {
27051
- return new Promise((resolve, reject) => {
27052
- let dir = os.tmpdir() + "/.find-process", file = dir + "/" + process.pid, cmd = 'netstat -tunp >> "' + file + '"';
27053
- ensureDir(dir).then(() => {
27054
- utils.exec(cmd, () => {
27055
- fs.readFile(file, "utf8", (err2, data) => {
27056
- if (fs.unlink(file, () => {
27057
- }), err2)
27058
- reject(err2);
27059
- else {
27060
- data = utils.stripLine(data, 2);
27061
- let columns = utils.extractColumns(data, [3, 6], 7).find((column) => {
27062
- let matches = String(column[0]).match(/:(\d+)$/);
27063
- if (matches && matches[1] === String(port))
27064
- return !0;
27065
- });
27066
- if (columns && columns[1]) {
27067
- let pid = columns[1].split("/", 1)[0];
27068
- pid.length ? resolve(parseInt(pid, 10)) : reject(new Error(`pid of port (${port}) not found`));
27069
- } else
27070
- reject(new Error(`pid of port (${port}) not found`));
27071
- }
27072
- });
27073
- });
27074
- });
27075
- });
27076
- }
27077
- };
27078
- function findPidByPort(port) {
27079
- let platform = process.platform;
27080
- return new Promise((resolve, reject) => {
27081
- if (!(platform in finders))
27082
- return reject(new Error(`platform ${platform} is unsupported`));
27083
- let findPid = finders[platform];
27084
- typeof findPid == "string" && (findPid = finders[findPid]), findPid(port).then(resolve, reject);
27085
- });
27086
- }
27087
- module2.exports = findPidByPort;
27088
- }
27089
- });
27090
-
27091
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find_process.js
27092
- var require_find_process = __commonJS({
27093
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find_process.js"(exports2, module2) {
27094
- "use strict";
27095
- init_cjs_shims();
27096
- var path = __require("path"), utils = require_utils2();
27097
- function matchName(text, name) {
27098
- return name ? text && text.match ? text.match(name) : !1 : !0;
27099
- }
27100
- function fetchBin(cmd) {
27101
- let pieces = cmd.split(path.sep), last = pieces[pieces.length - 1];
27102
- last && (pieces[pieces.length - 1] = last.split(" ")[0]);
27103
- let fixed = [];
27104
- for (let part of pieces) {
27105
- let optIdx = part.indexOf(" -");
27106
- if (optIdx >= 0) {
27107
- fixed.push(part.substring(0, optIdx).trim());
27108
- break;
27109
- } else if (part.endsWith(" ")) {
27110
- fixed.push(part.trim());
27111
- break;
27112
- }
27113
- fixed.push(part);
27114
- }
27115
- return fixed.join(path.sep);
27116
- }
27117
- function fetchName(fullpath) {
27118
- if (process.platform === "darwin") {
27119
- let idx = fullpath.indexOf(".app/");
27120
- if (idx >= 0)
27121
- return path.basename(fullpath.substring(0, idx));
27122
- }
27123
- return path.basename(fullpath);
27124
- }
27125
- var finders = {
27126
- darwin(cond) {
27127
- return new Promise((resolve, reject) => {
27128
- let cmd;
27129
- "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) {
27130
- if (err2)
27131
- "pid" in cond ? resolve([]) : reject(err2);
27132
- else {
27133
- if (err2 = stderr.toString().trim(), err2) {
27134
- reject(err2);
27135
- return;
27136
- }
27137
- 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) => {
27138
- let cmd2 = String(column[4]), bin = fetchBin(cmd2);
27139
- return {
27140
- pid: parseInt(column[0], 10),
27141
- ppid: parseInt(column[1], 10),
27142
- uid: parseInt(column[2], 10),
27143
- gid: parseInt(column[3], 10),
27144
- name: fetchName(bin),
27145
- bin,
27146
- cmd: column[4]
27147
- };
27148
- });
27149
- cond.strict && cond.name && (list = list.filter((item) => item.name === cond.name)), resolve(list);
27150
- }
27151
- });
27152
- });
27153
- },
27154
- linux: "darwin",
27155
- sunos: "darwin",
27156
- freebsd: "darwin",
27157
- win32(cond) {
27158
- return new Promise((resolve, reject) => {
27159
- 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 });
27160
- proc.stdout.on("data", (data) => {
27161
- lines.push(data.toString());
27162
- }), proc.on("close", (code) => {
27163
- if (code !== 0)
27164
- return reject(new Error("Command '" + cmd + "' terminated with code: " + code));
27165
- let list = utils.parseTable(lines.join("")).filter((row) => {
27166
- if ("pid" in cond)
27167
- return row.ProcessId === String(cond.pid);
27168
- if (cond.name) {
27169
- let rowName = row.Name || "";
27170
- return cond.strict ? rowName === cond.name || rowName.endsWith(".exe") && rowName.slice(0, -4) === cond.name : matchName(row.CommandLine || rowName, cond.name);
27171
- } else
27172
- return !0;
27173
- }).map((row) => ({
27174
- pid: parseInt(row.ProcessId, 10),
27175
- ppid: parseInt(row.ParentProcessId, 10),
27176
- // uid: void 0,
27177
- // gid: void 0,
27178
- bin: row.ExecutablePath,
27179
- name: row.Name || "",
27180
- cmd: row.CommandLine
27181
- }));
27182
- resolve(list);
27183
- });
27184
- });
27185
- },
27186
- android(cond) {
27187
- return new Promise((resolve, reject) => {
27188
- let cmd = "ps";
27189
- utils.exec(cmd, function(err2, stdout, stderr) {
27190
- if (err2)
27191
- "pid" in cond ? resolve([]) : reject(err2);
27192
- else {
27193
- if (err2 = stderr.toString().trim(), err2) {
27194
- reject(err2);
27195
- return;
27196
- }
27197
- 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) => {
27198
- let cmd2 = String(column[1]), bin = fetchBin(cmd2);
27199
- return {
27200
- pid: parseInt(column[0], 10),
27201
- // ppid: void 0,
27202
- // uid: void 0,
27203
- // gid: void 0,
27204
- name: fetchName(bin),
27205
- bin,
27206
- cmd: cmd2
27207
- };
27208
- });
27209
- cond.strict && cond.name && (list = list.filter((item) => item.name === cond.name)), resolve(list);
27210
- }
27211
- });
27212
- });
27213
- }
27214
- };
27215
- function findProcess2(cond) {
27216
- let platform = process.platform;
27217
- return new Promise((resolve, reject) => {
27218
- if (!(platform in finders))
27219
- return reject(new Error(`platform ${platform} is unsupported`));
27220
- let find = finders[platform];
27221
- typeof find == "string" && (find = finders[find]), find(cond).then(resolve, reject);
27222
- });
27223
- }
27224
- module2.exports = findProcess2;
27225
- }
27226
- });
27227
-
27228
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find.js
27229
- var require_find = __commonJS({
27230
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/lib/find.js"(exports2, module2) {
27231
- "use strict";
27232
- init_cjs_shims();
27233
- var findPid = require_find_pid(), findProcess2 = require_find_process(), findBy = {
27234
- port(port, strict) {
27235
- return findPid(port, strict).then((pid) => findBy.pid(pid, strict), () => []);
27236
- },
27237
- pid(pid, strict) {
27238
- return findProcess2({
27239
- pid,
27240
- strict
27241
- });
27242
- },
27243
- name(name, strict) {
27244
- return findProcess2({
27245
- name,
27246
- strict
27247
- });
27248
- }
27249
- };
27250
- function find(by, value, strict) {
27251
- return new Promise((resolve, reject) => {
27252
- if (!(by in findBy))
27253
- reject(new Error(`do not support find by "${by}"`));
27254
- else {
27255
- let isNumber = /^\d+$/.test(value);
27256
- 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);
27257
- }
27258
- });
27259
- }
27260
- module2.exports = find;
27261
- }
27262
- });
27263
-
27264
- // ../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/index.js
27265
- var require_find_process2 = __commonJS({
27266
- "../../node_modules/.pnpm/find-process@1.4.7/node_modules/find-process/index.js"(exports2, module2) {
27267
- "use strict";
27268
- init_cjs_shims();
27269
- module2.exports = require_find();
27270
- }
27271
- });
27272
-
27273
26845
  // ../../node_modules/.pnpm/bottleneck@2.19.5/node_modules/bottleneck/lib/parser.js
27274
26846
  var require_parser2 = __commonJS({
27275
26847
  "../../node_modules/.pnpm/bottleneck@2.19.5/node_modules/bottleneck/lib/parser.js"(exports2) {
@@ -29919,8 +29491,8 @@ async function shouldRejectUnauthorizedRequests() {
29919
29491
 
29920
29492
  // ../cli-kit/dist/private/node/api/urls.js
29921
29493
  init_cjs_shims();
29922
- function sanitizeURL(url2) {
29923
- let parsedUrl = new URL(url2);
29494
+ function sanitizeURL(url) {
29495
+ let parsedUrl = new URL(url);
29924
29496
  return parsedUrl.searchParams.has("subject_token") && parsedUrl.searchParams.set("subject_token", "****"), parsedUrl.searchParams.has("token") && parsedUrl.searchParams.set("token", "****"), parsedUrl.toString();
29925
29497
  }
29926
29498
 
@@ -30179,7 +29751,7 @@ var resolveHeaders = (headers) => {
30179
29751
  }), acc), []);
30180
29752
  return `query=${encodeURIComponent(params_.jsonSerializer.stringify(payload))}`;
30181
29753
  }, createHttpMethodFetcher = (method) => async (params) => {
30182
- let { url: url2, query, variables, operationName, fetch: fetch4, fetchOptions, middleware } = params, headers = { ...params.headers }, queryParams = "", body;
29754
+ let { url, query, variables, operationName, fetch: fetch4, fetchOptions, middleware } = params, headers = { ...params.headers }, queryParams = "", body;
30183
29755
  method === "POST" ? (body = createRequestBody_default(query, variables, operationName, fetchOptions.jsonSerializer), typeof body == "string" && (headers["Content-Type"] = "application/json")) : queryParams = buildRequestConfig({
30184
29756
  query,
30185
29757
  variables,
@@ -30191,20 +29763,20 @@ var resolveHeaders = (headers) => {
30191
29763
  headers,
30192
29764
  body,
30193
29765
  ...fetchOptions
30194
- }, urlResolved = url2, initResolved = init;
29766
+ }, urlResolved = url, initResolved = init;
30195
29767
  if (middleware) {
30196
- let result = await Promise.resolve(middleware({ ...init, url: url2, operationName, variables })), { url: urlNew, ...initNew } = result;
29768
+ let result = await Promise.resolve(middleware({ ...init, url, operationName, variables })), { url: urlNew, ...initNew } = result;
30197
29769
  urlResolved = urlNew, initResolved = initNew;
30198
29770
  }
30199
29771
  return queryParams && (urlResolved = `${urlResolved}?${queryParams}`), await fetch4(urlResolved, initResolved);
30200
29772
  }, GraphQLClient = class {
30201
- constructor(url2, requestConfig = {}) {
30202
- this.url = url2, this.requestConfig = requestConfig, this.rawRequest = async (...args) => {
30203
- 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;
29773
+ constructor(url, requestConfig = {}) {
29774
+ this.url = url, this.requestConfig = requestConfig, this.rawRequest = async (...args) => {
29775
+ 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;
30204
29776
  rawRequestOptions.signal !== void 0 && (fetchOptions.signal = rawRequestOptions.signal);
30205
29777
  let { operationName } = resolveRequestDocument(rawRequestOptions.query);
30206
29778
  return makeRequest({
30207
- url: url3,
29779
+ url: url2,
30208
29780
  query: rawRequestOptions.query,
30209
29781
  variables: rawRequestOptions.variables,
30210
29782
  headers: {
@@ -30222,11 +29794,11 @@ var resolveHeaders = (headers) => {
30222
29794
  };
30223
29795
  }
30224
29796
  async request(documentOrOptions, ...variablesAndRequestHeaders) {
30225
- let [variables, requestHeaders] = variablesAndRequestHeaders, requestOptions = parseRequestArgs(documentOrOptions, variables, requestHeaders), { headers, fetch: fetch4 = CrossFetch.default, method = "POST", requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig, { url: url2 } = this;
29797
+ let [variables, requestHeaders] = variablesAndRequestHeaders, requestOptions = parseRequestArgs(documentOrOptions, variables, requestHeaders), { headers, fetch: fetch4 = CrossFetch.default, method = "POST", requestMiddleware, responseMiddleware, ...fetchOptions } = this.requestConfig, { url } = this;
30226
29798
  requestOptions.signal !== void 0 && (fetchOptions.signal = requestOptions.signal);
30227
29799
  let { query, operationName } = resolveRequestDocument(requestOptions.document);
30228
29800
  return makeRequest({
30229
- url: url2,
29801
+ url,
30230
29802
  query,
30231
29803
  variables: requestOptions.variables,
30232
29804
  headers: {
@@ -30321,8 +29893,8 @@ var allAPIs = ["admin", "storefront-renderer", "partners", "business-platform",
30321
29893
  function responseHeaderIsInteresting(header) {
30322
29894
  return interestingResponseHeaders.has(header);
30323
29895
  }
30324
- async function makeVerboseRequest({ request, url: url2 }) {
30325
- let t0 = performance.now(), duration = 0, responseHeaders = {}, sanitizedUrl = sanitizeURL(url2), response = {};
29896
+ async function makeVerboseRequest({ request, url }) {
29897
+ let t0 = performance.now(), duration = 0, responseHeaders = {}, sanitizedUrl = sanitizeURL(url), response = {};
30326
29898
  try {
30327
29899
  response = await request(), response.headers.forEach((value, key) => {
30328
29900
  responseHeaderIsInteresting(key) && (responseHeaders[key] = value);
@@ -30330,11 +29902,11 @@ async function makeVerboseRequest({ request, url: url2 }) {
30330
29902
  } catch (err2) {
30331
29903
  let t12 = performance.now();
30332
29904
  if (duration = Math.round(t12 - t0), err2 instanceof ClientError) {
30333
- if (err2.response?.headers)
30334
- for (let [key, value] of err2.response?.headers)
29905
+ if (err2.response.headers)
29906
+ for (let [key, value] of err2.response.headers)
30335
29907
  responseHeaderIsInteresting(key) && (responseHeaders[key] = value);
30336
29908
  let sanitizedHeaders = sanitizedHeadersOutput(responseHeaders);
30337
- if (err2.response.errors?.some((error) => error.extensions?.code === "429") || err2.response.status === 429) {
29909
+ if (err2.response.errors?.some((error) => error.extensions.code === "429") || err2.response.status === 429) {
30338
29910
  let delayMs;
30339
29911
  try {
30340
29912
  delayMs = responseHeaders["retry-after"] ? Number.parseInt(responseHeaders["retry-after"], 10) : void 0;
@@ -30378,8 +29950,8 @@ async function makeVerboseRequest({ request, url: url2 }) {
30378
29950
  requestId: responseHeaders["x-request-id"]
30379
29951
  };
30380
29952
  }
30381
- async function simpleRequestWithDebugLog({ request, url: url2 }, errorHandler2) {
30382
- let result = await makeVerboseRequest({ request, url: url2 });
29953
+ async function simpleRequestWithDebugLog({ request, url }, errorHandler2) {
29954
+ let result = await makeVerboseRequest({ request, url });
30383
29955
  switch (outputDebug(`Request to ${result.sanitizedUrl} completed in ${result.duration} ms
30384
29956
  With response headers:
30385
29957
  ${result.sanitizedHeaders}
@@ -30394,10 +29966,10 @@ ${result.sanitizedHeaders}
30394
29966
  throw errorHandler2 ? errorHandler2(result.clientError, result.requestId) : result.clientError;
30395
29967
  }
30396
29968
  }
30397
- async function retryAwareRequest({ request, url: url2 }, errorHandler2, retryOptions = {
29969
+ async function retryAwareRequest({ request, url }, errorHandler2, retryOptions = {
30398
29970
  scheduleDelay: setTimeout
30399
29971
  }) {
30400
- let retriesUsed = 0, limitRetriesTo = retryOptions.limitRetriesTo ?? DEFAULT_RETRY_LIMIT, result = await makeVerboseRequest({ request, url: url2 });
29972
+ let retriesUsed = 0, limitRetriesTo = retryOptions.limitRetriesTo ?? DEFAULT_RETRY_LIMIT, result = await makeVerboseRequest({ request, url });
30401
29973
  for (outputDebug(`Request to ${result.sanitizedUrl} completed in ${result.duration} ms
30402
29974
  With response headers:
30403
29975
  ${result.sanitizedHeaders}
@@ -30412,9 +29984,11 @@ ${result.sanitizedHeaders}
30412
29984
  throw outputDebug(`${limitRetriesTo} retries exhausted for request to ${result.sanitizedUrl}`), errorHandler2 ? errorHandler2(result.clientError, result.requestId) : result.clientError;
30413
29985
  retriesUsed += 1;
30414
29986
  let retryDelayMs = result.delayMs ?? retryOptions.defaultDelayMs ?? DEFAULT_RETRY_DELAY_MS;
30415
- outputDebug(`Scheduling retry request #${retriesUsed} to ${result.sanitizedUrl} in ${retryDelayMs} ms`), result = await new Promise((resolve) => retryOptions.scheduleDelay(() => {
30416
- resolve(makeVerboseRequest({ request, url: url2 }));
30417
- }, retryDelayMs));
29987
+ outputDebug(`Scheduling retry request #${retriesUsed} to ${result.sanitizedUrl} in ${retryDelayMs} ms`), result = await new Promise((resolve) => {
29988
+ retryOptions.scheduleDelay(() => {
29989
+ resolve(makeVerboseRequest({ request, url }));
29990
+ }, retryDelayMs);
29991
+ });
30418
29992
  }
30419
29993
  }
30420
29994
 
@@ -30850,12 +30424,12 @@ var INTERNALS2 = Symbol("Response internals"), Response = class _Response extend
30850
30424
  * @param {number} status An optional status code for the response (e.g., 302.)
30851
30425
  * @returns {Response} A Response object.
30852
30426
  */
30853
- static redirect(url2, status = 302) {
30427
+ static redirect(url, status = 302) {
30854
30428
  if (!isRedirect(status))
30855
30429
  throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
30856
30430
  return new _Response(null, {
30857
30431
  headers: {
30858
- location: new URL(url2).toString()
30432
+ location: new URL(url).toString()
30859
30433
  },
30860
30434
  status
30861
30435
  });
@@ -30906,8 +30480,8 @@ var getSearch = (parsedURL) => {
30906
30480
  // ../../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/utils/referrer.js
30907
30481
  init_cjs_shims();
30908
30482
  import { isIP } from "node:net";
30909
- function stripURLForUseAsAReferrer(url2, originOnly = !1) {
30910
- 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);
30483
+ function stripURLForUseAsAReferrer(url, originOnly = !1) {
30484
+ 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);
30911
30485
  }
30912
30486
  var ReferrerPolicy = /* @__PURE__ */ new Set([
30913
30487
  "",
@@ -30925,14 +30499,14 @@ function validateReferrerPolicy(referrerPolicy) {
30925
30499
  throw new TypeError(`Invalid referrerPolicy: ${referrerPolicy}`);
30926
30500
  return referrerPolicy;
30927
30501
  }
30928
- function isOriginPotentiallyTrustworthy(url2) {
30929
- if (/^(http|ws)s:$/.test(url2.protocol))
30502
+ function isOriginPotentiallyTrustworthy(url) {
30503
+ if (/^(http|ws)s:$/.test(url.protocol))
30930
30504
  return !0;
30931
- let hostIp = url2.host.replace(/(^\[)|(]$)/g, ""), hostIPVersion = isIP(hostIp);
30932
- 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:";
30505
+ let hostIp = url.host.replace(/(^\[)|(]$)/g, ""), hostIPVersion = isIP(hostIp);
30506
+ 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:";
30933
30507
  }
30934
- function isUrlPotentiallyTrustworthy(url2) {
30935
- return /^about:(blank|srcdoc)$/.test(url2) || url2.protocol === "data:" || /^(blob|filesystem):$/.test(url2.protocol) ? !0 : isOriginPotentiallyTrustworthy(url2);
30508
+ function isUrlPotentiallyTrustworthy(url) {
30509
+ return /^about:(blank|srcdoc)$/.test(url) || url.protocol === "data:" || /^(blob|filesystem):$/.test(url.protocol) ? !0 : isOriginPotentiallyTrustworthy(url);
30936
30510
  }
30937
30511
  function determineRequestsReferrer(request, { referrerURLCallback, referrerOriginCallback } = {}) {
30938
30512
  if (request.referrer === "no-referrer" || request.referrerPolicy === "")
@@ -31107,11 +30681,11 @@ var AbortError2 = class extends FetchBaseError {
31107
30681
 
31108
30682
  // ../../node_modules/.pnpm/node-fetch@3.3.2/node_modules/node-fetch/src/index.js
31109
30683
  var supportedSchemas = /* @__PURE__ */ new Set(["data:", "http:", "https:"]);
31110
- async function fetch(url2, options_) {
30684
+ async function fetch(url, options_) {
31111
30685
  return new Promise((resolve, reject) => {
31112
- let request = new Request(url2, options_), { parsedURL, options: options2 } = getNodeRequestOptions(request);
30686
+ let request = new Request(url, options_), { parsedURL, options: options2 } = getNodeRequestOptions(request);
31113
30687
  if (!supportedSchemas.has(parsedURL.protocol))
31114
- throw new TypeError(`node-fetch cannot load ${url2}. URL scheme "${parsedURL.protocol.replace(/:$/, "")}" is not supported.`);
30688
+ throw new TypeError(`node-fetch cannot load ${url}. URL scheme "${parsedURL.protocol.replace(/:$/, "")}" is not supported.`);
31115
30689
  if (parsedURL.protocol === "data:") {
31116
30690
  let data = dist_default(request.url), response2 = new Response(data, { headers: { "Content-Type": data.typeFull } });
31117
30691
  resolve(response2);
@@ -31282,11 +30856,11 @@ function fixResponseChunkedTransferBadEnding(request, errorCallback) {
31282
30856
  function formData() {
31283
30857
  return new import_form_data2.default();
31284
30858
  }
31285
- async function fetch2(url2, init) {
31286
- return runWithTimer("cmd_all_timing_network_ms")(() => simpleRequestWithDebugLog({ url: url2.toString(), request: () => fetch(url2, init) }));
30859
+ async function fetch2(url, init) {
30860
+ return runWithTimer("cmd_all_timing_network_ms")(() => simpleRequestWithDebugLog({ url: url.toString(), request: () => fetch(url, init) }));
31287
30861
  }
31288
- async function shopifyFetch(url2, init) {
31289
- let sanitizedUrl = sanitizeURL(url2.toString()), options2 = {
30862
+ async function shopifyFetch(url, init) {
30863
+ let sanitizedUrl = sanitizeURL(url.toString()), options2 = {
31290
30864
  ...init ?? {},
31291
30865
  headers: {
31292
30866
  ...await buildHeaders(),
@@ -31295,10 +30869,10 @@ async function shopifyFetch(url2, init) {
31295
30869
  };
31296
30870
  return outputDebug(outputContent`Sending ${options2.method ?? "GET"} request to URL ${sanitizedUrl}
31297
30871
  With request headers:
31298
- ${sanitizedHeadersOutput(options2?.headers ?? {})}
30872
+ ${sanitizedHeadersOutput(options2.headers ?? {})}
31299
30873
  `), runWithTimer("cmd_all_timing_network_ms")(async () => simpleRequestWithDebugLog({
31300
- url: url2.toString(),
31301
- request: async () => fetch(url2, { ...init, agent: await httpsAgent() })
30874
+ url: url.toString(),
30875
+ request: async () => fetch(url, { ...init, agent: await httpsAgent() })
31302
30876
  }));
31303
30877
  }
31304
30878
 
@@ -31647,24 +31221,12 @@ function decodeJwt(jwt) {
31647
31221
  // ../cli-kit/dist/public/node/crypto.js
31648
31222
  init_cjs_shims();
31649
31223
  import crypto from "crypto";
31650
- function randomHex(size) {
31651
- return crypto.randomBytes(size).toString("hex");
31652
- }
31653
- function base64URLEncode(str) {
31654
- return str.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/[=]/g, "");
31655
- }
31656
- function sha256(str) {
31657
- return crypto.createHash("sha256").update(str).digest();
31658
- }
31659
31224
  function hashString(str) {
31660
31225
  return crypto.createHash("sha1").update(str).digest("hex");
31661
31226
  }
31662
31227
  function fileHash(buff) {
31663
31228
  return crypto.createHash("md5").update(buff).digest("hex");
31664
31229
  }
31665
- function randomBytes(size) {
31666
- return crypto.randomBytes(size);
31667
- }
31668
31230
  function randomUUID() {
31669
31231
  return crypto.randomUUID();
31670
31232
  }
@@ -31678,16 +31240,6 @@ var InvalidGrantError = class extends import_ts_error.ExtendableError {
31678
31240
  }, InvalidRequestError = class extends import_ts_error.ExtendableError {
31679
31241
  }, InvalidTargetError = class extends AbortError {
31680
31242
  };
31681
- async function exchangeCodeForAccessToken(codeData) {
31682
- let clientId2 = await clientId(), params = {
31683
- grant_type: "authorization_code",
31684
- code: codeData.code,
31685
- redirect_uri: "http://127.0.0.1:3456",
31686
- client_id: clientId2,
31687
- code_verifier: codeData.codeVerifier
31688
- }, value = (await tokenRequest(params)).mapError(tokenRequestErrorHandler).valueOrBug();
31689
- return buildIdentityToken(value);
31690
- }
31691
31243
  async function exchangeAccessForApplicationTokens(identityToken, scopes, store2) {
31692
31244
  let token = identityToken.accessToken, appManagementEnabled = isTruthy(process.env.USE_APP_MANAGEMENT_API), [partners, storefront, businessPlatform, admin, appManagement] = await Promise.all([
31693
31245
  requestAppToken("partners", token, scopes.partners),
@@ -31757,9 +31309,9 @@ If you're the store owner, then you need to log in to the store directly using t
31757
31309
  return error === "invalid_grant" ? new InvalidGrantError() : error === "invalid_request" ? new InvalidRequestError() : error === "invalid_target" ? new InvalidTargetError(invalidTargetErrorMessage) : new AbortError(error);
31758
31310
  }
31759
31311
  async function tokenRequest(params) {
31760
- let fqdn = await identityFqdn(), url2 = new URL(`https://${fqdn}/oauth/token`);
31761
- url2.search = new URLSearchParams(Object.entries(params)).toString();
31762
- let res = await shopifyFetch(url2.href, { method: "POST" }), payload = await res.json();
31312
+ let fqdn = await identityFqdn(), url = new URL(`https://${fqdn}/oauth/token`);
31313
+ url.search = new URLSearchParams(Object.entries(params)).toString();
31314
+ let res = await shopifyFetch(url.href, { method: "POST" }), payload = await res.json();
31763
31315
  return res.ok ? ok(payload) : err(payload.error);
31764
31316
  }
31765
31317
  function buildIdentityToken(result, existingUserId) {
@@ -31782,288 +31334,6 @@ function buildApplicationToken(result) {
31782
31334
  };
31783
31335
  }
31784
31336
 
31785
- // ../cli-kit/dist/private/node/session/authorize.js
31786
- init_cjs_shims();
31787
-
31788
- // ../cli-kit/dist/private/node/session/redirect-listener.js
31789
- init_cjs_shims();
31790
-
31791
- // ../cli-kit/dist/private/node/session/post-auth.js
31792
- init_cjs_shims();
31793
- var HTMLFileNames = [
31794
- "empty-url.html",
31795
- "auth-error.html",
31796
- "missing-code.html",
31797
- "missing-state.html",
31798
- "success.html"
31799
- ], StylesheetFilename = "style.css", FaviconFileName = "favicon.svg", getFilePath = async (fileName) => {
31800
- let filePath = await findPathUp(`assets/${fileName}`, {
31801
- type: "file",
31802
- cwd: moduleDirectory(import.meta.url)
31803
- });
31804
- if (!filePath)
31805
- throw RedirectPageAssetNotFoundError();
31806
- return filePath;
31807
- }, getEmptyUrlHTML = async () => {
31808
- let filePath = await getFilePath(HTMLFileNames[0]);
31809
- return readFile(filePath);
31810
- }, getAuthErrorHTML = async () => {
31811
- let filePath = await getFilePath(HTMLFileNames[1]);
31812
- return readFile(filePath);
31813
- }, getMissingCodeHTML = async () => {
31814
- let filePath = await getFilePath(HTMLFileNames[2]);
31815
- return readFile(filePath);
31816
- }, getMissingStateHTML = async () => {
31817
- let filePath = await getFilePath(HTMLFileNames[3]);
31818
- return readFile(filePath);
31819
- }, getSuccessHTML = async () => {
31820
- let filePath = await getFilePath(HTMLFileNames[4]);
31821
- return readFile(filePath);
31822
- }, getStylesheet = async () => {
31823
- let filePath = await getFilePath(StylesheetFilename);
31824
- return readFile(filePath);
31825
- }, getFavicon = async () => {
31826
- let filePath = await getFilePath(FaviconFileName);
31827
- return readFile(filePath);
31828
- }, 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");
31829
-
31830
- // ../cli-kit/dist/private/node/session/redirect-listener.js
31831
- import url from "url";
31832
- import { createServer } from "http";
31833
- var ResponseTimeoutSeconds = 10, ServerStopDelaySeconds = 0.5, RedirectListener = class _RedirectListener {
31834
- static createServer(callback) {
31835
- return createServer(async (request, response) => {
31836
- let requestUrl = request.url;
31837
- if (requestUrl?.includes("favicon")) {
31838
- let faviconFile = await getFavicon();
31839
- return response.setHeader("Content-Type", "image/svg+xml"), response.write(faviconFile), response.end(), {};
31840
- } else if (requestUrl === "/style.css") {
31841
- let stylesheetFile = await getStylesheet();
31842
- return response.setHeader("Content-Type", "text/css"), response.write(stylesheetFile), response.end(), {};
31843
- }
31844
- let respond = async (contents, error, state, code) => (response.setHeader("Content-Type", "text/html"), response.write(contents), response.end(), callback(error, state, code), {});
31845
- if (!requestUrl) {
31846
- let file2 = await getEmptyUrlHTML(), err2 = new BugError(EmptyUrlString);
31847
- return respond(file2, err2, void 0, void 0);
31848
- }
31849
- let queryObject = url.parse(requestUrl, !0).query;
31850
- if (queryObject.error && queryObject.error_description) {
31851
- let file2 = await getAuthErrorHTML(), err2 = new AbortError(`${queryObject.error_description}`);
31852
- return respond(file2, err2, void 0, void 0);
31853
- }
31854
- if (!queryObject.code) {
31855
- let file2 = await getMissingCodeHTML(), err2 = new BugError(MissingCodeString);
31856
- return respond(file2, err2, void 0, void 0);
31857
- }
31858
- if (!queryObject.state) {
31859
- let file2 = await getMissingStateHTML(), err2 = new BugError(MissingStateString);
31860
- return respond(file2, err2, void 0, void 0);
31861
- }
31862
- let file = await getSuccessHTML();
31863
- return respond(file, void 0, `${queryObject.code}`, `${queryObject.state}`);
31864
- });
31865
- }
31866
- constructor(options2) {
31867
- this.port = options2.port, this.host = options2.host, this.server = _RedirectListener.createServer(options2.callback);
31868
- }
31869
- start() {
31870
- this.server.listen({ port: this.port, host: this.host }, () => {
31871
- });
31872
- }
31873
- async stop() {
31874
- await this.server.close();
31875
- }
31876
- };
31877
- async function listenRedirect(host, port, url2) {
31878
- return await new Promise((resolve, reject) => {
31879
- let timeout = setTimeout(() => {
31880
- outputInfo(outputContent`${`
31881
- Auto-open timed out. Open the login page: `}${outputToken.link("Log in to Shopify Partners", url2)}\n`);
31882
- }, ResponseTimeoutSeconds * 1e3), callback = (error, code, state) => {
31883
- clearTimeout(timeout), setTimeout(() => {
31884
- redirectListener.stop(), error ? reject(error) : resolve({ code, state });
31885
- }, ServerStopDelaySeconds * 1e3);
31886
- }, redirectListener = new RedirectListener({ host, port, callback });
31887
- redirectListener.start();
31888
- });
31889
- }
31890
-
31891
- // ../../node_modules/.pnpm/get-port-please@3.0.1/node_modules/get-port-please/dist/index.mjs
31892
- init_cjs_shims();
31893
- import { createServer as createServer2 } from "node:net";
31894
- import { networkInterfaces } from "node:os";
31895
- var unsafePorts = /* @__PURE__ */ new Set([
31896
- 1,
31897
- 7,
31898
- 9,
31899
- 11,
31900
- 13,
31901
- 15,
31902
- 17,
31903
- 19,
31904
- 20,
31905
- 21,
31906
- 22,
31907
- 23,
31908
- 25,
31909
- 37,
31910
- 42,
31911
- 43,
31912
- 53,
31913
- 69,
31914
- 77,
31915
- 79,
31916
- 87,
31917
- 95,
31918
- 101,
31919
- 102,
31920
- 103,
31921
- 104,
31922
- 109,
31923
- 110,
31924
- 111,
31925
- 113,
31926
- 115,
31927
- 117,
31928
- 119,
31929
- 123,
31930
- 135,
31931
- 137,
31932
- 139,
31933
- 143,
31934
- 161,
31935
- 179,
31936
- 389,
31937
- 427,
31938
- 465,
31939
- 512,
31940
- 513,
31941
- 514,
31942
- 515,
31943
- 526,
31944
- 530,
31945
- 531,
31946
- 532,
31947
- 540,
31948
- 548,
31949
- 554,
31950
- 556,
31951
- 563,
31952
- 587,
31953
- 601,
31954
- 636,
31955
- 989,
31956
- 990,
31957
- 993,
31958
- 995,
31959
- 1719,
31960
- 1720,
31961
- 1723,
31962
- 2049,
31963
- 3659,
31964
- 4045,
31965
- 5060,
31966
- 5061,
31967
- 6e3,
31968
- 6566,
31969
- 6665,
31970
- 6666,
31971
- 6667,
31972
- 6668,
31973
- 6669,
31974
- 6697,
31975
- 10080
31976
- ]);
31977
- function isUnsafePort(port) {
31978
- return unsafePorts.has(port);
31979
- }
31980
- function isSafePort(port) {
31981
- return !isUnsafePort(port);
31982
- }
31983
- function log(...arguments_) {
31984
- console.log("[get-port]", ...arguments_);
31985
- }
31986
- async function getRandomPort(host) {
31987
- let port = await checkPort(0, host);
31988
- if (port === !1)
31989
- throw new Error("Unable to obtain an available random port number!");
31990
- return port;
31991
- }
31992
- async function checkPort(port, host = process.env.HOST, _verbose) {
31993
- if (host || (host = getLocalHosts([void 0, "0.0.0.0"])), !Array.isArray(host))
31994
- return _checkPort(port, host);
31995
- for (let _host of host) {
31996
- let _port = await _checkPort(port, _host);
31997
- if (_port === !1)
31998
- return port < 1024 && _verbose && log("Unable to listen to priviliged port:", `${_host}:${port}`), !1;
31999
- port === 0 && _port !== 0 && (port = _port);
32000
- }
32001
- return port;
32002
- }
32003
- function _checkPort(port, host) {
32004
- return new Promise((resolve) => {
32005
- let server = createServer2();
32006
- server.unref(), server.on("error", (error) => {
32007
- error.code === "EINVAL" || error.code === "EADDRNOTAVAIL" ? resolve(port !== 0 && isSafePort(port) && port) : resolve(!1);
32008
- }), server.listen({ port, host }, () => {
32009
- let { port: port2 } = server.address();
32010
- server.close(() => {
32011
- resolve(isSafePort(port2) && port2);
32012
- });
32013
- });
32014
- });
32015
- }
32016
- function getLocalHosts(additional) {
32017
- let hosts = new Set(additional);
32018
- for (let _interface of Object.values(networkInterfaces()))
32019
- for (let config of _interface || [])
32020
- hosts.add(config.address);
32021
- return [...hosts];
32022
- }
32023
-
32024
- // ../cli-kit/dist/private/node/session/authorize.js
32025
- var import_find_process = __toESM(require_find_process2(), 1);
32026
- async function authorize(scopes, state = randomHex(30)) {
32027
- let host = "127.0.0.1", redirectUri = `http://${host}:3456`, fqdn = await identityFqdn(), identityClientId = clientId();
32028
- await validateRedirectionPortAvailability(3456);
32029
- let url2 = `http://${fqdn}/oauth/authorize`, { codeVerifier, codeChallenge } = generateRandomChallengePair(), params = {
32030
- client_id: identityClientId,
32031
- scope: scopes.join(" "),
32032
- redirect_uri: redirectUri,
32033
- state,
32034
- response_type: "code",
32035
- code_challenge_method: "S256",
32036
- code_challenge: codeChallenge
32037
- };
32038
- return outputInfo(`
32039
- 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 () => {
32040
- let result = await listenRedirect(host, 3456, url2);
32041
- if (result.state !== state)
32042
- throw new AbortError("The state received from the authentication doesn't match the one that initiated the authentication process.");
32043
- return { code: result.code, codeVerifier };
32044
- });
32045
- }
32046
- function generateRandomChallengePair() {
32047
- let codeVerifier = base64URLEncode(randomBytes(32)), codeChallenge = base64URLEncode(sha256(codeVerifier));
32048
- return { codeVerifier, codeChallenge };
32049
- }
32050
- async function validateRedirectionPortAvailability(port) {
32051
- let { killPortProcess } = await import("./lib-H3ZZGS7I.js");
32052
- if (!await checkPort(port))
32053
- if (await terminateBlockingPortProcessPrompt(port, "Authentication"))
32054
- await killPortProcess(port);
32055
- else
32056
- throw new CancelExecution();
32057
- }
32058
- async function terminateBlockingPortProcessPrompt(port, stepDescription) {
32059
- let processInfo = await (0, import_find_process.default)("port", port), formattedProcessName = processInfo && processInfo.length > 0 && processInfo[0]?.name ? ` (${processInfo[0].name})` : "";
32060
- return renderConfirmationPrompt({
32061
- message: `${stepDescription} requires a port ${port} that's unavailable because it's running another process${formattedProcessName}. Terminate that process?`,
32062
- confirmationMessage: "Yes, terminate process in order to log in now",
32063
- cancellationMessage: "No, cancel command and try later"
32064
- });
32065
- }
32066
-
32067
31337
  // ../cli-kit/dist/private/node/session/store.js
32068
31338
  init_cjs_shims();
32069
31339
  async function store(session) {
@@ -32086,7 +31356,7 @@ async function remove() {
32086
31356
  // ../cli-kit/dist/private/node/session/device-authorization.js
32087
31357
  init_cjs_shims();
32088
31358
  async function requestDeviceAuthorization(scopes) {
32089
- let fqdn = await identityFqdn(), queryParams = { client_id: clientId(), scope: scopes.join(" ") }, url2 = `https://${fqdn}/oauth/device_authorization`, jsonResult = await (await shopifyFetch(url2, {
31359
+ let fqdn = await identityFqdn(), queryParams = { client_id: clientId(), scope: scopes.join(" ") }, url = `https://${fqdn}/oauth/device_authorization`, jsonResult = await (await shopifyFetch(url, {
32090
31360
  method: "POST",
32091
31361
  headers: { "Content-type": "application/x-www-form-urlencoded" },
32092
31362
  body: convertRequestToParams(queryParams)
@@ -32112,18 +31382,26 @@ async function pollForDeviceAuthorization(code, interval = 5) {
32112
31382
  return new Promise((resolve, reject) => {
32113
31383
  let onPoll = async () => {
32114
31384
  let result = await exchangeDeviceCodeForAccessToken(code);
32115
- if (!result.isErr())
32116
- return resolve(result.value);
31385
+ if (!result.isErr()) {
31386
+ resolve(result.value);
31387
+ return;
31388
+ }
32117
31389
  let error = result.error ?? "unknown_failure";
32118
31390
  switch (outputDebug(outputContent`Polling for device authorization... status: ${error}`), error) {
32119
- case "authorization_pending":
32120
- return startPolling();
31391
+ case "authorization_pending": {
31392
+ startPolling();
31393
+ return;
31394
+ }
32121
31395
  case "slow_down":
32122
- return currentIntervalInSeconds += 5, startPolling();
31396
+ currentIntervalInSeconds += 5;
31397
+ {
31398
+ startPolling();
31399
+ return;
31400
+ }
32123
31401
  case "access_denied":
32124
31402
  case "expired_token":
32125
31403
  case "unknown_failure":
32126
- return reject(result);
31404
+ reject(result);
32127
31405
  }
32128
31406
  }, startPolling = () => {
32129
31407
  setTimeout(onPoll, currentIntervalInSeconds * 1e3);
@@ -32142,8 +31420,10 @@ function restRequestBody(requestBody) {
32142
31420
  return JSON.stringify(requestBody);
32143
31421
  }
32144
31422
  function restRequestUrl(session, apiVersion, path, searchParams = {}, env = process.env) {
32145
- 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`);
32146
- return Object.entries(searchParams).forEach(([name, value]) => url2.searchParams.set(name, value)), url2.toString();
31423
+ 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`);
31424
+ return Object.entries(searchParams).forEach(([name, value]) => {
31425
+ url.searchParams.set(name, value);
31426
+ }), url.toString();
32147
31427
  }
32148
31428
  function restRequestHeaders(session) {
32149
31429
  let store2 = session.storeFqdn, token = session.token, headers = buildHeaders(session.token);
@@ -32196,15 +31476,23 @@ Request ID: ${requestId}
32196
31476
 
32197
31477
  // ../cli-kit/dist/public/node/api/graphql.js
32198
31478
  async function performGraphQLRequest(options2) {
32199
- let { token, addedHeaders, queryAsString, variables, api, url: url2, responseOptions } = options2, headers = {
31479
+ let { token, addedHeaders, queryAsString, variables, api, url, responseOptions } = options2, headers = {
32200
31480
  ...addedHeaders,
32201
31481
  ...buildHeaders(token)
32202
31482
  };
32203
31483
  debugLogRequestInfo(api, queryAsString, variables, headers);
32204
- let clientOptions = { agent: await httpsAgent(), headers }, client = new GraphQLClient(url2, clientOptions);
31484
+ let clientOptions = { agent: await httpsAgent(), headers }, client = new GraphQLClient(url, clientOptions);
32205
31485
  return runWithTimer("cmd_all_timing_network_ms")(async () => {
32206
- let response = await retryAwareRequest({ request: () => client.rawRequest(queryAsString, variables), url: url2 }, responseOptions?.handleErrors === !1 ? void 0 : errorHandler(api));
32207
- return responseOptions?.onResponse && responseOptions.onResponse(response), response.data;
31486
+ let response = await retryAwareRequest({ request: () => client.rawRequest(queryAsString, variables), url }, responseOptions?.handleErrors === !1 ? void 0 : errorHandler(api));
31487
+ responseOptions?.onResponse && responseOptions.onResponse(response);
31488
+ try {
31489
+ let requestId = response.headers.get("x-request-id");
31490
+ await addPublicMetadata(async () => ({
31491
+ cmd_all_last_graphql_request_id: requestId ?? void 0
31492
+ }));
31493
+ } catch {
31494
+ }
31495
+ return response.data;
32208
31496
  });
32209
31497
  }
32210
31498
  async function graphqlRequest(options2) {
@@ -32250,11 +31538,11 @@ var import_bottleneck = __toESM(require_lib3(), 1), limiter = new import_bottlen
32250
31538
  maxConcurrent: 10
32251
31539
  });
32252
31540
  async function setupRequest(token) {
32253
- let api = "Partners", url2 = `https://${await partnersFqdn()}/api/cli/graphql`;
31541
+ let api = "Partners", url = `https://${await partnersFqdn()}/api/cli/graphql`;
32254
31542
  return {
32255
31543
  token,
32256
31544
  api,
32257
- url: url2,
31545
+ url,
32258
31546
  responseOptions: { onResponse: handleDeprecations }
32259
31547
  };
32260
31548
  }
@@ -32381,14 +31669,10 @@ async function executeCompleteFlow(applications, identityFqdn2) {
32381
31669
  let identityToken, identityTokenInformation = getIdentityTokenInformation();
32382
31670
  if (identityTokenInformation)
32383
31671
  identityToken = buildIdentityTokenFromEnv(scopes, identityTokenInformation);
32384
- else if (useDeviceAuth()) {
31672
+ else {
32385
31673
  outputDebug(outputContent`Requesting device authorization code...`);
32386
31674
  let deviceAuth = await requestDeviceAuthorization(scopes);
32387
31675
  outputDebug(outputContent`Starting polling for the identity token...`), identityToken = await pollForDeviceAuthorization(deviceAuth.deviceCode, deviceAuth.interval);
32388
- } else {
32389
- outputDebug(outputContent`Authorizing through Identity's website...`);
32390
- let code = await authorize(scopes);
32391
- outputDebug(outputContent`Authorization code received. Exchanging it for a CLI token...`), identityToken = await exchangeCodeForAccessToken(code);
32392
31676
  }
32393
31677
  outputDebug(outputContent`CLI token received. Exchanging it for application tokens...`);
32394
31678
  let result = await exchangeAccessForApplicationTokens(identityToken, exchangeScopes, store2), session = {
@@ -32559,8 +31843,6 @@ export {
32559
31843
  ok,
32560
31844
  err,
32561
31845
  exchangeCustomPartnerToken,
32562
- getRandomPort,
32563
- checkPort,
32564
31846
  remove,
32565
31847
  restRequestBody,
32566
31848
  restRequestUrl,
@@ -32600,4 +31882,4 @@ mime-types/index.js:
32600
31882
  * MIT Licensed
32601
31883
  *)
32602
31884
  */
32603
- //# sourceMappingURL=chunk-6ZDQFSSJ.js.map
31885
+ //# sourceMappingURL=chunk-LQ7IL4AX.js.map