Skip to content

Commit a59fc98

Browse files
Merge pull request #6679 from Shopify/12-02-move_command_from_shopify_app_execute_to_shopify_app_bulk_execute_
Move command from `shopify app execute` to `shopify app bulk execute`
2 parents 502e0ae + 942df86 commit a59fc98

File tree

3 files changed

+145
-145
lines changed

3 files changed

+145
-145
lines changed

packages/app/src/cli/commands/app/execute.ts renamed to packages/app/src/cli/commands/app/bulk/execute.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import {appFlags, bulkOperationFlags} from '../../flags.js'
2-
import AppLinkedCommand, {AppLinkedCommandOutput} from '../../utilities/app-linked-command.js'
3-
import {linkedAppContext} from '../../services/app-context.js'
4-
import {storeContext} from '../../services/store-context.js'
5-
import {executeBulkOperation} from '../../services/bulk-operations/execute-bulk-operation.js'
1+
import {appFlags, bulkOperationFlags} from '../../../flags.js'
2+
import AppLinkedCommand, {AppLinkedCommandOutput} from '../../../utilities/app-linked-command.js'
3+
import {linkedAppContext} from '../../../services/app-context.js'
4+
import {storeContext} from '../../../services/store-context.js'
5+
import {executeBulkOperation} from '../../../services/bulk-operations/execute-bulk-operation.js'
66
import {globalFlags} from '@shopify/cli-kit/node/cli'
77
import {readStdinString} from '@shopify/cli-kit/node/system'
88
import {AbortError} from '@shopify/cli-kit/node/error'
99

10-
export default class Execute extends AppLinkedCommand {
10+
export default class BulkExecute extends AppLinkedCommand {
1111
static summary = 'Execute bulk operations.'
1212

1313
static description = 'Execute bulk operations against the Shopify Admin API.'
@@ -21,13 +21,13 @@ export default class Execute extends AppLinkedCommand {
2121
}
2222

2323
async run(): Promise<AppLinkedCommandOutput> {
24-
const {flags} = await this.parse(Execute)
24+
const {flags} = await this.parse(BulkExecute)
2525

2626
const query = flags.query ?? (await readStdinString())
2727
if (!query) {
2828
throw new AbortError(
2929
'No query provided. Use the --query flag or pipe input via stdin.',
30-
'Example: echo "query { ... }" | shopify app execute',
30+
'Example: echo "query { ... }" | shopify app bulk execute',
3131
)
3232
}
3333

packages/app/src/cli/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Logs from './commands/app/logs.js'
1010
import Sources from './commands/app/app-logs/sources.js'
1111
import EnvPull from './commands/app/env/pull.js'
1212
import EnvShow from './commands/app/env/show.js'
13-
import Execute from './commands/app/execute.js'
13+
import Execute from './commands/app/bulk/execute.js'
1414
import FunctionBuild from './commands/app/function/build.js'
1515
import FunctionReplay from './commands/app/function/replay.js'
1616
import FunctionRun from './commands/app/function/run.js'
@@ -53,7 +53,7 @@ export const commands: {[key: string]: typeof AppLinkedCommand | typeof AppUnlin
5353
'app:config:pull': ConfigPull,
5454
'app:env:pull': EnvPull,
5555
'app:env:show': EnvShow,
56-
'app:execute': Execute,
56+
'app:bulk:execute': Execute,
5757
'app:generate:schema': GenerateSchema,
5858
'app:function:build': FunctionBuild,
5959
'app:function:replay': FunctionReplay,

packages/cli/oclif.manifest.json

Lines changed: 135 additions & 135 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,141 @@
8686
"strict": true,
8787
"summary": "Build the app, including extensions."
8888
},
89+
"app:bulk:execute": {
90+
"aliases": [
91+
],
92+
"args": {
93+
},
94+
"customPluginName": "@shopify/app",
95+
"description": "Execute bulk operations against the Shopify Admin API.",
96+
"flags": {
97+
"client-id": {
98+
"description": "The Client ID of your app.",
99+
"env": "SHOPIFY_FLAG_CLIENT_ID",
100+
"exclusive": [
101+
"config"
102+
],
103+
"hasDynamicHelp": false,
104+
"hidden": false,
105+
"multiple": false,
106+
"name": "client-id",
107+
"type": "option"
108+
},
109+
"config": {
110+
"char": "c",
111+
"description": "The name of the app configuration.",
112+
"env": "SHOPIFY_FLAG_APP_CONFIG",
113+
"hasDynamicHelp": false,
114+
"hidden": false,
115+
"multiple": false,
116+
"name": "config",
117+
"type": "option"
118+
},
119+
"no-color": {
120+
"allowNo": false,
121+
"description": "Disable color output.",
122+
"env": "SHOPIFY_FLAG_NO_COLOR",
123+
"hidden": false,
124+
"name": "no-color",
125+
"type": "boolean"
126+
},
127+
"output-file": {
128+
"description": "The file path where results should be written. If not specified, results will be written to STDOUT.",
129+
"env": "SHOPIFY_FLAG_OUTPUT_FILE",
130+
"hasDynamicHelp": false,
131+
"multiple": false,
132+
"name": "output-file",
133+
"type": "option"
134+
},
135+
"path": {
136+
"description": "The path to your app directory.",
137+
"env": "SHOPIFY_FLAG_PATH",
138+
"hasDynamicHelp": false,
139+
"multiple": false,
140+
"name": "path",
141+
"noCacheDefault": true,
142+
"type": "option"
143+
},
144+
"query": {
145+
"char": "q",
146+
"description": "The GraphQL query or mutation to run as a bulk operation. If omitted, reads from standard input.",
147+
"env": "SHOPIFY_FLAG_QUERY",
148+
"hasDynamicHelp": false,
149+
"multiple": false,
150+
"name": "query",
151+
"required": false,
152+
"type": "option"
153+
},
154+
"reset": {
155+
"allowNo": false,
156+
"description": "Reset all your settings.",
157+
"env": "SHOPIFY_FLAG_RESET",
158+
"exclusive": [
159+
"config"
160+
],
161+
"hidden": false,
162+
"name": "reset",
163+
"type": "boolean"
164+
},
165+
"store": {
166+
"char": "s",
167+
"description": "The store domain. Must be an existing dev store.",
168+
"env": "SHOPIFY_FLAG_STORE",
169+
"hasDynamicHelp": false,
170+
"multiple": false,
171+
"name": "store",
172+
"type": "option"
173+
},
174+
"variable-file": {
175+
"description": "Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",
176+
"env": "SHOPIFY_FLAG_VARIABLE_FILE",
177+
"exclusive": [
178+
"variables"
179+
],
180+
"hasDynamicHelp": false,
181+
"multiple": false,
182+
"name": "variable-file",
183+
"type": "option"
184+
},
185+
"variables": {
186+
"char": "v",
187+
"description": "The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",
188+
"env": "SHOPIFY_FLAG_VARIABLES",
189+
"exclusive": [
190+
"variable-file"
191+
],
192+
"hasDynamicHelp": false,
193+
"multiple": true,
194+
"name": "variables",
195+
"type": "option"
196+
},
197+
"verbose": {
198+
"allowNo": false,
199+
"description": "Increase the verbosity of the output.",
200+
"env": "SHOPIFY_FLAG_VERBOSE",
201+
"hidden": false,
202+
"name": "verbose",
203+
"type": "boolean"
204+
},
205+
"watch": {
206+
"allowNo": false,
207+
"description": "Wait for bulk operation results before exiting.",
208+
"env": "SHOPIFY_FLAG_WATCH",
209+
"name": "watch",
210+
"type": "boolean"
211+
}
212+
},
213+
"hasDynamicHelp": false,
214+
"hidden": true,
215+
"hiddenAliases": [
216+
],
217+
"id": "app:bulk:execute",
218+
"pluginAlias": "@shopify/cli",
219+
"pluginName": "@shopify/cli",
220+
"pluginType": "core",
221+
"strict": true,
222+
"summary": "Execute bulk operations."
223+
},
89224
"app:bulk:status": {
90225
"aliases": [
91226
],
@@ -981,141 +1116,6 @@
9811116
"strict": true,
9821117
"summary": "Display app and extensions environment variables."
9831118
},
984-
"app:execute": {
985-
"aliases": [
986-
],
987-
"args": {
988-
},
989-
"customPluginName": "@shopify/app",
990-
"description": "Execute bulk operations against the Shopify Admin API.",
991-
"flags": {
992-
"client-id": {
993-
"description": "The Client ID of your app.",
994-
"env": "SHOPIFY_FLAG_CLIENT_ID",
995-
"exclusive": [
996-
"config"
997-
],
998-
"hasDynamicHelp": false,
999-
"hidden": false,
1000-
"multiple": false,
1001-
"name": "client-id",
1002-
"type": "option"
1003-
},
1004-
"config": {
1005-
"char": "c",
1006-
"description": "The name of the app configuration.",
1007-
"env": "SHOPIFY_FLAG_APP_CONFIG",
1008-
"hasDynamicHelp": false,
1009-
"hidden": false,
1010-
"multiple": false,
1011-
"name": "config",
1012-
"type": "option"
1013-
},
1014-
"no-color": {
1015-
"allowNo": false,
1016-
"description": "Disable color output.",
1017-
"env": "SHOPIFY_FLAG_NO_COLOR",
1018-
"hidden": false,
1019-
"name": "no-color",
1020-
"type": "boolean"
1021-
},
1022-
"output-file": {
1023-
"description": "The file path where results should be written. If not specified, results will be written to STDOUT.",
1024-
"env": "SHOPIFY_FLAG_OUTPUT_FILE",
1025-
"hasDynamicHelp": false,
1026-
"multiple": false,
1027-
"name": "output-file",
1028-
"type": "option"
1029-
},
1030-
"path": {
1031-
"description": "The path to your app directory.",
1032-
"env": "SHOPIFY_FLAG_PATH",
1033-
"hasDynamicHelp": false,
1034-
"multiple": false,
1035-
"name": "path",
1036-
"noCacheDefault": true,
1037-
"type": "option"
1038-
},
1039-
"query": {
1040-
"char": "q",
1041-
"description": "The GraphQL query or mutation to run as a bulk operation. If omitted, reads from standard input.",
1042-
"env": "SHOPIFY_FLAG_QUERY",
1043-
"hasDynamicHelp": false,
1044-
"multiple": false,
1045-
"name": "query",
1046-
"required": false,
1047-
"type": "option"
1048-
},
1049-
"reset": {
1050-
"allowNo": false,
1051-
"description": "Reset all your settings.",
1052-
"env": "SHOPIFY_FLAG_RESET",
1053-
"exclusive": [
1054-
"config"
1055-
],
1056-
"hidden": false,
1057-
"name": "reset",
1058-
"type": "boolean"
1059-
},
1060-
"store": {
1061-
"char": "s",
1062-
"description": "The store domain. Must be an existing dev store.",
1063-
"env": "SHOPIFY_FLAG_STORE",
1064-
"hasDynamicHelp": false,
1065-
"multiple": false,
1066-
"name": "store",
1067-
"type": "option"
1068-
},
1069-
"variable-file": {
1070-
"description": "Path to a file containing GraphQL variables in JSONL format (one JSON object per line). Can't be used with --variables.",
1071-
"env": "SHOPIFY_FLAG_VARIABLE_FILE",
1072-
"exclusive": [
1073-
"variables"
1074-
],
1075-
"hasDynamicHelp": false,
1076-
"multiple": false,
1077-
"name": "variable-file",
1078-
"type": "option"
1079-
},
1080-
"variables": {
1081-
"char": "v",
1082-
"description": "The values for any GraphQL variables in your mutation, in JSON format. Can be specified multiple times.",
1083-
"env": "SHOPIFY_FLAG_VARIABLES",
1084-
"exclusive": [
1085-
"variable-file"
1086-
],
1087-
"hasDynamicHelp": false,
1088-
"multiple": true,
1089-
"name": "variables",
1090-
"type": "option"
1091-
},
1092-
"verbose": {
1093-
"allowNo": false,
1094-
"description": "Increase the verbosity of the output.",
1095-
"env": "SHOPIFY_FLAG_VERBOSE",
1096-
"hidden": false,
1097-
"name": "verbose",
1098-
"type": "boolean"
1099-
},
1100-
"watch": {
1101-
"allowNo": false,
1102-
"description": "Wait for bulk operation results before exiting.",
1103-
"env": "SHOPIFY_FLAG_WATCH",
1104-
"name": "watch",
1105-
"type": "boolean"
1106-
}
1107-
},
1108-
"hasDynamicHelp": false,
1109-
"hidden": true,
1110-
"hiddenAliases": [
1111-
],
1112-
"id": "app:execute",
1113-
"pluginAlias": "@shopify/cli",
1114-
"pluginName": "@shopify/cli",
1115-
"pluginType": "core",
1116-
"strict": true,
1117-
"summary": "Execute bulk operations."
1118-
},
11191119
"app:function:build": {
11201120
"aliases": [
11211121
],

0 commit comments

Comments
 (0)