@shopify/cli 3.78.2 → 3.79.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 (110) hide show
  1. package/dist/assets/dev-console/extensions/dev-console/assets/index-BteeGmYf.css +1 -0
  2. package/dist/assets/dev-console/extensions/dev-console/assets/index-CqNhY1h-.js +64 -0
  3. package/dist/assets/dev-console/index.html +2 -2
  4. package/dist/assets/hydrogen/starter/.cursor/rules/cookbook-recipe-subscriptions.mdc +921 -0
  5. package/dist/assets/hydrogen/starter/CHANGELOG.md +20 -0
  6. package/dist/assets/hydrogen/starter/app/components/CartLineItem.tsx +15 -0
  7. package/dist/assets/hydrogen/starter/app/components/CartMain.tsx +1 -1
  8. package/dist/assets/hydrogen/starter/app/components/ProductItem.tsx +44 -0
  9. package/dist/assets/hydrogen/starter/app/lib/redirect.ts +23 -0
  10. package/dist/assets/hydrogen/starter/app/routes/_index.tsx +8 -23
  11. package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle.$articleHandle.tsx +22 -2
  12. package/dist/assets/hydrogen/starter/app/routes/blogs.$blogHandle._index.tsx +4 -0
  13. package/dist/assets/hydrogen/starter/app/routes/collections.$handle.tsx +7 -41
  14. package/dist/assets/hydrogen/starter/app/routes/collections.all.tsx +11 -44
  15. package/dist/assets/hydrogen/starter/app/routes/pages.$handle.tsx +9 -1
  16. package/dist/assets/hydrogen/starter/app/routes/products.$handle.tsx +5 -1
  17. package/dist/assets/hydrogen/starter/app/styles/app.css +15 -3
  18. package/dist/assets/hydrogen/starter/package.json +5 -5
  19. package/dist/assets/hydrogen/starter/storefrontapi.generated.d.ts +57 -36
  20. package/dist/{chunk-LAKQWRR5.js → chunk-2BQWY5ZH.js} +2 -2
  21. package/dist/{chunk-ZPZFAVIY.js → chunk-2DHJN6XL.js} +2 -2
  22. package/dist/{chunk-E76452W5.js → chunk-3ZBLWNTJ.js} +4 -4
  23. package/dist/{chunk-DHQUQSYW.js → chunk-4YS5JU6T.js} +3 -3
  24. package/dist/{chunk-YKVQZFEC.js → chunk-5B4X6PWS.js} +8 -8
  25. package/dist/{chunk-GTVU6SJH.js → chunk-73GDKVV2.js} +2 -2
  26. package/dist/{chunk-6V2YVCS2.js → chunk-7BFQPX6U.js} +7 -5
  27. package/dist/{chunk-VEHGKA4Q.js → chunk-7ZJSTNNB.js} +5 -5
  28. package/dist/{chunk-QTIPSIA5.js → chunk-B67HZYEC.js} +14 -10
  29. package/dist/{chunk-UE4DFKJU.js → chunk-CFWBUC64.js} +3 -3
  30. package/dist/{chunk-DR5VG62Q.js → chunk-DZ7XZDWD.js} +3 -3
  31. package/dist/{chunk-7S2OZRQF.js → chunk-GI77RADE.js} +3 -3
  32. package/dist/{chunk-IG6TAMGV.js → chunk-GINKNYRN.js} +16 -15
  33. package/dist/{chunk-WBWYZ7XQ.js → chunk-H44KHRQ3.js} +9 -7
  34. package/dist/{chunk-HZRI37XU.js → chunk-IHRJ645Y.js} +3 -3
  35. package/dist/{chunk-IK6NAHQI.js → chunk-IW2W7BT2.js} +6 -6
  36. package/dist/{chunk-7KZBYW7W.js → chunk-JA4N4NXM.js} +4 -4
  37. package/dist/{chunk-6HJM24C2.js → chunk-JED5Q5EJ.js} +72 -6
  38. package/dist/{chunk-GJEIVT3X.js → chunk-KPKJOJKL.js} +3 -3
  39. package/dist/{chunk-6G5FH3WC.js → chunk-L7AFSENO.js} +2 -2
  40. package/dist/{chunk-WYNL2S7B.js → chunk-MKNQBR63.js} +3 -3
  41. package/dist/{chunk-S5XTFY2H.js → chunk-NBCIERDR.js} +4 -4
  42. package/dist/{chunk-BV6PURBM.js → chunk-NOSVFQH5.js} +3 -3
  43. package/dist/{chunk-IBRFXDBZ.js → chunk-OP4DJUZ6.js} +7 -7
  44. package/dist/{chunk-YXH3NSML.js → chunk-PFMD3KQP.js} +2 -2
  45. package/dist/{chunk-L35GVYH5.js → chunk-QJMVJ2YT.js} +4 -4
  46. package/dist/{chunk-DOEVJAN2.js → chunk-QV4LZSZK.js} +84 -131
  47. package/dist/{chunk-TVCBBRZD.js → chunk-R65RM3GF.js} +5 -5
  48. package/dist/{chunk-QAKYKTFV.js → chunk-UTDSSCPI.js} +5 -5
  49. package/dist/{chunk-6GHUZFPP.js → chunk-VTNMKNMC.js} +2 -2
  50. package/dist/{chunk-UV2DGNFK.js → chunk-WMOUKE4L.js} +42 -17
  51. package/dist/{chunk-LGQNLPOA.js → chunk-WZ257YHY.js} +4 -4
  52. package/dist/{chunk-ZTD22GER.js → chunk-XXUOBZLX.js} +3 -3
  53. package/dist/{chunk-UP44YINT.js → chunk-Z5MHHPBU.js} +4 -4
  54. package/dist/{chunk-L4SLRBFT.js → chunk-ZMHZBZMW.js} +18 -5
  55. package/dist/{chunk-VBX7R3AF.js → chunk-ZNGCM64E.js} +88 -98
  56. package/dist/{chunk-57Q6OQG4.js → chunk-ZUCWDIGE.js} +2 -2
  57. package/dist/cli/commands/auth/logout.js +14 -14
  58. package/dist/cli/commands/auth/logout.test.js +15 -15
  59. package/dist/cli/commands/cache/clear.js +13 -13
  60. package/dist/cli/commands/debug/command-flags.js +13 -13
  61. package/dist/cli/commands/docs/generate.js +13 -13
  62. package/dist/cli/commands/docs/generate.test.js +14 -14
  63. package/dist/cli/commands/help.js +13 -13
  64. package/dist/cli/commands/kitchen-sink/async.js +14 -14
  65. package/dist/cli/commands/kitchen-sink/async.test.js +14 -14
  66. package/dist/cli/commands/kitchen-sink/index.js +16 -16
  67. package/dist/cli/commands/kitchen-sink/index.test.js +16 -16
  68. package/dist/cli/commands/kitchen-sink/prompts.js +14 -14
  69. package/dist/cli/commands/kitchen-sink/prompts.test.js +14 -14
  70. package/dist/cli/commands/kitchen-sink/static.js +14 -14
  71. package/dist/cli/commands/kitchen-sink/static.test.js +14 -14
  72. package/dist/cli/commands/notifications/generate.js +14 -14
  73. package/dist/cli/commands/notifications/list.js +14 -14
  74. package/dist/cli/commands/search.js +14 -14
  75. package/dist/cli/commands/upgrade.js +14 -14
  76. package/dist/cli/commands/version.js +14 -14
  77. package/dist/cli/commands/version.test.js +14 -14
  78. package/dist/cli/services/commands/notifications.js +9 -9
  79. package/dist/cli/services/commands/search.js +6 -5
  80. package/dist/cli/services/commands/search.test.js +6 -5
  81. package/dist/cli/services/commands/version.js +7 -6
  82. package/dist/cli/services/commands/version.test.js +8 -7
  83. package/dist/cli/services/kitchen-sink/async.js +6 -5
  84. package/dist/cli/services/kitchen-sink/prompts.js +6 -5
  85. package/dist/cli/services/kitchen-sink/static.js +6 -5
  86. package/dist/cli/services/upgrade.js +6 -6
  87. package/dist/cli/services/upgrade.test.js +8 -8
  88. package/dist/configs/all.yml +19 -4
  89. package/dist/configs/recommended.yml +19 -4
  90. package/dist/{custom-oclif-loader-TUNXMYGU.js → custom-oclif-loader-MZ3GZ32O.js} +6 -5
  91. package/dist/{error-handler-AWP3RCBG.js → error-handler-MTFIQP6U.js} +11 -11
  92. package/dist/hooks/postrun.js +10 -10
  93. package/dist/hooks/prerun.js +11 -11
  94. package/dist/index.js +2778 -2435
  95. package/dist/is-wsl-YAJ3DFN7.js +64 -0
  96. package/dist/{lib-IZAG57CE.js → lib-MWWAATIC.js} +3 -3
  97. package/dist/{local-RBT53U3L.js → local-34IWAIJY.js} +6 -7
  98. package/dist/{morph-W4XLLZ47.js → morph-MDY3DSJL.js} +9 -9
  99. package/dist/{node-SKXMS2TZ.js → node-6M2Y6S6K.js} +18 -18
  100. package/dist/{node-package-manager-BZHJZTGV.js → node-package-manager-S5BR3SQ7.js} +6 -6
  101. package/dist/{path-2K5HIMHZ.js → path-GWAZZN2N.js} +2 -2
  102. package/dist/toml-patch-wasm-J5VGG6WG.js +140 -0
  103. package/dist/toml_patch_bg.wasm +0 -0
  104. package/dist/tsconfig.tsbuildinfo +1 -1
  105. package/dist/{ui-5MADIMGC.js → ui-FJ2QLK3P.js} +6 -5
  106. package/dist/{workerd-YRUKUE76.js → workerd-N5O22HSJ.js} +17 -17
  107. package/oclif.manifest.json +100 -2
  108. package/package.json +7 -7
  109. package/dist/assets/dev-console/extensions/dev-console/assets/index-lyGm6l3x.js +0 -64
  110. package/dist/assets/dev-console/extensions/dev-console/assets/index-n8yr6cxq.css +0 -1
@@ -1,15 +1,20 @@
1
1
  import {
2
2
  allAPIs,
3
+ blockPartnersAccess,
4
+ getIdentityTokenInformation,
5
+ getPartnersToken,
6
+ hashString,
7
+ nonRandomUUID,
3
8
  shopifyFetch,
4
9
  z
5
- } from "./chunk-6HJM24C2.js";
10
+ } from "./chunk-JED5Q5EJ.js";
6
11
  import {
7
12
  getPackageManager,
8
13
  getSession,
9
14
  packageManagerFromUserAgent,
10
15
  removeSession,
11
16
  setSession
12
- } from "./chunk-IK6NAHQI.js";
17
+ } from "./chunk-IW2W7BT2.js";
13
18
  import {
14
19
  AbortError,
15
20
  BugError,
@@ -17,23 +22,18 @@ import {
17
22
  FatalError,
18
23
  addPublicMetadata,
19
24
  addSensitiveMetadata,
20
- blockPartnersAccess,
21
25
  ciPlatform,
22
26
  cloudEnvironment,
23
27
  currentProcessIsGlobal,
24
28
  firstPartyDev,
25
- getIdentityTokenInformation,
26
- getPartnersToken,
27
- hashString,
28
29
  import_ts_error,
29
- isAppManagementDisabled,
30
30
  isCI,
31
31
  isCloudEnvironment,
32
32
  isSpin,
33
33
  isTTY,
34
+ isWsl,
34
35
  keypress,
35
36
  macAddress,
36
- nonRandomUUID,
37
37
  openURL,
38
38
  outputCompleted,
39
39
  outputContent,
@@ -45,10 +45,10 @@ import {
45
45
  sessionConstants,
46
46
  spinFqdn,
47
47
  themeToken
48
- } from "./chunk-DOEVJAN2.js";
48
+ } from "./chunk-QV4LZSZK.js";
49
49
  import {
50
50
  cwd
51
- } from "./chunk-57Q6OQG4.js";
51
+ } from "./chunk-ZUCWDIGE.js";
52
52
  import {
53
53
  __commonJS,
54
54
  __require,
@@ -220,6 +220,18 @@ function apiScopes(api, extraScopes = []) {
220
220
  let scopes = [...defaultApiScopes(api), ...extraScopes.map(scopeTransform)].map(scopeTransform);
221
221
  return Array.from(new Set(scopes));
222
222
  }
223
+ function tokenExchangeScopes(api) {
224
+ switch (api) {
225
+ case "partners":
226
+ return [scopeTransform("cli")];
227
+ case "app-management":
228
+ return [scopeTransform("app-management")];
229
+ case "business-platform":
230
+ return [scopeTransform("destinations")];
231
+ default:
232
+ throw new BugError(`API not supported for token exchange: ${api}`);
233
+ }
234
+ }
223
235
  function defaultApiScopes(api) {
224
236
  switch (api) {
225
237
  case "admin":
@@ -776,7 +788,7 @@ async function exchangeAccessForApplicationTokens(identityToken, scopes, store2)
776
788
  requestAppToken("storefront-renderer", token, scopes.storefront),
777
789
  requestAppToken("business-platform", token, scopes.businessPlatform),
778
790
  store2 ? requestAppToken("admin", token, scopes.admin, store2) : {},
779
- isAppManagementDisabled() ? {} : requestAppToken("app-management", token, scopes.appManagement)
791
+ requestAppToken("app-management", token, scopes.appManagement)
780
792
  ]);
781
793
  return {
782
794
  ...partners,
@@ -795,15 +807,25 @@ async function refreshAccessToken(currentToken) {
795
807
  }, value = (await tokenRequest(params)).mapError(tokenRequestErrorHandler).valueOrBug();
796
808
  return buildIdentityToken(value, currentToken.userId);
797
809
  }
798
- async function exchangeCustomPartnerToken(token) {
799
- let appId = applicationId("partners");
810
+ async function exchangeCliTokenForAccessToken(apiName, token, scopes) {
811
+ let appId = applicationId(apiName);
800
812
  try {
801
- let accessToken = (await requestAppToken("partners", token, ["https://api.shopify.com/auth/partners.app.cli.access"]))[appId].accessToken, userId2 = nonRandomUUID(token);
813
+ let accessToken = (await requestAppToken(apiName, token, scopes))[appId].accessToken, userId2 = nonRandomUUID(token);
802
814
  return setLastSeenUserIdAfterAuth(userId2), setLastSeenAuthMethod("partners_token"), { accessToken, userId: userId2 };
803
815
  } catch {
804
- throw new AbortError("The custom token provided is invalid.", "Ensure the token is correct and not expired.");
816
+ let prettyName = apiName.replace(/-/g, " ").replace(/\b\w/g, (char) => char.toUpperCase());
817
+ throw new AbortError(`The custom token provided can't be used for the ${prettyName} API.`, "Ensure the token is correct and not expired.");
805
818
  }
806
819
  }
820
+ async function exchangeCustomPartnerToken(token) {
821
+ return exchangeCliTokenForAccessToken("partners", token, tokenExchangeScopes("partners"));
822
+ }
823
+ async function exchangeCliTokenForAppManagementAccessToken(token) {
824
+ return exchangeCliTokenForAccessToken("app-management", token, tokenExchangeScopes("app-management"));
825
+ }
826
+ async function exchangeCliTokenForBusinessPlatformAccessToken(token) {
827
+ return exchangeCliTokenForAccessToken("business-platform", token, tokenExchangeScopes("business-platform"));
828
+ }
807
829
  async function exchangeDeviceCodeForAccessToken(deviceCode) {
808
830
  let clientId2 = await clientId(), tokenResult = await tokenRequest({
809
831
  grant_type: "urn:ietf:params:oauth:grant-type:device_code",
@@ -1129,7 +1151,8 @@ async function getEnvironmentData(config) {
1129
1151
  env_cloud: cloudEnvironment().platform,
1130
1152
  env_package_manager: await getPackageManager(cwd()),
1131
1153
  env_is_global: currentProcessIsGlobal(),
1132
- env_auth_method: await getLastSeenAuthMethod()
1154
+ env_auth_method: await getLastSeenAuthMethod(),
1155
+ env_is_wsl: await isWsl()
1133
1156
  };
1134
1157
  }
1135
1158
  async function getSensitiveEnvironmentData(config) {
@@ -1157,6 +1180,8 @@ export {
1157
1180
  ok,
1158
1181
  err,
1159
1182
  exchangeCustomPartnerToken,
1183
+ exchangeCliTokenForAppManagementAccessToken,
1184
+ exchangeCliTokenForBusinessPlatformAccessToken,
1160
1185
  remove,
1161
1186
  isThemeAccessSession,
1162
1187
  getLastSeenUserIdAfterAuth,
@@ -1167,4 +1192,4 @@ export {
1167
1192
  getEnvironmentData,
1168
1193
  getSensitiveEnvironmentData
1169
1194
  };
1170
- //# sourceMappingURL=chunk-UV2DGNFK.js.map
1195
+ //# sourceMappingURL=chunk-WMOUKE4L.js.map
@@ -4,7 +4,7 @@ import {
4
4
  findUpAndReadPackageJson,
5
5
  getPackageManager,
6
6
  usesWorkspaces
7
- } from "./chunk-IK6NAHQI.js";
7
+ } from "./chunk-IW2W7BT2.js";
8
8
  import {
9
9
  AbortError,
10
10
  exec,
@@ -15,12 +15,12 @@ import {
15
15
  outputSuccess,
16
16
  outputToken,
17
17
  outputWarn
18
- } from "./chunk-DOEVJAN2.js";
18
+ } from "./chunk-QV4LZSZK.js";
19
19
  import {
20
20
  dirname,
21
21
  joinPath,
22
22
  moduleDirectory
23
- } from "./chunk-57Q6OQG4.js";
23
+ } from "./chunk-ZUCWDIGE.js";
24
24
  import {
25
25
  init_cjs_shims
26
26
  } from "./chunk-PKR7KJ6P.js";
@@ -139,4 +139,4 @@ function usingPackageManager({ env } = { env: process.env }) {
139
139
  export {
140
140
  upgrade
141
141
  };
142
- //# sourceMappingURL=chunk-LGQNLPOA.js.map
142
+ //# sourceMappingURL=chunk-WZ257YHY.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  packageManagerFromUserAgent
3
- } from "./chunk-IK6NAHQI.js";
3
+ } from "./chunk-IW2W7BT2.js";
4
4
  import {
5
5
  currentProcessIsGlobal,
6
6
  inferPackageManagerForGlobalCLI,
7
7
  outputContent,
8
8
  outputToken
9
- } from "./chunk-DOEVJAN2.js";
9
+ } from "./chunk-QV4LZSZK.js";
10
10
  import {
11
11
  init_cjs_shims
12
12
  } from "./chunk-PKR7KJ6P.js";
@@ -25,4 +25,4 @@ export {
25
25
  cliInstallCommand,
26
26
  getOutputUpdateCLIReminder
27
27
  };
28
- //# sourceMappingURL=chunk-ZTD22GER.js.map
28
+ //# sourceMappingURL=chunk-XXUOBZLX.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  logout
3
- } from "./chunk-L4SLRBFT.js";
3
+ } from "./chunk-ZMHZBZMW.js";
4
4
  import {
5
5
  base_command_default
6
- } from "./chunk-WBWYZ7XQ.js";
6
+ } from "./chunk-H44KHRQ3.js";
7
7
  import {
8
8
  outputSuccess
9
- } from "./chunk-DOEVJAN2.js";
9
+ } from "./chunk-QV4LZSZK.js";
10
10
  import {
11
11
  init_cjs_shims
12
12
  } from "./chunk-PKR7KJ6P.js";
@@ -25,4 +25,4 @@ var Logout = class extends base_command_default {
25
25
  export {
26
26
  Logout
27
27
  };
28
- //# sourceMappingURL=chunk-UP44YINT.js.map
28
+ //# sourceMappingURL=chunk-Z5MHHPBU.js.map
@@ -1,20 +1,24 @@
1
1
  import {
2
2
  ensureAuthenticated,
3
+ exchangeCliTokenForAppManagementAccessToken,
4
+ exchangeCliTokenForBusinessPlatformAccessToken,
3
5
  exchangeCustomPartnerToken,
4
6
  isThemeAccessSession,
5
7
  normalizeStoreFqdn,
6
8
  remove,
7
9
  setLastSeenAuthMethod,
8
10
  setLastSeenUserIdAfterAuth
9
- } from "./chunk-UV2DGNFK.js";
11
+ } from "./chunk-WMOUKE4L.js";
10
12
  import {
11
- BugError,
12
13
  getPartnersToken,
13
- nonRandomUUID,
14
+ nonRandomUUID
15
+ } from "./chunk-JED5Q5EJ.js";
16
+ import {
17
+ BugError,
14
18
  outputContent,
15
19
  outputDebug,
16
20
  outputToken
17
- } from "./chunk-DOEVJAN2.js";
21
+ } from "./chunk-QV4LZSZK.js";
18
22
  import {
19
23
  init_cjs_shims
20
24
  } from "./chunk-PKR7KJ6P.js";
@@ -39,6 +43,15 @@ async function ensureAuthenticatedAppManagementAndBusinessPlatform(options = {},
39
43
  outputDebug(outputContent`Ensuring that the user is authenticated with the App Management API with the following scopes:
40
44
  ${outputToken.json(appManagementScopes)}
41
45
  `);
46
+ let envToken = getPartnersToken();
47
+ if (envToken) {
48
+ let appManagmentToken = await exchangeCliTokenForAppManagementAccessToken(envToken), businessPlatformToken = await exchangeCliTokenForBusinessPlatformAccessToken(envToken);
49
+ return {
50
+ appManagementToken: appManagmentToken.accessToken,
51
+ userId: appManagmentToken.userId,
52
+ businessPlatformToken: businessPlatformToken.accessToken
53
+ };
54
+ }
42
55
  let tokens = await ensureAuthenticated({ appManagementApi: { scopes: appManagementScopes }, businessPlatformApi: { scopes: businessPlatformScopes } }, env, options);
43
56
  if (!tokens.appManagement || !tokens.businessPlatform)
44
57
  throw new BugError("No App Management or Business Platform token found after ensuring authenticated");
@@ -104,4 +117,4 @@ export {
104
117
  ensureAuthenticatedBusinessPlatform,
105
118
  logout
106
119
  };
107
- //# sourceMappingURL=chunk-L4SLRBFT.js.map
120
+ //# sourceMappingURL=chunk-ZMHZBZMW.js.map