Skip to content

Commit b4bdf68

Browse files
Merge pull request #6811 from Shopify/jtv/add-bulk-cancel-command
Release `app bulk cancel` command
2 parents 8d5263d + 9d9884c commit b4bdf68

File tree

10 files changed

+223
-5
lines changed

10 files changed

+223
-5
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// This is an autogenerated file. Don't edit this file manually.
2+
import {ReferenceEntityTemplateSchema} from '@shopify/generate-docs'
3+
4+
const data: ReferenceEntityTemplateSchema = {
5+
name: 'app bulk cancel',
6+
description: `Cancels a running bulk operation by ID.`,
7+
overviewPreviewDescription: `Cancel a bulk operation.`,
8+
type: 'command',
9+
isVisualComponent: false,
10+
defaultExample: {
11+
codeblock: {
12+
tabs: [
13+
{
14+
title: 'app bulk cancel',
15+
code: './examples/app-bulk-cancel.example.sh',
16+
language: 'bash',
17+
},
18+
],
19+
title: 'app bulk cancel',
20+
},
21+
},
22+
definitions: [
23+
{
24+
title: 'Flags',
25+
description: 'The following flags are available for the `app bulk cancel` command:',
26+
type: 'appbulkcancel',
27+
},
28+
],
29+
category: 'app',
30+
related: [
31+
],
32+
}
33+
34+
export default data
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shopify app bulk cancel [flags]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// This is an autogenerated file. Don't edit this file manually.
2+
export interface appbulkcancel {
3+
/**
4+
* The Client ID of your app.
5+
* @environment SHOPIFY_FLAG_CLIENT_ID
6+
*/
7+
'--client-id <value>'?: string
8+
9+
/**
10+
* The name of the app configuration.
11+
* @environment SHOPIFY_FLAG_APP_CONFIG
12+
*/
13+
'-c, --config <value>'?: string
14+
15+
/**
16+
* The bulk operation ID to cancel (numeric ID or full GID).
17+
* @environment SHOPIFY_FLAG_ID
18+
*/
19+
'--id <value>': string
20+
21+
/**
22+
* Disable color output.
23+
* @environment SHOPIFY_FLAG_NO_COLOR
24+
*/
25+
'--no-color'?: ''
26+
27+
/**
28+
* The path to your app directory.
29+
* @environment SHOPIFY_FLAG_PATH
30+
*/
31+
'--path <value>'?: string
32+
33+
/**
34+
* Reset all your settings.
35+
* @environment SHOPIFY_FLAG_RESET
36+
*/
37+
'--reset'?: ''
38+
39+
/**
40+
* The store domain. Must be an existing dev store.
41+
* @environment SHOPIFY_FLAG_STORE
42+
*/
43+
'-s, --store <value>'?: string
44+
45+
/**
46+
* Increase the verbosity of the output.
47+
* @environment SHOPIFY_FLAG_VERBOSE
48+
*/
49+
'--verbose'?: ''
50+
}

docs-shopify.dev/generated/generated_docs_data.json

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,115 @@
100100
"category": "app",
101101
"related": []
102102
},
103+
{
104+
"name": "app bulk cancel",
105+
"description": "Cancels a running bulk operation by ID.",
106+
"overviewPreviewDescription": "Cancel a bulk operation.",
107+
"type": "command",
108+
"isVisualComponent": false,
109+
"defaultExample": {
110+
"codeblock": {
111+
"tabs": [
112+
{
113+
"title": "app bulk cancel",
114+
"code": "shopify app bulk cancel [flags]",
115+
"language": "bash"
116+
}
117+
],
118+
"title": "app bulk cancel"
119+
}
120+
},
121+
"definitions": [
122+
{
123+
"title": "Flags",
124+
"description": "The following flags are available for the `app bulk cancel` command:",
125+
"type": "appbulkcancel",
126+
"typeDefinitions": {
127+
"appbulkcancel": {
128+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
129+
"name": "appbulkcancel",
130+
"description": "",
131+
"members": [
132+
{
133+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
134+
"syntaxKind": "PropertySignature",
135+
"name": "--client-id <value>",
136+
"value": "string",
137+
"description": "The Client ID of your app.",
138+
"isOptional": true,
139+
"environmentValue": "SHOPIFY_FLAG_CLIENT_ID"
140+
},
141+
{
142+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
143+
"syntaxKind": "PropertySignature",
144+
"name": "--id <value>",
145+
"value": "string",
146+
"description": "The bulk operation ID to cancel (numeric ID or full GID).",
147+
"environmentValue": "SHOPIFY_FLAG_ID"
148+
},
149+
{
150+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
151+
"syntaxKind": "PropertySignature",
152+
"name": "--no-color",
153+
"value": "\"\"",
154+
"description": "Disable color output.",
155+
"isOptional": true,
156+
"environmentValue": "SHOPIFY_FLAG_NO_COLOR"
157+
},
158+
{
159+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
160+
"syntaxKind": "PropertySignature",
161+
"name": "--path <value>",
162+
"value": "string",
163+
"description": "The path to your app directory.",
164+
"isOptional": true,
165+
"environmentValue": "SHOPIFY_FLAG_PATH"
166+
},
167+
{
168+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
169+
"syntaxKind": "PropertySignature",
170+
"name": "--reset",
171+
"value": "\"\"",
172+
"description": "Reset all your settings.",
173+
"isOptional": true,
174+
"environmentValue": "SHOPIFY_FLAG_RESET"
175+
},
176+
{
177+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
178+
"syntaxKind": "PropertySignature",
179+
"name": "--verbose",
180+
"value": "\"\"",
181+
"description": "Increase the verbosity of the output.",
182+
"isOptional": true,
183+
"environmentValue": "SHOPIFY_FLAG_VERBOSE"
184+
},
185+
{
186+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
187+
"syntaxKind": "PropertySignature",
188+
"name": "-c, --config <value>",
189+
"value": "string",
190+
"description": "The name of the app configuration.",
191+
"isOptional": true,
192+
"environmentValue": "SHOPIFY_FLAG_APP_CONFIG"
193+
},
194+
{
195+
"filePath": "docs-shopify.dev/commands/interfaces/app-bulk-cancel.interface.ts",
196+
"syntaxKind": "PropertySignature",
197+
"name": "-s, --store <value>",
198+
"value": "string",
199+
"description": "The store domain. Must be an existing dev store.",
200+
"isOptional": true,
201+
"environmentValue": "SHOPIFY_FLAG_STORE"
202+
}
203+
],
204+
"value": "export interface appbulkcancel {\n /**\n * The Client ID of your app.\n * @environment SHOPIFY_FLAG_CLIENT_ID\n */\n '--client-id <value>'?: string\n\n /**\n * The name of the app configuration.\n * @environment SHOPIFY_FLAG_APP_CONFIG\n */\n '-c, --config <value>'?: string\n\n /**\n * The bulk operation ID to cancel (numeric ID or full GID).\n * @environment SHOPIFY_FLAG_ID\n */\n '--id <value>': string\n\n /**\n * Disable color output.\n * @environment SHOPIFY_FLAG_NO_COLOR\n */\n '--no-color'?: ''\n\n /**\n * The path to your app directory.\n * @environment SHOPIFY_FLAG_PATH\n */\n '--path <value>'?: string\n\n /**\n * Reset all your settings.\n * @environment SHOPIFY_FLAG_RESET\n */\n '--reset'?: ''\n\n /**\n * The store domain. Must be an existing dev store.\n * @environment SHOPIFY_FLAG_STORE\n */\n '-s, --store <value>'?: string\n\n /**\n * Increase the verbosity of the output.\n * @environment SHOPIFY_FLAG_VERBOSE\n */\n '--verbose'?: ''\n}"
205+
}
206+
}
207+
}
208+
],
209+
"category": "app",
210+
"related": []
211+
},
103212
{
104213
"name": "app bulk execute",
105214
"description": "Executes an Admin API GraphQL query or mutation on the specified store, as a bulk operation. Mutations are only allowed on dev stores.\n\n Bulk operations allow you to process large amounts of data asynchronously. Learn more about [bulk query operations](/docs/api/usage/bulk-operations/queries) and [bulk mutation operations](/docs/api/usage/bulk-operations/imports).\n\n Use [`bulk status`](/docs/api/shopify-cli/app/app-bulk-status) to check the status of your bulk operations.",

packages/app/src/cli/commands/app/bulk/cancel.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ export default class BulkCancel extends AppLinkedCommand {
1212

1313
static description = 'Cancels a running bulk operation by ID.'
1414

15-
static hidden = true
16-
1715
static flags = {
1816
...globalFlags,
1917
...appFlags,

packages/app/src/cli/services/bulk-operations/cancel-bulk-operation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ describe('cancelBulkOperation', () => {
140140
await cancelBulkOperation({organization: mockOrganization, storeFqdn, operationId, remoteApp: mockRemoteApp})
141141

142142
expect(renderError).toHaveBeenCalledWith({
143-
headline: 'Bulk operation cancellation errors.',
143+
headline: 'Failed to cancel bulk operation.',
144144
body: 'id: Operation not found',
145145
})
146146
})

packages/app/src/cli/services/bulk-operations/cancel-bulk-operation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export async function cancelBulkOperation(options: CancelBulkOperationOptions):
4343
})
4444

4545
if (response.bulkOperationCancel?.userErrors?.length) {
46-
renderBulkOperationUserErrors(response.bulkOperationCancel.userErrors, 'Bulk operation cancellation errors.')
46+
renderBulkOperationUserErrors(response.bulkOperationCancel.userErrors, 'Failed to cancel bulk operation.')
4747
return
4848
}
4949

packages/cli/README.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Commands
22
<!-- commands -->
33
* [`shopify app build`](#shopify-app-build)
4+
* [`shopify app bulk cancel`](#shopify-app-bulk-cancel)
45
* [`shopify app bulk execute`](#shopify-app-bulk-execute)
56
* [`shopify app bulk status`](#shopify-app-bulk-status)
67
* [`shopify app config link`](#shopify-app-config-link)
@@ -121,6 +122,31 @@ DESCRIPTION
121122
extension to ensure that it's valid.
122123
```
123124

125+
## `shopify app bulk cancel`
126+
127+
Cancel a bulk operation.
128+
129+
```
130+
USAGE
131+
$ shopify app bulk cancel --id <value> [--client-id <value> | -c <value>] [--no-color] [--path <value>] [--reset |
132+
] [-s <value>] [--verbose]
133+
134+
FLAGS
135+
-c, --config=<value> The name of the app configuration.
136+
-s, --store=<value> The store domain. Must be an existing dev store.
137+
--client-id=<value> The Client ID of your app.
138+
--id=<value> (required) The bulk operation ID to cancel (numeric ID or full GID).
139+
--no-color Disable color output.
140+
--path=<value> The path to your app directory.
141+
--reset Reset all your settings.
142+
--verbose Increase the verbosity of the output.
143+
144+
DESCRIPTION
145+
Cancel a bulk operation.
146+
147+
Cancels a running bulk operation by ID.
148+
```
149+
124150
## `shopify app bulk execute`
125151

126152
Execute bulk operations.

packages/cli/oclif.manifest.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@
172172
}
173173
},
174174
"hasDynamicHelp": false,
175-
"hidden": true,
176175
"hiddenAliases": [
177176
],
178177
"id": "app:bulk:cancel",

packages/features/snapshots/commands.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
├─ app
22
│ ├─ build
33
│ ├─ bulk
4+
│ │ ├─ cancel
45
│ │ ├─ execute
56
│ │ └─ status
67
│ ├─ config

0 commit comments

Comments
 (0)