@shopify/cli 3.71.4 → 3.72.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/{chunk-CGNIP6G7.js → chunk-2CJLC56R.js} +2 -2
  2. package/dist/{chunk-4IOYUZUL.js → chunk-2SBPGR72.js} +4 -4
  3. package/dist/{chunk-53CWVDMP.js → chunk-2ZSVD4ED.js} +2 -2
  4. package/dist/{chunk-EPCOMGTE.js → chunk-35DXXNCI.js} +7 -7
  5. package/dist/{chunk-6V3JEX2A.js → chunk-3IUDQUHD.js} +2 -2
  6. package/dist/{chunk-APLIZ3QU.js → chunk-3QKHLZPS.js} +5 -5
  7. package/dist/{chunk-GIX7PVWB.js → chunk-3VCWJSLK.js} +6 -6
  8. package/dist/{chunk-CZK74B63.js → chunk-4E7Y62XG.js} +2 -2
  9. package/dist/{chunk-7USSBUNY.js → chunk-6RAS3TKY.js} +7 -7
  10. package/dist/{chunk-B2T3GBT5.js → chunk-6RJITQAH.js} +3 -3
  11. package/dist/{chunk-3U4IUVVU.js → chunk-7E4HY4BI.js} +2 -2
  12. package/dist/{chunk-PPPEGJ7O.js → chunk-7HZBVQEC.js} +2 -2
  13. package/dist/{chunk-KI4PGSYX.js → chunk-7QBUM445.js} +2 -2
  14. package/dist/{chunk-3HPSHLFG.js → chunk-CSDHFCD4.js} +6 -6
  15. package/dist/{chunk-VQZPHO4H.js → chunk-D4DJJ4PZ.js} +3 -3
  16. package/dist/{chunk-OFLVF47B.js → chunk-ECVFRPXR.js} +3 -3
  17. package/dist/{chunk-DDSH4NHD.js → chunk-FO4MTYIH.js} +3 -3
  18. package/dist/{chunk-WD2LS7EH.js → chunk-ILLC5WWL.js} +4 -4
  19. package/dist/{chunk-ME2NCEKO.js → chunk-J7K6IS5E.js} +3 -3
  20. package/dist/{chunk-WAN6CTJ4.js → chunk-JT4XUZYV.js} +3 -3
  21. package/dist/{chunk-FXKC5FQR.js → chunk-JZNHOMVW.js} +3 -3
  22. package/dist/{chunk-CI7YIFQP.js → chunk-KJQ2CWPN.js} +4 -4
  23. package/dist/{chunk-OSPPKV6J.js → chunk-LCVCSJWY.js} +3 -3
  24. package/dist/{chunk-MW4WJRFT.js → chunk-MCAI46FD.js} +3 -3
  25. package/dist/{chunk-CSJN7PVW.js → chunk-NCUT7QL7.js} +5 -5
  26. package/dist/{chunk-X4IXNVZV.js → chunk-NMJ5MMBB.js} +3 -3
  27. package/dist/{chunk-IWXDLFDQ.js → chunk-PLA2FIVK.js} +3 -3
  28. package/dist/{chunk-JIEF2ST3.js → chunk-PZTRGMAM.js} +5 -5
  29. package/dist/{chunk-6FA42ZJ7.js → chunk-QWRXYENL.js} +2 -2
  30. package/dist/{chunk-WQ3UIIYQ.js → chunk-S3QQYC7T.js} +2 -2
  31. package/dist/{chunk-M2T2NJSA.js → chunk-S5P3PDBM.js} +2 -2
  32. package/dist/{chunk-LEC6C3K6.js → chunk-UUSQGSPU.js} +3 -3
  33. package/dist/{chunk-EMT2HVTD.js → chunk-VG6LPRGA.js} +3 -3
  34. package/dist/{chunk-VKFUEWKR.js → chunk-Y7VXKFK7.js} +5 -5
  35. package/dist/{chunk-TJHYV7JJ.js → chunk-Z2EEAFLV.js} +6 -6
  36. package/dist/cli/commands/auth/logout.js +12 -12
  37. package/dist/cli/commands/auth/logout.test.js +13 -13
  38. package/dist/cli/commands/cache/clear.js +11 -11
  39. package/dist/cli/commands/debug/command-flags.js +11 -11
  40. package/dist/cli/commands/docs/generate.js +11 -11
  41. package/dist/cli/commands/docs/generate.test.js +11 -11
  42. package/dist/cli/commands/help.js +11 -11
  43. package/dist/cli/commands/kitchen-sink/async.js +12 -12
  44. package/dist/cli/commands/kitchen-sink/async.test.js +12 -12
  45. package/dist/cli/commands/kitchen-sink/index.js +14 -14
  46. package/dist/cli/commands/kitchen-sink/index.test.js +14 -14
  47. package/dist/cli/commands/kitchen-sink/prompts.js +12 -12
  48. package/dist/cli/commands/kitchen-sink/prompts.test.js +12 -12
  49. package/dist/cli/commands/kitchen-sink/static.js +12 -12
  50. package/dist/cli/commands/kitchen-sink/static.test.js +12 -12
  51. package/dist/cli/commands/notifications/generate.js +12 -12
  52. package/dist/cli/commands/notifications/list.js +12 -12
  53. package/dist/cli/commands/search.js +12 -12
  54. package/dist/cli/commands/upgrade.js +12 -12
  55. package/dist/cli/commands/version.js +12 -12
  56. package/dist/cli/commands/version.test.js +12 -12
  57. package/dist/cli/services/commands/notifications.js +6 -6
  58. package/dist/cli/services/commands/search.js +2 -2
  59. package/dist/cli/services/commands/search.test.js +2 -2
  60. package/dist/cli/services/commands/version.js +3 -3
  61. package/dist/cli/services/commands/version.test.js +4 -4
  62. package/dist/cli/services/kitchen-sink/async.js +2 -2
  63. package/dist/cli/services/kitchen-sink/prompts.js +2 -2
  64. package/dist/cli/services/kitchen-sink/static.js +2 -2
  65. package/dist/cli/services/upgrade.js +3 -3
  66. package/dist/cli/services/upgrade.test.js +5 -5
  67. package/dist/{custom-oclif-loader-AC2FZDAC.js → custom-oclif-loader-CR5VBQTS.js} +2 -2
  68. package/dist/{error-handler-BASKW2EY.js → error-handler-N326H2RN.js} +9 -9
  69. package/dist/hooks/postrun.js +7 -7
  70. package/dist/hooks/prerun.js +7 -7
  71. package/dist/index.js +263 -73
  72. package/dist/{local-SU4FNBZU.js → local-CWNOWZWQ.js} +2 -2
  73. package/dist/{node-U5FGKDT2.js → node-66BW6FOX.js} +13 -13
  74. package/dist/{node-package-manager-XROEB5NU.js → node-package-manager-SO4CLKC5.js} +3 -3
  75. package/dist/tsconfig.tsbuildinfo +1 -1
  76. package/dist/{ui-Q2GBYV5B.js → ui-AVBT2RYD.js} +2 -2
  77. package/dist/{workerd-KAW7HC3A.js → workerd-BJF24352.js} +13 -13
  78. package/oclif.manifest.json +1 -1
  79. package/package.json +6 -6
package/dist/index.js CHANGED
@@ -123,7 +123,7 @@ import {
123
123
  supressNodeExperimentalWarnings,
124
124
  unsetStorefront,
125
125
  waitForJob
126
- } from "./chunk-EPCOMGTE.js";
126
+ } from "./chunk-35DXXNCI.js";
127
127
  import {
128
128
  require_lib as require_lib4
129
129
  } from "./chunk-NUP5TATA.js";
@@ -138,39 +138,39 @@ import {
138
138
  } from "./chunk-NCKQIOV4.js";
139
139
  import {
140
140
  List
141
- } from "./chunk-FXKC5FQR.js";
141
+ } from "./chunk-JZNHOMVW.js";
142
142
  import {
143
143
  Search
144
- } from "./chunk-OSPPKV6J.js";
144
+ } from "./chunk-LCVCSJWY.js";
145
145
  import {
146
146
  Upgrade
147
- } from "./chunk-CI7YIFQP.js";
147
+ } from "./chunk-KJQ2CWPN.js";
148
148
  import {
149
149
  getOutputUpdateCLIReminder
150
- } from "./chunk-WAN6CTJ4.js";
150
+ } from "./chunk-JT4XUZYV.js";
151
151
  import {
152
152
  Version
153
- } from "./chunk-X4IXNVZV.js";
154
- import "./chunk-ME2NCEKO.js";
155
- import "./chunk-WQ3UIIYQ.js";
153
+ } from "./chunk-NMJ5MMBB.js";
154
+ import "./chunk-J7K6IS5E.js";
155
+ import "./chunk-S3QQYC7T.js";
156
156
  import {
157
157
  KitchenSinkAll
158
- } from "./chunk-JIEF2ST3.js";
158
+ } from "./chunk-PZTRGMAM.js";
159
159
  import {
160
160
  KitchenSinkPrompts
161
- } from "./chunk-B2T3GBT5.js";
162
- import "./chunk-3U4IUVVU.js";
161
+ } from "./chunk-6RJITQAH.js";
162
+ import "./chunk-7E4HY4BI.js";
163
163
  import {
164
164
  KitchenSinkStatic
165
- } from "./chunk-IWXDLFDQ.js";
166
- import "./chunk-CGNIP6G7.js";
165
+ } from "./chunk-PLA2FIVK.js";
166
+ import "./chunk-2CJLC56R.js";
167
167
  import {
168
168
  Generate
169
- } from "./chunk-MW4WJRFT.js";
170
- import "./chunk-CSJN7PVW.js";
169
+ } from "./chunk-MCAI46FD.js";
170
+ import "./chunk-NCUT7QL7.js";
171
171
  import {
172
172
  Logout
173
- } from "./chunk-WD2LS7EH.js";
173
+ } from "./chunk-ILLC5WWL.js";
174
174
  import {
175
175
  ensureAuthenticatedAdmin,
176
176
  ensureAuthenticatedAppManagement,
@@ -178,31 +178,31 @@ import {
178
178
  ensureAuthenticatedPartners,
179
179
  ensureAuthenticatedStorefront,
180
180
  ensureAuthenticatedThemes
181
- } from "./chunk-4IOYUZUL.js";
181
+ } from "./chunk-2SBPGR72.js";
182
182
  import {
183
183
  ClearCache,
184
184
  globalFlags,
185
185
  jsonFlag,
186
186
  runCLI
187
- } from "./chunk-7USSBUNY.js";
187
+ } from "./chunk-6RAS3TKY.js";
188
188
  import {
189
189
  CommandFlags
190
- } from "./chunk-DDSH4NHD.js";
190
+ } from "./chunk-FO4MTYIH.js";
191
191
  import {
192
192
  DocsGenerate
193
- } from "./chunk-OFLVF47B.js";
193
+ } from "./chunk-ECVFRPXR.js";
194
194
  import {
195
195
  HelpCommand
196
- } from "./chunk-KI4PGSYX.js";
196
+ } from "./chunk-7QBUM445.js";
197
197
  import {
198
198
  KitchenSinkAsync
199
- } from "./chunk-EMT2HVTD.js";
200
- import "./chunk-CZK74B63.js";
199
+ } from "./chunk-VG6LPRGA.js";
200
+ import "./chunk-4E7Y62XG.js";
201
201
  import {
202
202
  base_command_default,
203
203
  decodeToml,
204
204
  encodeToml
205
- } from "./chunk-VKFUEWKR.js";
205
+ } from "./chunk-Y7VXKFK7.js";
206
206
  import {
207
207
  require_byline,
208
208
  require_end_of_stream,
@@ -210,7 +210,7 @@ import {
210
210
  require_iserror,
211
211
  require_pump,
212
212
  require_stack_generator
213
- } from "./chunk-3HPSHLFG.js";
213
+ } from "./chunk-CSDHFCD4.js";
214
214
  import {
215
215
  require_once
216
216
  } from "./chunk-O5K4AU7Q.js";
@@ -218,7 +218,7 @@ import {
218
218
  fanoutHooks,
219
219
  getListOfTunnelPlugins,
220
220
  reportAnalyticsEvent
221
- } from "./chunk-GIX7PVWB.js";
221
+ } from "./chunk-3VCWJSLK.js";
222
222
  import {
223
223
  appManagementFqdn,
224
224
  developerDashboardFqdn,
@@ -236,14 +236,14 @@ import {
236
236
  restRequestHeaders,
237
237
  restRequestUrl,
238
238
  setNextDeprecationDate
239
- } from "./chunk-APLIZ3QU.js";
239
+ } from "./chunk-3QKHLZPS.js";
240
240
  import {
241
241
  platformAndArch,
242
242
  username
243
- } from "./chunk-6FA42ZJ7.js";
243
+ } from "./chunk-QWRXYENL.js";
244
244
  import {
245
245
  showNotificationsIfNeeded
246
- } from "./chunk-TJHYV7JJ.js";
246
+ } from "./chunk-Z2EEAFLV.js";
247
247
  import {
248
248
  ClientError,
249
249
  FetchError,
@@ -261,11 +261,11 @@ import {
261
261
  require_lib as require_lib2,
262
262
  require_mime_types,
263
263
  z
264
- } from "./chunk-VQZPHO4H.js";
264
+ } from "./chunk-D4DJJ4PZ.js";
265
265
  import "./chunk-VSLR7ET4.js";
266
266
  import {
267
267
  CLI_KIT_VERSION
268
- } from "./chunk-PPPEGJ7O.js";
268
+ } from "./chunk-7HZBVQEC.js";
269
269
  import {
270
270
  LocalStorage,
271
271
  UnknownPackageManagerError,
@@ -287,7 +287,7 @@ import {
287
287
  usesWorkspaces,
288
288
  versionSatisfies,
289
289
  writePackageJSON
290
- } from "./chunk-53CWVDMP.js";
290
+ } from "./chunk-2ZSVD4ED.js";
291
291
  import {
292
292
  require_semver
293
293
  } from "./chunk-BYPQXSAL.js";
@@ -471,7 +471,7 @@ import {
471
471
  use_stdin_default,
472
472
  writeFile,
473
473
  writeFileSync
474
- } from "./chunk-6V3JEX2A.js";
474
+ } from "./chunk-3IUDQUHD.js";
475
475
  import "./chunk-2HGYYNE5.js";
476
476
  import {
477
477
  require_graceful_fs
@@ -151940,7 +151940,7 @@ var THEME_DIRECTORY_PATTERNS = [
151940
151940
  "templates/customers/**/*.{liquid,json}"
151941
151941
  ], THEME_PARTITION_REGEX = {
151942
151942
  sectionLiquidRegex: /^sections\/.+\.liquid$/,
151943
- liquidRegex: /\.liquid$/,
151943
+ blockLiquidRegex: /^blocks\/.+\.liquid$/,
151944
151944
  configRegex: /^config\/(settings_schema|settings_data)\.json$/,
151945
151945
  sectionJsonRegex: /^sections\/.+\.json$/,
151946
151946
  templateJsonRegex: /^templates\/.+\.json$/,
@@ -152094,10 +152094,10 @@ async function removeThemeFile(root, path3) {
152094
152094
  await removeFile(absolutePath);
152095
152095
  }
152096
152096
  function partitionThemeFiles(files) {
152097
- let sectionLiquidFiles = [], otherLiquidFiles = [], sectionJsonFiles = [], templateJsonFiles = [], otherJsonFiles = [], contextualizedJsonFiles = [], configFiles = [], staticAssetFiles = [];
152097
+ let sectionLiquidFiles = [], otherLiquidFiles = [], sectionJsonFiles = [], templateJsonFiles = [], otherJsonFiles = [], contextualizedJsonFiles = [], configFiles = [], staticAssetFiles = [], blockLiquidFiles = [];
152098
152098
  return files.forEach((file) => {
152099
152099
  let fileKey = file.key;
152100
- fileKey.endsWith(".liquid") ? THEME_PARTITION_REGEX.sectionLiquidRegex.test(fileKey) ? sectionLiquidFiles.push(file) : otherLiquidFiles.push(file) : THEME_PARTITION_REGEX.configRegex.test(fileKey) ? configFiles.push(file) : THEME_PARTITION_REGEX.jsonRegex.test(fileKey) ? THEME_PARTITION_REGEX.contextualizedJsonRegex.test(fileKey) ? contextualizedJsonFiles.push(file) : THEME_PARTITION_REGEX.sectionJsonRegex.test(fileKey) ? sectionJsonFiles.push(file) : THEME_PARTITION_REGEX.templateJsonRegex.test(fileKey) ? templateJsonFiles.push(file) : otherJsonFiles.push(file) : THEME_PARTITION_REGEX.staticAssetRegex.test(fileKey) && staticAssetFiles.push(file);
152100
+ fileKey.endsWith(".liquid") ? THEME_PARTITION_REGEX.sectionLiquidRegex.test(fileKey) ? sectionLiquidFiles.push(file) : THEME_PARTITION_REGEX.blockLiquidRegex.test(fileKey) ? blockLiquidFiles.push(file) : otherLiquidFiles.push(file) : THEME_PARTITION_REGEX.configRegex.test(fileKey) ? configFiles.push(file) : THEME_PARTITION_REGEX.jsonRegex.test(fileKey) ? THEME_PARTITION_REGEX.contextualizedJsonRegex.test(fileKey) ? contextualizedJsonFiles.push(file) : THEME_PARTITION_REGEX.sectionJsonRegex.test(fileKey) ? sectionJsonFiles.push(file) : THEME_PARTITION_REGEX.templateJsonRegex.test(fileKey) ? templateJsonFiles.push(file) : otherJsonFiles.push(file) : THEME_PARTITION_REGEX.staticAssetRegex.test(fileKey) && staticAssetFiles.push(file);
152101
152101
  }), {
152102
152102
  sectionLiquidFiles,
152103
152103
  otherLiquidFiles,
@@ -152106,7 +152106,8 @@ function partitionThemeFiles(files) {
152106
152106
  contextualizedJsonFiles,
152107
152107
  otherJsonFiles,
152108
152108
  configFiles,
152109
- staticAssetFiles
152109
+ staticAssetFiles,
152110
+ blockLiquidFiles
152110
152111
  };
152111
152112
  }
152112
152113
  function isTextFile(path3) {
@@ -153075,6 +153076,7 @@ function orderFilesToBeDeleted(files) {
153075
153076
  ...fileSets.sectionJsonFiles,
153076
153077
  ...fileSets.otherJsonFiles,
153077
153078
  ...fileSets.sectionLiquidFiles,
153079
+ ...fileSets.blockLiquidFiles,
153078
153080
  ...fileSets.otherLiquidFiles,
153079
153081
  ...fileSets.configFiles,
153080
153082
  ...fileSets.staticAssetFiles
@@ -153123,6 +153125,7 @@ function orderFilesToBeUploaded(files) {
153123
153125
  independentFiles: [fileSets.otherLiquidFiles, fileSets.otherJsonFiles, fileSets.staticAssetFiles],
153124
153126
  // Follow order of dependencies:
153125
153127
  dependentFiles: [
153128
+ fileSets.blockLiquidFiles,
153126
153129
  fileSets.sectionLiquidFiles,
153127
153130
  fileSets.sectionJsonFiles,
153128
153131
  fileSets.templateJsonFiles,
@@ -158407,10 +158410,10 @@ async function buildAssetsUrl(port, root) {
158407
158410
  async function startMiniOxygen(options, useNodeRuntime = !1) {
158408
158411
  if (useNodeRuntime) {
158409
158412
  process.env.MINIFLARE_SUBREQUEST_LIMIT = 100;
158410
- let { startNodeServer } = await import("./node-U5FGKDT2.js");
158413
+ let { startNodeServer } = await import("./node-66BW6FOX.js");
158411
158414
  return startNodeServer(options);
158412
158415
  }
158413
- let { startWorkerdServer } = await import("./workerd-KAW7HC3A.js");
158416
+ let { startWorkerdServer } = await import("./workerd-BJF24352.js");
158414
158417
  return startWorkerdServer(options);
158415
158418
  }
158416
158419
 
@@ -161196,7 +161199,7 @@ async function performActionWithRetryAfterRecovery(performAction, recoveryProced
161196
161199
  import stream from "node:stream/promises";
161197
161200
  import * as gzip from "node:zlib";
161198
161201
  import { fileURLToPath as fileURLToPath4 } from "node:url";
161199
- var FUNCTION_RUNNER_VERSION = "v6.3.0", JAVY_VERSION = "v4.0.0", JAVY_PLUGIN_VERSION = "v3.2.0", Executable = class {
161202
+ var FUNCTION_RUNNER_VERSION = "v6.4.0", JAVY_VERSION = "v4.0.0", JAVY_PLUGIN_VERSION = "v3.2.0", Executable = class {
161200
161203
  constructor(name, version, gitHubRepo) {
161201
161204
  this.name = name, this.version = version;
161202
161205
  let filename = process.platform === "win32" ? `${name}.exe` : name;
@@ -161450,8 +161453,8 @@ async function runJavy(fun, options, extra = []) {
161450
161453
  }
161451
161454
  async function installJavy(app) {
161452
161455
  if (app.allExtensions.some((ext) => ext.features.includes("function") && ext.isJavaScript)) {
161453
- let javy = javyBinary();
161454
- await downloadBinary(javy);
161456
+ let javy = javyBinary(), plugin = javyPluginBinary();
161457
+ await Promise.all([downloadBinary(javy), downloadBinary(plugin)]);
161455
161458
  }
161456
161459
  }
161457
161460
  var DefaultJavyBuilder = {
@@ -166339,11 +166342,19 @@ var PartnersClient = class {
166339
166342
  async currentAccountInfo() {
166340
166343
  return this.request(CurrentAccountInfoQuery);
166341
166344
  }
166342
- async targetSchemaDefinition(input) {
166343
- return (await this.request(TargetSchemaDefinitionQuery, input)).definition;
166345
+ async targetSchemaDefinition(input, apiKey, _organizationId, _appId) {
166346
+ let transformedInput = {
166347
+ target: input.handle,
166348
+ version: input.version,
166349
+ apiKey
166350
+ };
166351
+ return (await this.request(TargetSchemaDefinitionQuery, transformedInput)).definition;
166344
166352
  }
166345
- async apiSchemaDefinition(input) {
166346
- return (await this.request(ApiSchemaDefinitionQuery, input)).definition;
166353
+ async apiSchemaDefinition(input, apiKey, _organizationId, _appId) {
166354
+ return (await this.request(ApiSchemaDefinitionQuery, {
166355
+ ...input,
166356
+ apiKey
166357
+ })).definition;
166347
166358
  }
166348
166359
  async migrateToUiExtension(input) {
166349
166360
  return this.request(MigrateToUiExtensionQuery, input);
@@ -167958,6 +167969,146 @@ var PublicApiVersions2 = {
167958
167969
  ]
167959
167970
  };
167960
167971
 
167972
+ // ../app/dist/cli/api/graphql/functions/generated/schema-definition-by-target.js
167973
+ init_cjs_shims();
167974
+ var SchemaDefinitionByTarget = {
167975
+ kind: "Document",
167976
+ definitions: [
167977
+ {
167978
+ kind: "OperationDefinition",
167979
+ operation: "query",
167980
+ name: { kind: "Name", value: "SchemaDefinitionByTarget" },
167981
+ variableDefinitions: [
167982
+ {
167983
+ kind: "VariableDefinition",
167984
+ variable: { kind: "Variable", name: { kind: "Name", value: "handle" } },
167985
+ type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }
167986
+ },
167987
+ {
167988
+ kind: "VariableDefinition",
167989
+ variable: { kind: "Variable", name: { kind: "Name", value: "version" } },
167990
+ type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }
167991
+ }
167992
+ ],
167993
+ selectionSet: {
167994
+ kind: "SelectionSet",
167995
+ selections: [
167996
+ {
167997
+ kind: "Field",
167998
+ name: { kind: "Name", value: "target" },
167999
+ arguments: [
168000
+ {
168001
+ kind: "Argument",
168002
+ name: { kind: "Name", value: "handle" },
168003
+ value: { kind: "Variable", name: { kind: "Name", value: "handle" } }
168004
+ }
168005
+ ],
168006
+ selectionSet: {
168007
+ kind: "SelectionSet",
168008
+ selections: [
168009
+ {
168010
+ kind: "Field",
168011
+ name: { kind: "Name", value: "api" },
168012
+ selectionSet: {
168013
+ kind: "SelectionSet",
168014
+ selections: [
168015
+ {
168016
+ kind: "Field",
168017
+ name: { kind: "Name", value: "schema" },
168018
+ arguments: [
168019
+ {
168020
+ kind: "Argument",
168021
+ name: { kind: "Name", value: "version" },
168022
+ value: { kind: "Variable", name: { kind: "Name", value: "version" } }
168023
+ }
168024
+ ],
168025
+ selectionSet: {
168026
+ kind: "SelectionSet",
168027
+ selections: [
168028
+ { kind: "Field", name: { kind: "Name", value: "definition" } },
168029
+ { kind: "Field", name: { kind: "Name", value: "__typename" } }
168030
+ ]
168031
+ }
168032
+ },
168033
+ { kind: "Field", name: { kind: "Name", value: "__typename" } }
168034
+ ]
168035
+ }
168036
+ },
168037
+ { kind: "Field", name: { kind: "Name", value: "__typename" } }
168038
+ ]
168039
+ }
168040
+ }
168041
+ ]
168042
+ }
168043
+ }
168044
+ ]
168045
+ };
168046
+
168047
+ // ../app/dist/cli/api/graphql/functions/generated/schema-definition-by-api-type.js
168048
+ init_cjs_shims();
168049
+ var SchemaDefinitionByApiType = {
168050
+ kind: "Document",
168051
+ definitions: [
168052
+ {
168053
+ kind: "OperationDefinition",
168054
+ operation: "query",
168055
+ name: { kind: "Name", value: "SchemaDefinitionByApiType" },
168056
+ variableDefinitions: [
168057
+ {
168058
+ kind: "VariableDefinition",
168059
+ variable: { kind: "Variable", name: { kind: "Name", value: "type" } },
168060
+ type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }
168061
+ },
168062
+ {
168063
+ kind: "VariableDefinition",
168064
+ variable: { kind: "Variable", name: { kind: "Name", value: "version" } },
168065
+ type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "String" } } }
168066
+ }
168067
+ ],
168068
+ selectionSet: {
168069
+ kind: "SelectionSet",
168070
+ selections: [
168071
+ {
168072
+ kind: "Field",
168073
+ name: { kind: "Name", value: "api" },
168074
+ arguments: [
168075
+ {
168076
+ kind: "Argument",
168077
+ name: { kind: "Name", value: "type" },
168078
+ value: { kind: "Variable", name: { kind: "Name", value: "type" } }
168079
+ }
168080
+ ],
168081
+ selectionSet: {
168082
+ kind: "SelectionSet",
168083
+ selections: [
168084
+ {
168085
+ kind: "Field",
168086
+ name: { kind: "Name", value: "schema" },
168087
+ arguments: [
168088
+ {
168089
+ kind: "Argument",
168090
+ name: { kind: "Name", value: "version" },
168091
+ value: { kind: "Variable", name: { kind: "Name", value: "version" } }
168092
+ }
168093
+ ],
168094
+ selectionSet: {
168095
+ kind: "SelectionSet",
168096
+ selections: [
168097
+ { kind: "Field", name: { kind: "Name", value: "definition" } },
168098
+ { kind: "Field", name: { kind: "Name", value: "__typename" } }
168099
+ ]
168100
+ }
168101
+ },
168102
+ { kind: "Field", name: { kind: "Name", value: "__typename" } }
168103
+ ]
168104
+ }
168105
+ }
168106
+ ]
168107
+ }
168108
+ }
168109
+ ]
168110
+ };
168111
+
167961
168112
  // ../cli-kit/dist/public/node/api/app-management.js
167962
168113
  init_cjs_shims();
167963
168114
  var import_bottleneck = __toESM(require_lib3()), limiter = new import_bottleneck.default({
@@ -168023,6 +168174,29 @@ async function webhooksRequest(organizationId, query, token, variables) {
168023
168174
  }));
168024
168175
  }
168025
168176
 
168177
+ // ../cli-kit/dist/public/node/api/functions.js
168178
+ init_cjs_shims();
168179
+ var import_bottleneck4 = __toESM(require_lib3()), limiter4 = new import_bottleneck4.default({
168180
+ minTime: 150,
168181
+ maxConcurrent: 10
168182
+ });
168183
+ async function setupRequest2(orgId, token, appId) {
168184
+ let api = "Functions", url = `https://${await appManagementFqdn()}/functions/unstable/organizations/${orgId}/${appId}/graphql`;
168185
+ return {
168186
+ token,
168187
+ api,
168188
+ url,
168189
+ responseOptions: { onResponse: handleDeprecations }
168190
+ };
168191
+ }
168192
+ async function functionsRequestDoc(orgId, query, token, appId, variables) {
168193
+ return await limiter4.schedule(async () => graphqlRequestDoc({
168194
+ ...await setupRequest2(orgId, token, appId),
168195
+ query,
168196
+ variables
168197
+ }));
168198
+ }
168199
+
168026
168200
  // ../app/dist/cli/utilities/developer-platform-client/app-management-client.js
168027
168201
  var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates.json", AppManagementClient = class {
168028
168202
  constructor(session) {
@@ -168429,11 +168603,24 @@ var TEMPLATE_JSON_URL = "https://cdn.shopify.com/static/cli/extensions/templates
168429
168603
  async currentAccountInfo() {
168430
168604
  throw new BugError("Not implemented: currentAccountInfo");
168431
168605
  }
168432
- async targetSchemaDefinition(_input) {
168433
- throw new BugError("Not implemented: targetSchemaDefinition");
168606
+ async targetSchemaDefinition(input, _apiKey, organizationId, appId) {
168607
+ try {
168608
+ let appIdNumber = String(numberFromGid(appId)), token = await this.token();
168609
+ return (await functionsRequestDoc(organizationId, SchemaDefinitionByTarget, token, appIdNumber, {
168610
+ handle: input.handle,
168611
+ version: input.version
168612
+ }))?.target?.api?.schema?.definition ?? null;
168613
+ } catch (error) {
168614
+ throw new AbortError(`Failed to fetch schema definition: ${error}`);
168615
+ }
168434
168616
  }
168435
- async apiSchemaDefinition(_input) {
168436
- throw new BugError("Not implemented: apiSchemaDefinition");
168617
+ async apiSchemaDefinition(input, _apiKey, organizationId, appId) {
168618
+ try {
168619
+ let appIdNumber = String(numberFromGid(appId)), token = await this.token();
168620
+ return (await functionsRequestDoc(organizationId, SchemaDefinitionByApiType, token, appIdNumber, input))?.api?.schema?.definition ?? null;
168621
+ } catch (error) {
168622
+ throw new AbortError(`Failed to fetch schema definition: ${error}`);
168623
+ }
168437
168624
  }
168438
168625
  async migrateToUiExtension(_input) {
168439
168626
  throw new BugError("Not implemented: migrateToUiExtension");
@@ -175615,43 +175802,45 @@ init_cjs_shims();
175615
175802
  // ../app/dist/cli/services/generate-schema.js
175616
175803
  init_cjs_shims();
175617
175804
  async function generateSchemaService(options) {
175618
- let { extension, stdout, developerPlatformClient, app } = options, apiKey = app.configuration.client_id, { api_version: version, type, targeting } = extension.configuration, definition = await (!!targeting?.length ? generateSchemaFromTarget({
175805
+ let { extension, stdout, developerPlatformClient, app, orgId } = options, apiKey = app.configuration.client_id, appId = app.configuration.app_id, { api_version: version, type, targeting } = extension.configuration, definition = await (!!targeting?.length ? generateSchemaFromTarget({
175619
175806
  localIdentifier: extension.localIdentifier,
175620
175807
  developerPlatformClient,
175621
175808
  apiKey,
175809
+ appId,
175622
175810
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
175623
175811
  target: targeting[0].target,
175624
- version
175625
- }) : generateSchemaFromType({
175812
+ version,
175813
+ orgId
175814
+ }) : generateSchemaFromApiType({
175626
175815
  localIdentifier: extension.localIdentifier,
175627
175816
  developerPlatformClient,
175628
175817
  apiKey,
175818
+ appId,
175629
175819
  type,
175630
- version
175820
+ version,
175821
+ orgId
175631
175822
  }));
175632
175823
  if (stdout)
175633
175824
  outputInfo(definition);
175634
175825
  else {
175635
- let outputPath = joinPath(options.path, "schema.graphql");
175826
+ let outputPath = joinPath(extension.directory, "schema.graphql");
175636
175827
  await writeFile(outputPath, definition), outputInfo(`GraphQL Schema for ${extension.localIdentifier} written to ${outputPath}`);
175637
175828
  }
175638
175829
  }
175639
- async function generateSchemaFromTarget({ localIdentifier, developerPlatformClient, apiKey, target, version }) {
175830
+ async function generateSchemaFromTarget({ localIdentifier, developerPlatformClient, appId, apiKey, target, version, orgId }) {
175640
175831
  let variables = {
175641
- apiKey,
175642
- target,
175832
+ handle: target,
175643
175833
  version
175644
- }, definition = await developerPlatformClient.targetSchemaDefinition(variables);
175834
+ }, definition = await developerPlatformClient.targetSchemaDefinition(variables, apiKey, orgId, appId);
175645
175835
  if (!definition)
175646
175836
  throw new AbortError(outputContent`A schema could not be generated for ${localIdentifier}`, outputContent`Check that the Function targets and version are valid.`);
175647
175837
  return definition;
175648
175838
  }
175649
- async function generateSchemaFromType({ localIdentifier, developerPlatformClient, apiKey, version, type }) {
175839
+ async function generateSchemaFromApiType({ localIdentifier, developerPlatformClient, apiKey, appId, version, type, orgId }) {
175650
175840
  let variables = {
175651
- apiKey,
175652
175841
  version,
175653
175842
  type
175654
- }, definition = await developerPlatformClient.apiSchemaDefinition(variables);
175843
+ }, definition = await developerPlatformClient.apiSchemaDefinition(variables, apiKey, orgId, appId);
175655
175844
  if (!definition)
175656
175845
  throw new AbortError(outputContent`A schema could not be generated for ${localIdentifier}`, outputContent`Check that the Function API type and version are valid.`);
175657
175846
  return definition;
@@ -175670,31 +175859,32 @@ var functionFlags = {
175670
175859
  })
175671
175860
  };
175672
175861
  async function inFunctionContext({ path: path3, userProvidedConfigName, apiKey, callback, reset }) {
175673
- let { app, developerPlatformClient } = await linkedAppContext({
175862
+ let { app, developerPlatformClient, organization } = await linkedAppContext({
175674
175863
  directory: path3,
175675
175864
  clientId: apiKey,
175676
175865
  forceRelink: reset ?? !1,
175677
175866
  userProvidedConfigName
175678
175867
  }), allFunctions = app.allExtensions.filter((ext) => ext.isFunctionExtension), ourFunction = allFunctions.find((fun) => fun.directory === path3);
175679
175868
  if (ourFunction)
175680
- return callback(app, developerPlatformClient, ourFunction);
175869
+ return callback(app, developerPlatformClient, ourFunction, organization.id);
175681
175870
  if (isTerminalInteractive()) {
175682
175871
  let selectedFunction = await renderAutocompletePrompt({
175683
175872
  message: "Which function?",
175684
175873
  choices: allFunctions.map((shopifyFunction) => ({ label: shopifyFunction.handle, value: shopifyFunction }))
175685
175874
  });
175686
- return callback(app, developerPlatformClient, selectedFunction);
175875
+ return callback(app, developerPlatformClient, selectedFunction, organization.id);
175687
175876
  } else
175688
175877
  throw new AbortError("Run this command from a function directory or use `--path` to specify a function directory.");
175689
175878
  }
175690
- async function getOrGenerateSchemaPath(extension, app, developerPlatformClient) {
175879
+ async function getOrGenerateSchemaPath(extension, app, developerPlatformClient, orgId) {
175691
175880
  let path3 = joinPath(extension.directory, "schema.graphql");
175692
175881
  return await fileExists(path3) ? path3 : (await generateSchemaService({
175693
175882
  app,
175694
175883
  developerPlatformClient,
175695
175884
  extension,
175696
175885
  stdout: !1,
175697
- path: extension.directory
175886
+ path: extension.directory,
175887
+ orgId
175698
175888
  }), await fileExists(path3) ? path3 : void 0);
175699
175889
  }
175700
175890
 
@@ -176145,7 +176335,7 @@ var _a25, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends AppCom
176145
176335
  userProvidedConfigName: flags.config,
176146
176336
  apiKey: flags["client-id"],
176147
176337
  reset: flags.reset,
176148
- callback: async (app2, developerPlatformClient, ourFunction) => {
176338
+ callback: async (app2, developerPlatformClient, ourFunction, orgId) => {
176149
176339
  let functionExport = DEFAULT_FUNCTION_EXPORT;
176150
176340
  if (flags.export !== void 0)
176151
176341
  outputDebug(`Using export ${flags.export} from the --export flag.`), functionExport = flags.export;
@@ -176164,7 +176354,7 @@ var _a25, DEFAULT_FUNCTION_EXPORT = "_start", FunctionRun = class extends AppCom
176164
176354
  functionExport = targeting?.[0]?.export || DEFAULT_FUNCTION_EXPORT, outputDebug(`Using export '${functionExport}'. Use the --export flag or an interactive terminal to select a different export.`);
176165
176355
  } else
176166
176356
  outputDebug(`No targeting information found. Using the default export '${functionExport}'. Use the --export flag or an interactive terminal to select a different export.`);
176167
- let inputQueryPath = ourFunction?.configuration.targeting?.[0]?.input_query, queryPath = inputQueryPath && `${ourFunction?.directory}/${inputQueryPath}`, schemaPath = await getOrGenerateSchemaPath(ourFunction, app2, developerPlatformClient);
176357
+ let inputQueryPath = ourFunction?.configuration.targeting?.[0]?.input_query, queryPath = inputQueryPath && `${ourFunction?.directory}/${inputQueryPath}`, schemaPath = await getOrGenerateSchemaPath(ourFunction, app2, developerPlatformClient, orgId);
176168
176358
  return await runFunction({
176169
176359
  functionExtension: ourFunction,
176170
176360
  json: flags.json,
@@ -176214,12 +176404,13 @@ var _a26, FetchSchema = class extends AppCommand {
176214
176404
  apiKey,
176215
176405
  reset: flags.reset,
176216
176406
  userProvidedConfigName: flags.config,
176217
- callback: async (app2, developerPlatformClient, ourFunction) => (await generateSchemaService({
176407
+ callback: async (app2, developerPlatformClient, ourFunction, orgId) => (await generateSchemaService({
176218
176408
  app: app2,
176219
176409
  extension: ourFunction,
176220
176410
  developerPlatformClient,
176221
176411
  stdout: flags.stdout,
176222
- path: flags.path
176412
+ path: flags.path,
176413
+ orgId
176223
176414
  }), app2)
176224
176415
  }) };
176225
176416
  }
@@ -176873,11 +177064,10 @@ function buildTomlObject3(extension, _2, appConfiguration) {
176873
177064
  extensions: [
176874
177065
  {
176875
177066
  type: "admin_link",
176876
- name: extension.title,
177067
+ name: config2.text,
176877
177068
  handle: slugify(extension.title.substring(0, MAX_EXTENSION_HANDLE_LENGTH)),
176878
177069
  targeting: [
176879
177070
  {
176880
- text: config2.text,
176881
177071
  url: config2.url,
176882
177072
  target: contextToTarget(context)
176883
177073
  }
@@ -22,7 +22,7 @@ import {
22
22
  themeToken,
23
23
  useEmbeddedThemeCLI,
24
24
  useThemebundling
25
- } from "./chunk-6V3JEX2A.js";
25
+ } from "./chunk-3IUDQUHD.js";
26
26
  import "./chunk-2HGYYNE5.js";
27
27
  import "./chunk-XVNW332R.js";
28
28
  import "./chunk-K6Y4FYT5.js";
@@ -61,4 +61,4 @@ export {
61
61
  useEmbeddedThemeCLI,
62
62
  useThemebundling
63
63
  };
64
- //# sourceMappingURL=local-SU4FNBZU.js.map
64
+ //# sourceMappingURL=local-CWNOWZWQ.js.map
@@ -12,19 +12,19 @@ import {
12
12
  importLocal,
13
13
  logRequestLine,
14
14
  setConstructors
15
- } from "./chunk-EPCOMGTE.js";
16
- import "./chunk-4IOYUZUL.js";
17
- import "./chunk-VKFUEWKR.js";
18
- import "./chunk-3HPSHLFG.js";
15
+ } from "./chunk-35DXXNCI.js";
16
+ import "./chunk-2SBPGR72.js";
17
+ import "./chunk-Y7VXKFK7.js";
18
+ import "./chunk-CSDHFCD4.js";
19
19
  import "./chunk-O5K4AU7Q.js";
20
- import "./chunk-GIX7PVWB.js";
21
- import "./chunk-APLIZ3QU.js";
22
- import "./chunk-6FA42ZJ7.js";
23
- import "./chunk-TJHYV7JJ.js";
24
- import "./chunk-VQZPHO4H.js";
20
+ import "./chunk-3VCWJSLK.js";
21
+ import "./chunk-3QKHLZPS.js";
22
+ import "./chunk-QWRXYENL.js";
23
+ import "./chunk-Z2EEAFLV.js";
24
+ import "./chunk-D4DJJ4PZ.js";
25
25
  import "./chunk-VSLR7ET4.js";
26
- import "./chunk-PPPEGJ7O.js";
27
- import "./chunk-53CWVDMP.js";
26
+ import "./chunk-7HZBVQEC.js";
27
+ import "./chunk-2ZSVD4ED.js";
28
28
  import "./chunk-BYPQXSAL.js";
29
29
  import {
30
30
  AbortError,
@@ -32,7 +32,7 @@ import {
32
32
  readFile,
33
33
  renderSuccess,
34
34
  source_default
35
- } from "./chunk-6V3JEX2A.js";
35
+ } from "./chunk-3IUDQUHD.js";
36
36
  import "./chunk-2HGYYNE5.js";
37
37
  import "./chunk-XVNW332R.js";
38
38
  import "./chunk-K6Y4FYT5.js";
@@ -162,4 +162,4 @@ async function startNodeServer({
162
162
  export {
163
163
  startNodeServer
164
164
  };
165
- //# sourceMappingURL=node-U5FGKDT2.js.map
165
+ //# sourceMappingURL=node-66BW6FOX.js.map