@shopify/cli-kit 3.6.1 → 3.8.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 (134) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/analytics.d.ts +11 -1
  3. package/dist/analytics.js +33 -23
  4. package/dist/analytics.js.map +1 -1
  5. package/dist/api/common.d.ts +1 -1
  6. package/dist/api/common.js +1 -1
  7. package/dist/api/common.js.map +1 -1
  8. package/dist/api/graphql/extension_specifications.js.map +1 -1
  9. package/dist/api/graphql/functions/app_function_set.d.ts +9 -23
  10. package/dist/api/graphql/functions/app_function_set.js +18 -27
  11. package/dist/api/graphql/functions/app_function_set.js.map +1 -1
  12. package/dist/api/graphql/functions/upload_url_generate.d.ts +12 -0
  13. package/dist/api/graphql/functions/upload_url_generate.js +11 -0
  14. package/dist/api/graphql/functions/upload_url_generate.js.map +1 -0
  15. package/dist/api/graphql/get_urls.d.ts +10 -0
  16. package/dist/api/graphql/get_urls.js +10 -0
  17. package/dist/api/graphql/get_urls.js.map +1 -0
  18. package/dist/api/graphql/index.d.ts +19 -14
  19. package/dist/api/graphql/index.js +19 -14
  20. package/dist/api/graphql/index.js.map +1 -1
  21. package/dist/api/graphql/update_urls.d.ts +2 -2
  22. package/dist/api/graphql/update_urls.js +2 -2
  23. package/dist/api/graphql/update_urls.js.map +1 -1
  24. package/dist/constants.d.ts +3 -1
  25. package/dist/constants.js +3 -1
  26. package/dist/constants.js.map +1 -1
  27. package/dist/content-tokens.d.ts +44 -0
  28. package/dist/content-tokens.js +103 -0
  29. package/dist/content-tokens.js.map +1 -0
  30. package/dist/environment/local.d.ts +19 -2
  31. package/dist/environment/local.js +45 -5
  32. package/dist/environment/local.js.map +1 -1
  33. package/dist/environment/utilities.d.ts +4 -0
  34. package/dist/environment/utilities.js +9 -0
  35. package/dist/environment/utilities.js.map +1 -1
  36. package/dist/error.d.ts +4 -4
  37. package/dist/error.js +16 -4
  38. package/dist/error.js.map +1 -1
  39. package/dist/file.d.ts +9 -1
  40. package/dist/file.js +15 -2
  41. package/dist/file.js.map +1 -1
  42. package/dist/github.js.map +1 -1
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.js +1 -0
  45. package/dist/index.js.map +1 -1
  46. package/dist/metadata.d.ts +180 -12
  47. package/dist/metadata.js +39 -6
  48. package/dist/metadata.js.map +1 -1
  49. package/dist/monorail.d.ts +48 -1
  50. package/dist/monorail.js +2 -1
  51. package/dist/monorail.js.map +1 -1
  52. package/dist/node/archiver.js +1 -0
  53. package/dist/node/archiver.js.map +1 -1
  54. package/dist/node/base-command.d.ts +11 -1
  55. package/dist/node/base-command.js +19 -4
  56. package/dist/node/base-command.js.map +1 -1
  57. package/dist/node/cli.js +2 -2
  58. package/dist/node/cli.js.map +1 -1
  59. package/dist/node/dot-env.d.ts +9 -0
  60. package/dist/node/dot-env.js +31 -0
  61. package/dist/node/dot-env.js.map +1 -1
  62. package/dist/node/error-handler.d.ts +14 -2
  63. package/dist/node/error-handler.js +58 -13
  64. package/dist/node/error-handler.js.map +1 -1
  65. package/dist/node/hooks/prerun.js +1 -1
  66. package/dist/node/hooks/prerun.js.map +1 -1
  67. package/dist/node/node-package-manager.d.ts +12 -17
  68. package/dist/node/node-package-manager.js +23 -14
  69. package/dist/node/node-package-manager.js.map +1 -1
  70. package/dist/node/ruby.js +14 -7
  71. package/dist/node/ruby.js.map +1 -1
  72. package/dist/output.d.ts +22 -43
  73. package/dist/output.js +31 -91
  74. package/dist/output.js.map +1 -1
  75. package/dist/path.d.ts +1 -0
  76. package/dist/plugins/tunnel.d.ts +40 -0
  77. package/dist/plugins/tunnel.js +11 -0
  78. package/dist/plugins/tunnel.js.map +1 -0
  79. package/dist/plugins.d.ts +11 -13
  80. package/dist/plugins.js +0 -1
  81. package/dist/plugins.js.map +1 -1
  82. package/dist/session/authorize.js +1 -1
  83. package/dist/session/authorize.js.map +1 -1
  84. package/dist/session/exchange.js +1 -2
  85. package/dist/session/exchange.js.map +1 -1
  86. package/dist/session/redirect-listener.js +6 -5
  87. package/dist/session/redirect-listener.js.map +1 -1
  88. package/dist/session.js +1 -1
  89. package/dist/session.js.map +1 -1
  90. package/dist/store.d.ts +4 -2
  91. package/dist/store.js +3 -4
  92. package/dist/store.js.map +1 -1
  93. package/dist/string.d.ts +1 -0
  94. package/dist/string.js +3 -0
  95. package/dist/string.js.map +1 -1
  96. package/dist/tsconfig.tsbuildinfo +1 -1
  97. package/dist/typing/deep-required.d.ts +12 -0
  98. package/dist/typing/deep-required.js +2 -0
  99. package/dist/typing/deep-required.js.map +1 -0
  100. package/dist/typing/pick-by-prefix.d.ts +12 -0
  101. package/dist/typing/pick-by-prefix.js +2 -0
  102. package/dist/typing/pick-by-prefix.js.map +1 -0
  103. package/dist/ui/executor.d.ts +7 -0
  104. package/dist/ui/executor.js +60 -0
  105. package/dist/ui/executor.js.map +1 -0
  106. package/dist/ui/inquirer/autocomplete.d.ts +11 -0
  107. package/dist/ui/inquirer/autocomplete.js +95 -0
  108. package/dist/ui/inquirer/autocomplete.js.map +1 -0
  109. package/dist/ui/inquirer/input.d.ts +16 -0
  110. package/dist/ui/inquirer/input.js +46 -0
  111. package/dist/ui/inquirer/input.js.map +1 -0
  112. package/dist/ui/inquirer/password.d.ts +7 -0
  113. package/dist/ui/inquirer/password.js +8 -0
  114. package/dist/ui/inquirer/password.js.map +1 -0
  115. package/dist/ui/inquirer/select.d.ts +14 -0
  116. package/dist/ui/inquirer/select.js +27 -0
  117. package/dist/ui/inquirer/select.js.map +1 -0
  118. package/dist/ui.d.ts +7 -23
  119. package/dist/ui.js +13 -60
  120. package/dist/ui.js.map +1 -1
  121. package/dist/version.d.ts +1 -0
  122. package/package.json +15 -5
  123. package/dist/api/graphql/functions/module_upload_url_generate.d.ts +0 -18
  124. package/dist/api/graphql/functions/module_upload_url_generate.js +0 -17
  125. package/dist/api/graphql/functions/module_upload_url_generate.js.map +0 -1
  126. package/dist/ui/autocomplete.d.ts +0 -7
  127. package/dist/ui/autocomplete.js +0 -43
  128. package/dist/ui/autocomplete.js.map +0 -1
  129. package/dist/ui/input.d.ts +0 -7
  130. package/dist/ui/input.js +0 -48
  131. package/dist/ui/input.js.map +0 -1
  132. package/dist/ui/select.d.ts +0 -6
  133. package/dist/ui/select.js +0 -30
  134. package/dist/ui/select.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @shopify/cli-kit
2
2
 
3
+ ## 3.8.0
4
+
5
+ ### Minor Changes
6
+
7
+ - db4e6089: Releasing extensions binary in an automatic way
8
+ - 79df925d: Add GraphQL endpoint to get Partners URLs
9
+
10
+ ### Patch Changes
11
+
12
+ - 79df925d: Add new fields to app cache: updateURLs and newApp
13
+ - 03bd5f28: Added `web-env` command to show and generate .env files without erasing existing ones
14
+
15
+ ## 3.7.1
16
+
17
+ ### Minor Changes
18
+
19
+ - 18717ad5: Rename the environment variable SHOPIFY_CONFIG to SHOPIFY_ENV because it's more representative of its usage
20
+ - 29f46e8f: Make inquirer default for inputs
21
+ - bba213f9: Shopify Functions identifiers have been changed to ULIDs. Existing projects will be updated during the next deploy.
22
+
23
+ ## 3.6.2
24
+
25
+ ### Patch Changes
26
+
27
+ - 59d56a40: Only show errors from CLI 2 once
28
+
3
29
  ## 3.6.1
4
30
 
5
31
  ## 3.6.0
@@ -3,8 +3,9 @@ interface StartOptions {
3
3
  command: string;
4
4
  args: string[];
5
5
  currentTime?: number;
6
+ commandClass?: Interfaces.Command.Class;
6
7
  }
7
- export declare const start: ({ command, args, currentTime }: StartOptions) => void;
8
+ export declare const start: ({ command, args, currentTime, commandClass }: StartOptions) => Promise<void>;
8
9
  interface ReportEventOptions {
9
10
  config: Interfaces.Config;
10
11
  errorMessage?: string;
@@ -16,4 +17,13 @@ interface ReportEventOptions {
16
17
  *
17
18
  */
18
19
  export declare function reportEvent(options: ReportEventOptions): Promise<void>;
20
+ export declare function getEnvironmentData(config: Interfaces.Config): {
21
+ uname: string;
22
+ env_ci: boolean;
23
+ env_ci_platform: string | undefined;
24
+ env_plugin_installed_any_custom: boolean;
25
+ env_plugin_installed_shopify: string;
26
+ env_shell: string;
27
+ env_web_ide: string | undefined;
28
+ };
19
29
  export {};
package/dist/analytics.js CHANGED
@@ -1,21 +1,24 @@
1
- /* eslint-disable @typescript-eslint/naming-convention */
2
1
  import * as environment from './environment.js';
3
2
  import { platformAndArch } from './os.js';
4
- import { resolve } from './path.js';
5
3
  import { version as rubyVersion } from './node/ruby.js';
6
4
  import { content, debug, token } from './output.js';
7
5
  import constants from './constants.js';
8
6
  import * as metadata from './metadata.js';
9
- import { publishEvent } from './monorail.js';
7
+ import { publishEvent, MONORAIL_COMMAND_TOPIC } from './monorail.js';
10
8
  import { fanoutHooks } from './plugins.js';
11
- export const start = ({ command, args, currentTime = new Date().getTime() }) => {
12
- metadata.addSensitive({
9
+ import { packageManagerUsedForCreating } from './node/node-package-manager.js';
10
+ export const start = async ({ command, args, currentTime = new Date().getTime(), commandClass }) => {
11
+ await metadata.addSensitive(() => ({
13
12
  commandStartOptions: {
14
13
  startTime: currentTime,
15
14
  startCommand: command,
16
15
  startArgs: args,
17
16
  },
18
- });
17
+ }));
18
+ await metadata.addPublic(() => ({
19
+ cmd_all_launcher: packageManagerUsedForCreating(),
20
+ cmd_all_plugin: commandClass?.plugin?.name,
21
+ }));
19
22
  };
20
23
  /**
21
24
  * Report an analytics event, sending it off to Monorail -- Shopify's internal analytics service.
@@ -30,11 +33,11 @@ export async function reportEvent(options) {
30
33
  // Nothing to log
31
34
  return;
32
35
  }
33
- if (environment.local.analyticsDisabled()) {
36
+ if (!environment.local.alwaysLogAnalytics() && environment.local.analyticsDisabled()) {
34
37
  debug(content `Skipping command analytics, payload: ${token.json(payload)}`);
35
38
  return;
36
39
  }
37
- const response = await publishEvent('app_cli3_command/1.0', payload.public, payload.sensitive);
40
+ const response = await publishEvent(MONORAIL_COMMAND_TOPIC, payload.public, payload.sensitive);
38
41
  if (response.type === 'error') {
39
42
  debug(response.message);
40
43
  }
@@ -56,20 +59,9 @@ const buildPayload = async ({ config, errorMessage }) => {
56
59
  }
57
60
  const { startCommand, startArgs, startTime } = commandStartOptions;
58
61
  const currentTime = new Date().getTime();
59
- let directory = process.cwd();
60
- const pathFlagIndex = startArgs.indexOf('--path');
61
- if (pathFlagIndex >= 0) {
62
- directory = resolve(startArgs[pathFlagIndex + 1]);
63
- }
64
- const { platform, arch } = platformAndArch();
65
62
  const { '@shopify/app': appPublic, ...otherPluginsPublic } = await fanoutHooks(config, 'public_command_metadata', {});
66
- const { partner_id, project_type, api_key, ...otherShopifyAppPublic } = appPublic ?? {};
67
63
  const sensitivePluginData = await fanoutHooks(config, 'sensitive_command_metadata', {});
68
- const appSpecific = {
69
- partner_id,
70
- api_key,
71
- project_type,
72
- };
64
+ const environmentData = getEnvironmentData(config);
73
65
  return {
74
66
  public: {
75
67
  command: startCommand,
@@ -77,12 +69,13 @@ const buildPayload = async ({ config, errorMessage }) => {
77
69
  time_end: currentTime,
78
70
  total_time: currentTime - startTime,
79
71
  success: errorMessage === undefined,
80
- uname: `${platform} ${arch}`,
81
72
  cli_version: await constants.versions.cliKit(),
82
73
  ruby_version: (await rubyVersion()) || '',
83
74
  node_version: process.version.replace('v', ''),
84
75
  is_employee: await environment.local.isShopify(),
85
- ...appSpecific,
76
+ ...environmentData,
77
+ ...appPublic,
78
+ ...metadata.getAllPublic(),
86
79
  },
87
80
  sensitive: {
88
81
  args: startArgs.join(' '),
@@ -90,7 +83,6 @@ const buildPayload = async ({ config, errorMessage }) => {
90
83
  metadata: JSON.stringify({
91
84
  ...sensitiveMetadata,
92
85
  extraPublic: {
93
- '@shopify/app': otherShopifyAppPublic,
94
86
  ...otherPluginsPublic,
95
87
  },
96
88
  extraSensitive: sensitivePluginData,
@@ -98,4 +90,22 @@ const buildPayload = async ({ config, errorMessage }) => {
98
90
  },
99
91
  };
100
92
  };
93
+ export function getEnvironmentData(config) {
94
+ const ciPlatform = environment.local.ciPlatform();
95
+ const pluginNames = config.plugins
96
+ .map((plugin) => plugin.name)
97
+ .sort()
98
+ .filter((plugin) => !plugin.startsWith('@oclif/'));
99
+ const shopifyPlugins = pluginNames.filter((plugin) => plugin.startsWith('@shopify/'));
100
+ const { platform, arch } = platformAndArch();
101
+ return {
102
+ uname: `${platform} ${arch}`,
103
+ env_ci: ciPlatform.isCI,
104
+ env_ci_platform: ciPlatform.name,
105
+ env_plugin_installed_any_custom: pluginNames.length !== shopifyPlugins.length,
106
+ env_plugin_installed_shopify: JSON.stringify(shopifyPlugins),
107
+ env_shell: config.shell,
108
+ env_web_ide: environment.local.webIDEPlatform(),
109
+ };
110
+ }
101
111
  //# sourceMappingURL=analytics.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,yDAAyD;AACzD,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AACvC,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAA;AACjC,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACjD,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAA;AACzC,OAAO,EAAC,YAAY,EAAC,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAC,WAAW,EAAC,MAAM,cAAc,CAAA;AASxC,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,EAAe,EAAE,EAAE;IACzF,QAAQ,CAAC,YAAY,CAAC;QACpB,mBAAmB,EAAE;YACnB,SAAS,EAAE,WAAW;YACtB,YAAY,EAAE,OAAO;YACr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AAM,WAAW,CAAC,KAAK,CAAC,SAAS,EAAE;YAChD,GAAG,WAAW;SACf;QACD,SAAS,EAAE;YACT,IAAI,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC;YACzB,aAAa,EAAE,YAAY;YAC3B,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC;gBACvB,GAAG,iBAAiB;gBACpB,WAAW,EAAE;oBACX,cAAc,EAAE,qBAAqB;oBACrC,GAAG,kBAAkB;iBACtB;gBACD,cAAc,EAAE,mBAAmB;aACpC,CAAC;SACH;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport * as environment from './environment.js'\nimport {platformAndArch} from './os.js'\nimport {resolve} from './path.js'\nimport {version as rubyVersion} from './node/ruby.js'\nimport {content, debug, token} from './output.js'\nimport constants from './constants.js'\nimport * as metadata from './metadata.js'\nimport {publishEvent} from './monorail.js'\nimport {fanoutHooks} from './plugins.js'\nimport {Interfaces} from '@oclif/core'\n\ninterface StartOptions {\n command: string\n args: string[]\n currentTime?: number\n}\n\nexport const start = ({command, args, currentTime = new Date().getTime()}: StartOptions) => {\n metadata.addSensitive({\n commandStartOptions: {\n startTime: currentTime,\n startCommand: command,\n startArgs: args,\n },\n })\n}\n\ninterface ReportEventOptions {\n config: Interfaces.Config\n errorMessage?: string\n}\n\n/**\n * Report an analytics event, sending it off to Monorail -- Shopify's internal analytics service.\n *\n * The payload for an event includes both generic data, and data gathered from installed plug-ins.\n *\n */\nexport async function reportEvent(options: ReportEventOptions) {\n try {\n const payload = await buildPayload(options)\n if (payload === undefined) {\n // Nothing to log\n return\n }\n if (environment.local.analyticsDisabled()) {\n debug(content`Skipping command analytics, payload: ${token.json(payload)}`)\n return\n }\n const response = await publishEvent('app_cli3_command/1.0', payload.public, payload.sensitive)\n if (response.type === 'error') {\n debug(response.message)\n }\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n let message = 'Failed to report usage analytics'\n if (error instanceof Error) {\n message = message.concat(`: ${error.message}`)\n }\n debug(message)\n }\n}\n\nconst buildPayload = async ({config, errorMessage}: ReportEventOptions) => {\n const {commandStartOptions, ...sensitiveMetadata} = metadata.getAllSensitive()\n if (commandStartOptions === undefined) {\n debug('Unable to log analytics event - no information on executed command')\n return\n }\n const {startCommand, startArgs, startTime} = commandStartOptions\n const currentTime = new Date().getTime()\n\n let directory = process.cwd()\n const pathFlagIndex = startArgs.indexOf('--path')\n if (pathFlagIndex >= 0) {\n directory = resolve(startArgs[pathFlagIndex + 1])\n }\n\n const {platform, arch} = platformAndArch()\n\n const {'@shopify/app': appPublic, ...otherPluginsPublic} = await fanoutHooks(config, 'public_command_metadata', {})\n const {partner_id, project_type, api_key, ...otherShopifyAppPublic} = appPublic ?? {}\n\n const sensitivePluginData = await fanoutHooks(config, 'sensitive_command_metadata', {})\n\n const appSpecific = {\n partner_id,\n api_key,\n project_type,\n }\n\n return {\n public: {\n command: startCommand,\n time_start: startTime,\n time_end: currentTime,\n total_time: currentTime - startTime,\n success: errorMessage === undefined,\n uname: `${platform} ${arch}`,\n cli_version: await constants.versions.cliKit(),\n ruby_version: (await rubyVersion()) || '',\n node_version: process.version.replace('v', ''),\n is_employee: await environment.local.isShopify(),\n ...appSpecific,\n },\n sensitive: {\n args: startArgs.join(' '),\n error_message: errorMessage,\n metadata: JSON.stringify({\n ...sensitiveMetadata,\n extraPublic: {\n '@shopify/app': otherShopifyAppPublic,\n ...otherPluginsPublic,\n },\n extraSensitive: sensitivePluginData,\n }),\n },\n }\n}\n"]}
1
+ {"version":3,"file":"analytics.js","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AACvC,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,gBAAgB,CAAA;AACrD,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK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AAe,EAAE,CAAA;IAE1C,OAAO;QACL,KAAK,EAAE,GAAG,QAAQ,IAAI,IAAI,EAAE;QAC5B,MAAM,EAAE,UAAU,CAAC,IAAI;QACvB,eAAe,EAAE,UAAU,CAAC,IAAI;QAChC,+BAA+B,EAAE,WAAW,CAAC,MAAM,KAAK,cAAc,CAAC,MAAM;QAC7E,4BAA4B,EAAE,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;QAC5D,SAAS,EAAE,MAAM,CAAC,KAAK;QACvB,WAAW,EAAE,WAAW,CAAC,KAAK,CAAC,cAAc,EAAE;KAChD,CAAA;AACH,CAAC","sourcesContent":["import * as environment from './environment.js'\nimport {platformAndArch} from './os.js'\nimport {version as rubyVersion} from './node/ruby.js'\nimport {content, debug, token} from './output.js'\nimport constants from './constants.js'\nimport * as metadata from './metadata.js'\nimport {publishEvent, MONORAIL_COMMAND_TOPIC} from './monorail.js'\nimport {fanoutHooks} from './plugins.js'\nimport {packageManagerUsedForCreating} from './node/node-package-manager.js'\nimport {Interfaces} from '@oclif/core'\n\ninterface StartOptions {\n command: string\n args: string[]\n currentTime?: number\n commandClass?: Interfaces.Command.Class\n}\n\nexport const start = async ({command, args, currentTime = new Date().getTime(), commandClass}: StartOptions) => {\n await metadata.addSensitive(() => ({\n commandStartOptions: {\n startTime: currentTime,\n startCommand: command,\n startArgs: args,\n },\n }))\n\n await metadata.addPublic(() => ({\n cmd_all_launcher: packageManagerUsedForCreating(),\n cmd_all_plugin: commandClass?.plugin?.name,\n }))\n}\n\ninterface ReportEventOptions {\n config: Interfaces.Config\n errorMessage?: string\n}\n\n/**\n * Report an analytics event, sending it off to Monorail -- Shopify's internal analytics service.\n *\n * The payload for an event includes both generic data, and data gathered from installed plug-ins.\n *\n */\nexport async function reportEvent(options: ReportEventOptions) {\n try {\n const payload = await buildPayload(options)\n if (payload === undefined) {\n // Nothing to log\n return\n }\n if (!environment.local.alwaysLogAnalytics() && environment.local.analyticsDisabled()) {\n debug(content`Skipping command analytics, payload: ${token.json(payload)}`)\n return\n }\n const response = await publishEvent(MONORAIL_COMMAND_TOPIC, payload.public, payload.sensitive)\n if (response.type === 'error') {\n debug(response.message)\n }\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (error) {\n let message = 'Failed to report usage analytics'\n if (error instanceof Error) {\n message = message.concat(`: ${error.message}`)\n }\n debug(message)\n }\n}\n\nconst buildPayload = async ({config, errorMessage}: ReportEventOptions) => {\n const {commandStartOptions, ...sensitiveMetadata} = metadata.getAllSensitive()\n if (commandStartOptions === undefined) {\n debug('Unable to log analytics event - no information on executed command')\n return\n }\n const {startCommand, startArgs, startTime} = commandStartOptions\n const currentTime = new Date().getTime()\n\n const {'@shopify/app': appPublic, ...otherPluginsPublic} = await fanoutHooks(config, 'public_command_metadata', {})\n const sensitivePluginData = await fanoutHooks(config, 'sensitive_command_metadata', {})\n\n const environmentData = getEnvironmentData(config)\n\n return {\n public: {\n command: startCommand,\n time_start: startTime,\n time_end: currentTime,\n total_time: currentTime - startTime,\n success: errorMessage === undefined,\n cli_version: await constants.versions.cliKit(),\n ruby_version: (await rubyVersion()) || '',\n node_version: process.version.replace('v', ''),\n is_employee: await environment.local.isShopify(),\n ...environmentData,\n ...appPublic,\n ...metadata.getAllPublic(),\n },\n sensitive: {\n args: startArgs.join(' '),\n error_message: errorMessage,\n metadata: JSON.stringify({\n ...sensitiveMetadata,\n extraPublic: {\n ...otherPluginsPublic,\n },\n extraSensitive: sensitivePluginData,\n }),\n },\n }\n}\n\nexport function getEnvironmentData(config: Interfaces.Config) {\n const ciPlatform = environment.local.ciPlatform()\n\n const pluginNames = config.plugins\n .map((plugin) => plugin.name)\n .sort()\n .filter((plugin) => !plugin.startsWith('@oclif/'))\n const shopifyPlugins = pluginNames.filter((plugin) => plugin.startsWith('@shopify/'))\n\n const {platform, arch} = platformAndArch()\n\n return {\n uname: `${platform} ${arch}`,\n env_ci: ciPlatform.isCI,\n env_ci_platform: ciPlatform.name,\n env_plugin_installed_any_custom: pluginNames.length !== shopifyPlugins.length,\n env_plugin_installed_shopify: JSON.stringify(shopifyPlugins),\n env_shell: config.shell,\n env_web_ide: environment.local.webIDEPlatform(),\n }\n}\n"]}
@@ -17,5 +17,5 @@ export declare function sanitizedHeadersOutput(headers: {
17
17
  }): string;
18
18
  export declare function debugLogRequest<T>(api: string, query: RequestDocument, variables?: Variables, headers?: {
19
19
  [key: string]: string;
20
- }): Promise<void>;
20
+ }): void;
21
21
  export declare function handlingErrors<T>(api: string, action: () => Promise<T>): Promise<T>;
@@ -43,7 +43,7 @@ export function sanitizedHeadersOutput(headers) {
43
43
  })
44
44
  .join('\n');
45
45
  }
46
- export async function debugLogRequest(api, query, variables, headers = {}) {
46
+ export function debugLogRequest(api, query, variables, headers = {}) {
47
47
  debug(`
48
48
  Sending ${token.raw(api)} GraphQL request:
49
49
  ${query}
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/api/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAA;AACrD,OAAO,SAAS,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAC,gBAAgB,EAAE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,MAAM,aAAa,CAAA;AAClD,OAAO,EAAC,WAAW,EAA6B,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAA;AAEjC,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IAErD,YAAmB,OAAe,EAAE,UAAkB;QACpD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAa;IAC9C,MAAM,SAAS,GAAG,kBAAkB,MAAM,SAAS,CA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AG,CAAC,GAAG,CAAC;EACtB,KAAK;;;EAGL,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;;;EAGnD,sBAAsB,CAAC,OAAO,CAAC;CAChC,CAAC,CAAA;AACF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAI,GAAW,EAAE,MAAwB;IAC3E,IAAI;QACF,OAAO,MAAM,MAAM,EAAE,CAAA;KACtB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,KAAK,YAAY,WAAW,EAAE;YAChC,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,CAAA;QAC3C,KAAK,CAAC,GAAG,CACb,GAAG,CACJ,8DAA8D,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE;;IAEvF,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;OACpC,CAAC,CAAA;YACF,IAAI,WAAkB,CAAA;YACtB,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE;gBAC/B,WAAW,GAAG,IAAI,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;aAC1E;iBAAM;gBACL,WAAW,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;aACtC;YACD,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;YAC/B,MAAM,WAAW,CAAA;SAClB;aAAM;YACL,MAAM,KAAK,CAAA;SACZ;KACF;AACH,CAAC","sourcesContent":["import {firstPartyDev} from '../environment/local.js'\nimport constants from '../constants.js'\nimport {stringifyMessage, content, token as outputToken, token, debug} from '../output.js'\nimport {Abort, ExtendableError} from '../error.js'\nimport {ClientError, RequestDocument, Variables} from 'graphql-request'\nimport {randomUUID} from 'crypto'\n\nexport class RequestClientError extends ExtendableError {\n statusCode: number\n public constructor(message: string, statusCode: number) {\n super(message)\n this.statusCode = statusCode\n }\n}\n\nexport async function buildHeaders(token: string): Promise<{[key: string]: string}> {\n const userAgent = `Shopify CLI; v=${await constants.versions.cliKit()}`\n\n const headers = {\n 'User-Agent': userAgent,\n // 'Sec-CH-UA': secCHUA, This header requires the Git sha.\n 'Sec-CH-UA-PLATFORM': process.platform,\n 'X-Request-Id': randomUUID(),\n authorization: `Bearer ${token}`,\n 'X-Shopify-Access-Token': `Bearer ${token}`,\n 'Content-Type': 'application/json',\n ...(firstPartyDev() && {'X-Shopify-Cli-Employee': '1'}),\n }\n\n return headers\n}\n\n/**\n * Removes the sensitive data from the headers and outputs them as a string.\n * @param headers {{[key: string]: string}} HTTP headers.\n * @returns {string} A sanitized version of the headers as a string.\n */\nexport function sanitizedHeadersOutput(headers: {[key: string]: string}): string {\n const sanitized: {[key: string]: string} = {}\n const keywords = ['token', 'authorization']\n Object.keys(headers).forEach((header) => {\n if (keywords.find((keyword) => header.toLocaleLowerCase().includes(keyword)) === undefined) {\n sanitized[header] = headers[header]\n }\n })\n return Object.keys(sanitized)\n .map((header) => {\n return ` - ${header}: ${sanitized[header]}`\n })\n .join('\\n')\n}\n\nexport async function debugLogRequest<T>(\n api: string,\n query: RequestDocument,\n variables?: Variables,\n headers: {[key: string]: string} = {},\n) {\n debug(`\nSending ${token.raw(api)} GraphQL request:\n${query}\n\nWith variables:\n${variables ? JSON.stringify(variables, null, 2) : ''}\n\nAnd headers:\n${sanitizedHeadersOutput(headers)}\n`)\n}\n\nexport async function handlingErrors<T>(api: string, action: () => Promise<T>): Promise<T> {\n try {\n return await action()\n } catch (error) {\n if (error instanceof ClientError) {\n const errorMessage = stringifyMessage(content`\n The ${token.raw(\n api,\n )} GraphQL API responded unsuccessfully with the HTTP status ${`${error.response.status}`} and errors:\n\n ${outputToken.json(error.response.errors)}\n `)\n let mappedError: Error\n if (error.response.status < 500) {\n mappedError = new RequestClientError(errorMessage, error.response.status)\n } else {\n mappedError = new Abort(errorMessage)\n }\n mappedError.stack = error.stack\n throw mappedError\n } else {\n throw error\n }\n }\n}\n"]}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/api/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,yBAAyB,CAAA;AACrD,OAAO,SAAS,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAC,gBAAgB,EAAE,OAAO,EAAE,KAAK,IAAI,WAAW,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,cAAc,CAAA;AAC1F,OAAO,EAAC,KAAK,EAAE,eAAe,EAAC,MAAM,aAAa,CAAA;AAClD,OAAO,EAAC,WAAW,EAA6B,MAAM,iBAAiB,CAAA;AACvE,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAA;AAEjC,MAAM,OAAO,kBAAmB,SAAQ,eAAe;IAErD,YAAmB,OAAe,EAAE,UAAkB;QACpD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAa;IAC9C,MAAM,SAAS,GAAG,kBAAkB,MAAM,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAA;IAEvE,MAAM,OAAO,GAAG;QACd,YAAY,EAAE,SAAS;QACvB,0DAA0D;QAC1D,oBAAoB,EAAE,OAAO,CAAC,QAAQ;QACtC,cAAc,EAAE,UAAU,EAAE;QAC5B,aAAa,EAAE,UAAU,KAAK,EAAE;QAChC,wBAAwB,EAAE,UAAU,KAAK,EAAE;QAC3C,cAAc,EAAE,kBAAkB;QAClC,GAAG,CAAC,aAAa,EAAE,IAAI,EAAC,wBAAwB,EAAE,GAAG,EAAC,CAAC;KACxD,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,OAAgC;IACrE,MAAM,SAAS,GAA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A8D,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,EAAE;;IAEvF,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;OACpC,CAAC,CAAA;YACF,IAAI,WAAkB,CAAA;YACtB,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,GAAG,EAAE;gBAC/B,WAAW,GAAG,IAAI,kBAAkB,CAAC,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;aAC1E;iBAAM;gBACL,WAAW,GAAG,IAAI,KAAK,CAAC,YAAY,CAAC,CAAA;aACtC;YACD,WAAW,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;YAC/B,MAAM,WAAW,CAAA;SAClB;aAAM;YACL,MAAM,KAAK,CAAA;SACZ;KACF;AACH,CAAC","sourcesContent":["import {firstPartyDev} from '../environment/local.js'\nimport constants from '../constants.js'\nimport {stringifyMessage, content, token as outputToken, token, debug} from '../output.js'\nimport {Abort, ExtendableError} from '../error.js'\nimport {ClientError, RequestDocument, Variables} from 'graphql-request'\nimport {randomUUID} from 'crypto'\n\nexport class RequestClientError extends ExtendableError {\n statusCode: number\n public constructor(message: string, statusCode: number) {\n super(message)\n this.statusCode = statusCode\n }\n}\n\nexport async function buildHeaders(token: string): Promise<{[key: string]: string}> {\n const userAgent = `Shopify CLI; v=${await constants.versions.cliKit()}`\n\n const headers = {\n 'User-Agent': userAgent,\n // 'Sec-CH-UA': secCHUA, This header requires the Git sha.\n 'Sec-CH-UA-PLATFORM': process.platform,\n 'X-Request-Id': randomUUID(),\n authorization: `Bearer ${token}`,\n 'X-Shopify-Access-Token': `Bearer ${token}`,\n 'Content-Type': 'application/json',\n ...(firstPartyDev() && {'X-Shopify-Cli-Employee': '1'}),\n }\n\n return headers\n}\n\n/**\n * Removes the sensitive data from the headers and outputs them as a string.\n * @param headers {{[key: string]: string}} HTTP headers.\n * @returns {string} A sanitized version of the headers as a string.\n */\nexport function sanitizedHeadersOutput(headers: {[key: string]: string}): string {\n const sanitized: {[key: string]: string} = {}\n const keywords = ['token', 'authorization']\n Object.keys(headers).forEach((header) => {\n if (keywords.find((keyword) => header.toLocaleLowerCase().includes(keyword)) === undefined) {\n sanitized[header] = headers[header]\n }\n })\n return Object.keys(sanitized)\n .map((header) => {\n return ` - ${header}: ${sanitized[header]}`\n })\n .join('\\n')\n}\n\nexport function debugLogRequest<T>(\n api: string,\n query: RequestDocument,\n variables?: Variables,\n headers: {[key: string]: string} = {},\n) {\n debug(`\nSending ${token.raw(api)} GraphQL request:\n${query}\n\nWith variables:\n${variables ? JSON.stringify(variables, null, 2) : ''}\n\nAnd headers:\n${sanitizedHeadersOutput(headers)}\n`)\n}\n\nexport async function handlingErrors<T>(api: string, action: () => Promise<T>): Promise<T> {\n try {\n return await action()\n } catch (error) {\n if (error instanceof ClientError) {\n const errorMessage = stringifyMessage(content`\n The ${token.raw(\n api,\n )} GraphQL API responded unsuccessfully with the HTTP status ${`${error.response.status}`} and errors:\n\n ${outputToken.json(error.response.errors)}\n `)\n let mappedError: Error\n if (error.response.status < 500) {\n mappedError = new RequestClientError(errorMessage, error.response.status)\n } else {\n mappedError = new Abort(errorMessage)\n }\n mappedError.stack = error.stack\n throw mappedError\n } else {\n throw error\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"extension_specifications.js","sourceRoot":"","sources":["../../../src/api/graphql/extension_specifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;CAe9C,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const ExtensionSpecificationsQuery = gql`\n query fetchSpecifications($api_key: String!) {\n extensionSpecifications(apiKey: $api_key) {\n name\n identifier\n options {\n managementExperience\n }\n features {\n argo {\n surface\n }\n }\n }\n }\n`\n\nexport interface ExtensionSpecificationsQueryVariables {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n api_key: string\n}\n\nexport interface ExtensionSpecificationsQuerySchema {\n extensionSpecifications: {\n name: string\n identifier: string\n options: {\n managementExperience: 'cli' | 'custom' | 'dashboard'\n }[]\n features?: {\n argo?: {\n surface: string\n }\n }\n }[]\n}\n"]}
1
+ {"version":3,"file":"extension_specifications.js","sourceRoot":"","sources":["../../../src/api/graphql/extension_specifications.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;CAe9C,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const ExtensionSpecificationsQuery = gql`\n query fetchSpecifications($api_key: String!) {\n extensionSpecifications(apiKey: $api_key) {\n name\n identifier\n options {\n managementExperience\n }\n features {\n argo {\n surface\n }\n }\n }\n }\n`\n\nexport interface ExtensionSpecificationsQueryVariables {\n api_key: string\n}\n\nexport interface ExtensionSpecificationsQuerySchema {\n extensionSpecifications: {\n name: string\n identifier: string\n options: {\n managementExperience: 'cli' | 'custom' | 'dashboard'\n }[]\n features?: {\n argo?: {\n surface: string\n }\n }\n }[]\n}\n"]}
@@ -1,43 +1,29 @@
1
1
  export declare const AppFunctionSetMutation: string;
2
2
  export interface AppFunctionSetMutationSchema {
3
3
  data: {
4
- appScriptSet: {
4
+ functionSet: {
5
5
  userErrors: {
6
6
  field: string;
7
7
  message: string;
8
8
  tag: string;
9
9
  }[];
10
- appScript?: {
11
- uuid: string;
12
- appKey: string;
13
- configSchema: unknown;
14
- extensionPointName: string;
15
- title: string;
10
+ function?: {
11
+ id: string;
16
12
  };
17
13
  };
18
14
  };
19
15
  }
20
16
  export interface AppFunctionSetVariables {
21
- uuid?: string;
22
- extensionPointName: string;
17
+ id?: string;
18
+ legacyUuid?: string;
23
19
  title: string;
24
20
  description?: string;
25
- force?: boolean;
26
- schemaMajorVersion?: string;
27
- schemaMinorVersion?: string;
28
- scriptConfigVersion?: string;
29
- configurationUi: boolean;
30
- configurationDefinition?: string;
31
- moduleUploadUrl: string;
32
- library?: {
33
- language: string;
34
- version: string;
35
- };
21
+ apiType: string;
22
+ apiVersion?: string;
23
+ inputQuery?: string;
36
24
  appBridge?: {
37
25
  createPath?: string;
38
26
  detailsPath?: string;
39
27
  };
40
- inputQuery?: string;
41
- apiVersion?: string;
42
- skipCompilationJob: boolean;
28
+ moduleUploadUrl: string;
43
29
  }
@@ -1,49 +1,40 @@
1
1
  import { gql } from 'graphql-request';
2
2
  export const AppFunctionSetMutation = gql `
3
- mutation AppScriptSet(
4
- $uuid: String
5
- $extensionPointName: ExtensionPointName!
3
+ mutation FunctionSet(
4
+ $id: FunctionId
5
+ $legacyUuid: String
6
6
  $title: String!
7
7
  $description: String
8
- $force: Boolean
9
- $schemaMajorVersion: String
10
- $schemaMinorVersion: String
11
- $scriptConfigVersion: String
12
- $configurationUi: Boolean!
13
- $configurationDefinition: String
14
- $moduleUploadUrl: String!
15
- $library: LibraryInput
8
+ $apiType: String!
9
+ $apiVersion: String!
16
10
  $inputQuery: String
17
11
  $appBridge: AppBridgeInput
18
- $apiVersion: String
12
+ $moduleUploadUrl: String!
19
13
  ) {
20
- appScriptSet(
21
- uuid: $uuid
22
- extensionPointName: $extensionPointName
14
+ functionSet(
15
+ id: $id
16
+ legacyUuid: $legacyUuid
23
17
  title: $title
24
18
  description: $description
25
- force: $force
26
- schemaMajorVersion: $schemaMajorVersion
27
- schemaMinorVersion: $schemaMinorVersion
28
- scriptConfigVersion: $scriptConfigVersion
29
- configurationUi: $configurationUi
30
- configurationDefinition: $configurationDefinition
31
- moduleUploadUrl: $moduleUploadUrl
32
- library: $library
19
+ apiType: $apiType
20
+ apiVersion: $apiVersion
33
21
  inputQuery: $inputQuery
34
22
  appBridge: $appBridge
35
- apiVersion: $apiVersion
23
+ moduleUploadUrl: $moduleUploadUrl
36
24
  ) {
37
25
  userErrors {
38
26
  field
39
27
  message
40
28
  tag
41
29
  }
42
- appScript {
30
+ function {
31
+ id
43
32
  uuid
44
33
  appKey
45
- configSchema
46
- extensionPointName
34
+ configuration {
35
+ schema
36
+ }
37
+ apiType
47
38
  title
48
39
  }
49
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"app_function_set.js","sourceRoot":"","sources":["../../../../src/api/graphql/functions/app_function_set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiDxC,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const AppFunctionSetMutation = gql`\n mutation AppScriptSet(\n $uuid: String\n $extensionPointName: ExtensionPointName!\n $title: String!\n $description: String\n $force: Boolean\n $schemaMajorVersion: String\n $schemaMinorVersion: String\n $scriptConfigVersion: String\n $configurationUi: Boolean!\n $configurationDefinition: String\n $moduleUploadUrl: String!\n $library: LibraryInput\n $inputQuery: String\n $appBridge: AppBridgeInput\n $apiVersion: String\n ) {\n appScriptSet(\n uuid: $uuid\n extensionPointName: $extensionPointName\n title: $title\n description: $description\n force: $force\n schemaMajorVersion: $schemaMajorVersion\n schemaMinorVersion: $schemaMinorVersion\n scriptConfigVersion: $scriptConfigVersion\n configurationUi: $configurationUi\n configurationDefinition: $configurationDefinition\n moduleUploadUrl: $moduleUploadUrl\n library: $library\n inputQuery: $inputQuery\n appBridge: $appBridge\n apiVersion: $apiVersion\n ) {\n userErrors {\n field\n message\n tag\n }\n appScript {\n uuid\n appKey\n configSchema\n extensionPointName\n title\n }\n }\n }\n`\n\nexport interface AppFunctionSetMutationSchema {\n data: {\n appScriptSet: {\n userErrors: {\n field: string\n message: string\n tag: string\n }[]\n appScript?: {\n uuid: string\n appKey: string\n configSchema: unknown\n extensionPointName: string\n title: string\n }\n }\n }\n}\n\nexport interface AppFunctionSetVariables {\n uuid?: string\n extensionPointName: string\n title: string\n description?: string\n force?: boolean\n schemaMajorVersion?: string\n schemaMinorVersion?: string\n scriptConfigVersion?: string\n configurationUi: boolean\n configurationDefinition?: string\n moduleUploadUrl: string\n library?: {\n language: string\n version: string\n }\n appBridge?: {\n createPath?: string\n detailsPath?: string\n }\n inputQuery?: string\n apiVersion?: string\n skipCompilationJob: boolean\n}\n"]}
1
+ {"version":3,"file":"app_function_set.js","sourceRoot":"","sources":["../../../../src/api/graphql/functions/app_function_set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwCxC,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const AppFunctionSetMutation = gql`\n mutation FunctionSet(\n $id: FunctionId\n $legacyUuid: String\n $title: String!\n $description: String\n $apiType: String!\n $apiVersion: String!\n $inputQuery: String\n $appBridge: AppBridgeInput\n $moduleUploadUrl: String!\n ) {\n functionSet(\n id: $id\n legacyUuid: $legacyUuid\n title: $title\n description: $description\n apiType: $apiType\n apiVersion: $apiVersion\n inputQuery: $inputQuery\n appBridge: $appBridge\n moduleUploadUrl: $moduleUploadUrl\n ) {\n userErrors {\n field\n message\n tag\n }\n function {\n id\n uuid\n appKey\n configuration {\n schema\n }\n apiType\n title\n }\n }\n }\n`\n\nexport interface AppFunctionSetMutationSchema {\n data: {\n functionSet: {\n userErrors: {\n field: string\n message: string\n tag: string\n }[]\n function?: {\n id: string\n }\n }\n }\n}\n\nexport interface AppFunctionSetVariables {\n id?: string\n legacyUuid?: string\n title: string\n description?: string\n apiType: string\n apiVersion?: string\n inputQuery?: string\n appBridge?: {\n createPath?: string\n detailsPath?: string\n }\n moduleUploadUrl: string\n}\n"]}
@@ -0,0 +1,12 @@
1
+ export declare const UploadUrlGenerateMutation: string;
2
+ export interface UploadUrlGenerateMutationSchema {
3
+ data: {
4
+ uploadUrlGenerate: {
5
+ url: string;
6
+ headers: {
7
+ [key: string]: string;
8
+ };
9
+ maxSize: string;
10
+ };
11
+ };
12
+ }
@@ -0,0 +1,11 @@
1
+ import { gql } from 'graphql-request';
2
+ export const UploadUrlGenerateMutation = gql `
3
+ mutation uploadUrlGenerate {
4
+ uploadUrlGenerate {
5
+ url
6
+ headers
7
+ maxSize
8
+ }
9
+ }
10
+ `;
11
+ //# sourceMappingURL=upload_url_generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upload_url_generate.js","sourceRoot":"","sources":["../../../../src/api/graphql/functions/upload_url_generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAA;;;;;;;;CAQ3C,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const UploadUrlGenerateMutation = gql`\n mutation uploadUrlGenerate {\n uploadUrlGenerate {\n url\n headers\n maxSize\n }\n }\n`\n\nexport interface UploadUrlGenerateMutationSchema {\n data: {\n uploadUrlGenerate: {\n url: string\n headers: {[key: string]: string}\n maxSize: string\n }\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ export declare const GetURLsQuery: string;
2
+ export interface GetURLsQueryVariables {
3
+ apiKey: string;
4
+ }
5
+ export interface GetURLsQuerySchema {
6
+ app: {
7
+ applicationUrl: string;
8
+ redirectUrlWhitelist: string[];
9
+ };
10
+ }
@@ -0,0 +1,10 @@
1
+ import { gql } from 'graphql-request';
2
+ export const GetURLsQuery = gql `
3
+ query getApp($apiKey: String!) {
4
+ app(apiKey: $apiKey) {
5
+ applicationUrl
6
+ redirectUrlWhitelist
7
+ }
8
+ }
9
+ `;
10
+ //# sourceMappingURL=get_urls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get_urls.js","sourceRoot":"","sources":["../../../src/api/graphql/get_urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;CAO9B,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const GetURLsQuery = gql`\n query getApp($apiKey: String!) {\n app(apiKey: $apiKey) {\n applicationUrl\n redirectUrlWhitelist\n }\n }\n`\n\nexport interface GetURLsQueryVariables {\n apiKey: string\n}\n\nexport interface GetURLsQuerySchema {\n app: {\n applicationUrl: string\n redirectUrlWhitelist: string[]\n }\n}\n"]}
@@ -1,22 +1,27 @@
1
- export * from './find_org.js';
1
+ export * from './all_app_extension_registrations.js';
2
+ export * from './all_app_extension_registrations.js';
2
3
  export * from './all_orgs.js';
3
- export * from './create_app.js';
4
- export * from './update_urls.js';
5
- export * from './find_app.js';
6
- export * from './update_draft.js';
7
- export * from './generate_signed_upload_url.js';
8
- export * from './create_deployment.js';
9
4
  export * from './all_stores_by_org.js';
10
5
  export * from './convert_dev_to_test_store.js';
6
+ export * from './create_app.js';
7
+ export * from './create_deployment.js';
11
8
  export * from './extension_create.js';
12
9
  export * from './extension_specifications.js';
13
- export * from './all_app_extension_registrations.js';
14
- export * from './get_variant_id.js';
15
- export * from './functions/function_service_proxy.js';
16
- export * from './functions/get_app_functions.js';
17
- export * from './functions/module_upload_url_generate.js';
10
+ export * from './find_app.js';
11
+ export * from './find_org_basic.js';
12
+ export * from './find_org.js';
13
+ export * from './find_store_by_domain.js';
18
14
  export * from './functions/app_function_set.js';
19
15
  export * from './functions/compile_module.js';
16
+ export * from './functions/function_service_proxy.js';
17
+ export * from './functions/function_service_proxy.js';
18
+ export * from './functions/get_app_functions.js';
19
+ export * from './functions/get_app_functions.js';
20
20
  export * from './functions/module_compilation_status.js';
21
- export * from './find_org_basic.js';
22
- export * from './find_store_by_domain.js';
21
+ export * from './functions/upload_url_generate.js';
22
+ export * from './generate_signed_upload_url.js';
23
+ export * from './get_urls.js';
24
+ export * from './get_variant_id.js';
25
+ export * from './get_variant_id.js';
26
+ export * from './update_draft.js';
27
+ export * from './update_urls.js';
@@ -1,23 +1,28 @@
1
- export * from './find_org.js';
1
+ export * from './all_app_extension_registrations.js';
2
+ export * from './all_app_extension_registrations.js';
2
3
  export * from './all_orgs.js';
3
- export * from './create_app.js';
4
- export * from './update_urls.js';
5
- export * from './find_app.js';
6
- export * from './update_draft.js';
7
- export * from './generate_signed_upload_url.js';
8
- export * from './create_deployment.js';
9
4
  export * from './all_stores_by_org.js';
10
5
  export * from './convert_dev_to_test_store.js';
6
+ export * from './create_app.js';
7
+ export * from './create_deployment.js';
11
8
  export * from './extension_create.js';
12
9
  export * from './extension_specifications.js';
13
- export * from './all_app_extension_registrations.js';
14
- export * from './get_variant_id.js';
15
- export * from './functions/function_service_proxy.js';
16
- export * from './functions/get_app_functions.js';
17
- export * from './functions/module_upload_url_generate.js';
10
+ export * from './find_app.js';
11
+ export * from './find_org_basic.js';
12
+ export * from './find_org.js';
13
+ export * from './find_store_by_domain.js';
18
14
  export * from './functions/app_function_set.js';
19
15
  export * from './functions/compile_module.js';
16
+ export * from './functions/function_service_proxy.js';
17
+ export * from './functions/function_service_proxy.js';
18
+ export * from './functions/get_app_functions.js';
19
+ export * from './functions/get_app_functions.js';
20
20
  export * from './functions/module_compilation_status.js';
21
- export * from './find_org_basic.js';
22
- export * from './find_store_by_domain.js';
21
+ export * from './functions/upload_url_generate.js';
22
+ export * from './generate_signed_upload_url.js';
23
+ export * from './get_urls.js';
24
+ export * from './get_variant_id.js';
25
+ export * from './get_variant_id.js';
26
+ export * from './update_draft.js';
27
+ export * from './update_urls.js';
23
28
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/graphql/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,mBAAmB,CAAA;AACjC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,wBAAwB,CAAA;AACtC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,qBAAqB,CAAA;AACnC,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,2CAA2C,CAAA;AACzD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,0CAA0C,CAAA;AACxD,cAAc,qBAAqB,CAAA;AACnC,cAAc,2BAA2B,CAAA","sourcesContent":["export * from './find_org.js'\nexport * from './all_orgs.js'\nexport * from './create_app.js'\nexport * from './update_urls.js'\nexport * from './find_app.js'\nexport * from './update_draft.js'\nexport * from './generate_signed_upload_url.js'\nexport * from './create_deployment.js'\nexport * from './all_stores_by_org.js'\nexport * from './convert_dev_to_test_store.js'\nexport * from './extension_create.js'\nexport * from './extension_specifications.js'\nexport * from './all_app_extension_registrations.js'\nexport * from './get_variant_id.js'\nexport * from './functions/function_service_proxy.js'\nexport * from './functions/get_app_functions.js'\nexport * from './functions/module_upload_url_generate.js'\nexport * from './functions/app_function_set.js'\nexport * from './functions/compile_module.js'\nexport * from './functions/module_compilation_status.js'\nexport * from './find_org_basic.js'\nexport * from './find_store_by_domain.js'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/graphql/index.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAA;AACpD,cAAc,sCAAsC,CAAA;AACpD,cAAc,eAAe,CAAA;AAC7B,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,iBAAiB,CAAA;AAC/B,cAAc,wBAAwB,CAAA;AACtC,cAAc,uBAAuB,CAAA;AACrC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,eAAe,CAAA;AAC7B,cAAc,2BAA2B,CAAA;AACzC,cAAc,iCAAiC,CAAA;AAC/C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,uCAAuC,CAAA;AACrD,cAAc,uCAAuC,CAAA;AACrD,cAAc,kCAAkC,CAAA;AAChD,cAAc,kCAAkC,CAAA;AAChD,cAAc,0CAA0C,CAAA;AACxD,cAAc,oCAAoC,CAAA;AAClD,cAAc,iCAAiC,CAAA;AAC/C,cAAc,eAAe,CAAA;AAC7B,cAAc,qBAAqB,CAAA;AACnC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA","sourcesContent":["export * from './all_app_extension_registrations.js'\nexport * from './all_app_extension_registrations.js'\nexport * from './all_orgs.js'\nexport * from './all_stores_by_org.js'\nexport * from './convert_dev_to_test_store.js'\nexport * from './create_app.js'\nexport * from './create_deployment.js'\nexport * from './extension_create.js'\nexport * from './extension_specifications.js'\nexport * from './find_app.js'\nexport * from './find_org_basic.js'\nexport * from './find_org.js'\nexport * from './find_store_by_domain.js'\nexport * from './functions/app_function_set.js'\nexport * from './functions/compile_module.js'\nexport * from './functions/function_service_proxy.js'\nexport * from './functions/function_service_proxy.js'\nexport * from './functions/get_app_functions.js'\nexport * from './functions/get_app_functions.js'\nexport * from './functions/module_compilation_status.js'\nexport * from './functions/upload_url_generate.js'\nexport * from './generate_signed_upload_url.js'\nexport * from './get_urls.js'\nexport * from './get_variant_id.js'\nexport * from './get_variant_id.js'\nexport * from './update_draft.js'\nexport * from './update_urls.js'\n"]}
@@ -1,8 +1,8 @@
1
1
  export declare const UpdateURLsQuery: string;
2
2
  export interface UpdateURLsQueryVariables {
3
3
  apiKey: string;
4
- appUrl: string;
5
- redir: string[];
4
+ applicationUrl: string;
5
+ redirectUrlWhitelist: string[];
6
6
  }
7
7
  export interface UpdateURLsQuerySchema {
8
8
  appUpdate: {
@@ -1,7 +1,7 @@
1
1
  import { gql } from 'graphql-request';
2
2
  export const UpdateURLsQuery = gql `
3
- mutation appUpdate($apiKey: String!, $appUrl: Url!, $redir: [Url]!) {
4
- appUpdate(input: {apiKey: $apiKey, applicationUrl: $appUrl, redirectUrlWhitelist: $redir}) {
3
+ mutation appUpdate($apiKey: String!, $applicationUrl: Url!, $redirectUrlWhitelist: [Url]!) {
4
+ appUpdate(input: {apiKey: $apiKey, applicationUrl: $applicationUrl, redirectUrlWhitelist: $redirectUrlWhitelist}) {
5
5
  userErrors {
6
6
  message
7
7
  field
@@ -1 +1 @@
1
- {"version":3,"file":"update_urls.js","sourceRoot":"","sources":["../../../src/api/graphql/update_urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;CASjC,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const UpdateURLsQuery = gql`\n mutation appUpdate($apiKey: String!, $appUrl: Url!, $redir: [Url]!) {\n appUpdate(input: {apiKey: $apiKey, applicationUrl: $appUrl, redirectUrlWhitelist: $redir}) {\n userErrors {\n message\n field\n }\n }\n }\n`\n\nexport interface UpdateURLsQueryVariables {\n apiKey: string\n appUrl: string\n redir: string[]\n}\n\nexport interface UpdateURLsQuerySchema {\n appUpdate: {\n userErrors: {\n field: string[]\n message: string\n }[]\n }\n}\n"]}
1
+ {"version":3,"file":"update_urls.js","sourceRoot":"","sources":["../../../src/api/graphql/update_urls.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,iBAAiB,CAAA;AAEnC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAA;;;;;;;;;CASjC,CAAA","sourcesContent":["import {gql} from 'graphql-request'\n\nexport const UpdateURLsQuery = gql`\n mutation appUpdate($apiKey: String!, $applicationUrl: Url!, $redirectUrlWhitelist: [Url]!) {\n appUpdate(input: {apiKey: $apiKey, applicationUrl: $applicationUrl, redirectUrlWhitelist: $redirectUrlWhitelist}) {\n userErrors {\n message\n field\n }\n }\n }\n`\n\nexport interface UpdateURLsQueryVariables {\n apiKey: string\n applicationUrl: string\n redirectUrlWhitelist: string[]\n}\n\nexport interface UpdateURLsQuerySchema {\n appUpdate: {\n userErrors: {\n field: string[]\n message: string\n }[]\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  declare const constants: {
2
2
  environmentVariables: {
3
3
  unitTest: string;
4
- shopifyConfig: string;
4
+ env: string;
5
5
  runAsUser: string;
6
6
  partnersEnv: string;
7
7
  shopifyEnv: string;
@@ -14,7 +14,9 @@ declare const constants: {
14
14
  partnersToken: string;
15
15
  verbose: string;
16
16
  noAnalytics: string;
17
+ alwaysLogAnalytics: string;
17
18
  firstPartyDev: string;
19
+ debugGoBinary: string;
18
20
  };
19
21
  paths: {
20
22
  executables: {
package/dist/constants.js CHANGED
@@ -10,7 +10,7 @@ const cacheFolder = () => {
10
10
  const constants = {
11
11
  environmentVariables: {
12
12
  unitTest: 'SHOPIFY_UNIT_TEST',
13
- shopifyConfig: 'SHOPIFY_CONFIG',
13
+ env: 'SHOPIFY_ENV',
14
14
  runAsUser: 'SHOPIFY_RUN_AS_USER',
15
15
  partnersEnv: 'SHOPIFY_PARTNERS_ENV',
16
16
  shopifyEnv: 'SHOPIFY_SHOPIFY_ENV',
@@ -23,7 +23,9 @@ const constants = {
23
23
  partnersToken: 'SHOPIFY_CLI_PARTNERS_TOKEN',
24
24
  verbose: 'SHOPIFY_FLAG_VERBOSE',
25
25
  noAnalytics: 'SHOPIFY_CLI_NO_ANALYTICS',
26
+ alwaysLogAnalytics: 'SHOPIFY_CLI_ALWAYS_LOG_ANALYTICS',
26
27
  firstPartyDev: 'SHOPIFY_CLI_1P_DEV',
28
+ debugGoBinary: 'SHOPIFY_DEBUG_GO_BINARY',
27
29
  },
28
30
  paths: {
29
31
  executables: {