@sanity/workflow-cli 0.8.1 → 0.10.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.
- package/CHANGELOG.md +485 -0
- package/README.md +145 -63
- package/bin/run.js +0 -4
- package/dist/commands/abort.d.ts +8 -12
- package/dist/commands/abort.js +24 -34
- package/dist/commands/definition/delete.d.ts +6 -6
- package/dist/commands/definition/delete.js +17 -33
- package/dist/commands/definition/diff.d.ts +10 -3
- package/dist/commands/definition/diff.js +21 -29
- package/dist/commands/definition/list.d.ts +5 -6
- package/dist/commands/definition/list.js +44 -50
- package/dist/commands/definition/show.d.ts +22 -13
- package/dist/commands/definition/show.js +25 -36
- package/dist/commands/deploy.d.ts +67 -8
- package/dist/commands/deploy.js +136 -32
- package/dist/commands/diagnose.d.ts +22 -4
- package/dist/commands/diagnose.js +45 -61
- package/dist/commands/fire-action.d.ts +7 -30
- package/dist/commands/fire-action.js +42 -115
- package/dist/commands/list.d.ts +9 -10
- package/dist/commands/list.js +49 -62
- package/dist/commands/{retry-activity.d.ts → reset-activity.d.ts} +1 -1
- package/dist/commands/{retry-activity.js → reset-activity.js} +2 -3
- package/dist/commands/set-stage.d.ts +27 -3
- package/dist/commands/set-stage.js +63 -12
- package/dist/commands/show.d.ts +3 -2
- package/dist/commands/show.js +15 -21
- package/dist/commands/start.d.ts +56 -0
- package/dist/commands/start.js +133 -0
- package/dist/commands/tail.d.ts +5 -2
- package/dist/commands/tail.js +25 -26
- package/dist/hooks/finally/telemetry.d.ts +8 -0
- package/dist/hooks/finally/telemetry.js +13 -0
- package/dist/hooks/prerun/telemetry.d.ts +5 -0
- package/dist/hooks/prerun/telemetry.js +5 -0
- package/dist/index.js +0 -3
- package/dist/lib/base-command.d.ts +14 -0
- package/dist/lib/base-command.js +10 -0
- package/dist/lib/client.d.ts +11 -14
- package/dist/lib/client.js +29 -34
- package/dist/lib/context.d.ts +98 -0
- package/dist/lib/context.js +83 -0
- package/dist/lib/definitions.d.ts +38 -29
- package/dist/lib/definitions.js +34 -93
- package/dist/lib/diff.d.ts +5 -2
- package/dist/lib/diff.js +62 -20
- package/dist/lib/env.d.ts +4 -6
- package/dist/lib/env.js +4 -9
- package/dist/lib/fail.d.ts +12 -0
- package/dist/lib/fail.js +25 -16
- package/dist/lib/flags.d.ts +7 -2
- package/dist/lib/flags.js +7 -3
- package/dist/lib/load-config.d.ts +15 -0
- package/dist/lib/load-config.js +89 -0
- package/dist/lib/operation-args.d.ts +20 -15
- package/dist/lib/operation-args.js +9 -40
- package/dist/lib/ops-report.d.ts +29 -13
- package/dist/lib/ops-report.js +20 -17
- package/dist/lib/params.d.ts +7 -0
- package/dist/lib/params.js +18 -0
- package/dist/lib/read-fanout.d.ts +22 -0
- package/dist/lib/read-fanout.js +28 -0
- package/dist/lib/select-deployment.d.ts +31 -0
- package/dist/lib/select-deployment.js +37 -0
- package/dist/lib/share-definitions.d.ts +86 -0
- package/dist/lib/share-definitions.js +106 -0
- package/dist/lib/stub.js +0 -7
- package/dist/lib/telemetry-setup.d.ts +66 -0
- package/dist/lib/telemetry-setup.js +92 -0
- package/dist/lib/telemetry.d.ts +100 -0
- package/dist/lib/telemetry.js +89 -0
- package/dist/lib/ui.d.ts +33 -1
- package/dist/lib/ui.js +32 -21
- package/oclif.manifest.json +133 -113
- package/package.json +16 -8
- package/dist/commands/move-stage.d.ts +0 -52
- package/dist/commands/move-stage.js +0 -86
- package/dist/lib/config.d.ts +0 -18
- package/dist/lib/config.js +0 -50
package/oclif.manifest.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
],
|
|
17
17
|
"flags": {
|
|
18
18
|
"tag": {
|
|
19
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
19
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
20
20
|
"name": "tag",
|
|
21
21
|
"hasDynamicHelp": false,
|
|
22
22
|
"multiple": false,
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"pluginName": "@sanity/workflow-cli",
|
|
38
38
|
"pluginType": "core",
|
|
39
39
|
"strict": true,
|
|
40
|
-
"enableJsonFlag": false,
|
|
41
40
|
"isESM": true,
|
|
42
41
|
"relativePath": [
|
|
43
42
|
"dist",
|
|
@@ -48,21 +47,31 @@
|
|
|
48
47
|
"deploy": {
|
|
49
48
|
"aliases": [],
|
|
50
49
|
"args": {},
|
|
51
|
-
"description": "Validate, diff, and deploy workflow definitions to the
|
|
50
|
+
"description": "Validate, diff, and deploy workflow definitions to the resource bound by the selected deployment.",
|
|
52
51
|
"examples": [
|
|
53
|
-
"<%= config.bin %> deploy",
|
|
52
|
+
"<%= config.bin %> deploy --tag prod",
|
|
53
|
+
"<%= config.bin %> deploy --all-tags",
|
|
54
54
|
"<%= config.bin %> deploy --check",
|
|
55
55
|
"<%= config.bin %> deploy --dry-run",
|
|
56
56
|
"<%= config.bin %> deploy --only productLaunch"
|
|
57
57
|
],
|
|
58
58
|
"flags": {
|
|
59
59
|
"tag": {
|
|
60
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
60
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
61
61
|
"name": "tag",
|
|
62
62
|
"hasDynamicHelp": false,
|
|
63
63
|
"multiple": false,
|
|
64
64
|
"type": "option"
|
|
65
65
|
},
|
|
66
|
+
"all-tags": {
|
|
67
|
+
"description": "Deploy every deployment in the config, not just one tag.",
|
|
68
|
+
"exclusive": [
|
|
69
|
+
"tag"
|
|
70
|
+
],
|
|
71
|
+
"name": "all-tags",
|
|
72
|
+
"allowNo": false,
|
|
73
|
+
"type": "boolean"
|
|
74
|
+
},
|
|
66
75
|
"dry-run": {
|
|
67
76
|
"description": "Validate + diff against the deployed version; do not write.",
|
|
68
77
|
"name": "dry-run",
|
|
@@ -76,11 +85,17 @@
|
|
|
76
85
|
"type": "boolean"
|
|
77
86
|
},
|
|
78
87
|
"only": {
|
|
79
|
-
"description": "Limit deploy/check/diff to a single workflow definition by name.",
|
|
88
|
+
"description": "Limit deploy/check/diff to a single workflow definition by name. Every targeted deployment must contain it.",
|
|
80
89
|
"name": "only",
|
|
81
90
|
"hasDynamicHelp": false,
|
|
82
91
|
"multiple": false,
|
|
83
92
|
"type": "option"
|
|
93
|
+
},
|
|
94
|
+
"share-definitions-with-sanity": {
|
|
95
|
+
"description": "Share the definition documents newly created by this deploy with Sanity — the full document, verbatim (structure, names, filters, effect configuration, seeded values), plus its deployment coordinates (project and dataset, or resource id); never content documents, instances, or your Sanity auth token. Opt-in for this invocation only; the CLI never prompts. Independent of telemetry consent.",
|
|
96
|
+
"name": "share-definitions-with-sanity",
|
|
97
|
+
"allowNo": false,
|
|
98
|
+
"type": "boolean"
|
|
84
99
|
}
|
|
85
100
|
},
|
|
86
101
|
"hasDynamicHelp": false,
|
|
@@ -90,7 +105,6 @@
|
|
|
90
105
|
"pluginName": "@sanity/workflow-cli",
|
|
91
106
|
"pluginType": "core",
|
|
92
107
|
"strict": true,
|
|
93
|
-
"enableJsonFlag": false,
|
|
94
108
|
"isESM": true,
|
|
95
109
|
"relativePath": [
|
|
96
110
|
"dist",
|
|
@@ -115,14 +129,14 @@
|
|
|
115
129
|
],
|
|
116
130
|
"flags": {
|
|
117
131
|
"tag": {
|
|
118
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
132
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
119
133
|
"name": "tag",
|
|
120
134
|
"hasDynamicHelp": false,
|
|
121
135
|
"multiple": false,
|
|
122
136
|
"type": "option"
|
|
123
137
|
},
|
|
124
138
|
"json": {
|
|
125
|
-
"description": "Emit
|
|
139
|
+
"description": "Emit structured JSON instead of rendered output.",
|
|
126
140
|
"name": "json",
|
|
127
141
|
"allowNo": false,
|
|
128
142
|
"type": "boolean"
|
|
@@ -135,7 +149,6 @@
|
|
|
135
149
|
"pluginName": "@sanity/workflow-cli",
|
|
136
150
|
"pluginType": "core",
|
|
137
151
|
"strict": true,
|
|
138
|
-
"enableJsonFlag": false,
|
|
139
152
|
"isESM": true,
|
|
140
153
|
"relativePath": [
|
|
141
154
|
"dist",
|
|
@@ -152,16 +165,15 @@
|
|
|
152
165
|
"required": true
|
|
153
166
|
}
|
|
154
167
|
},
|
|
155
|
-
"description": "Fire an action on an instance
|
|
168
|
+
"description": "Fire an action on an instance to unstick a waiting activity — the write acts as the configured token. Omit --action to list what can be fired.",
|
|
156
169
|
"examples": [
|
|
157
170
|
"<%= config.bin %> fire-action wf-instance.abc123",
|
|
158
171
|
"<%= config.bin %> fire-action wf-instance.abc123 --activity approve --action approve",
|
|
159
|
-
"<%= config.bin %> fire-action wf-instance.abc123 --activity approve --action approve --as user.xyz --as-role editor",
|
|
160
172
|
"<%= config.bin %> fire-action wf-instance.abc123 --activity publish --action publish --param note=shipping"
|
|
161
173
|
],
|
|
162
174
|
"flags": {
|
|
163
175
|
"tag": {
|
|
164
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
176
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
165
177
|
"name": "tag",
|
|
166
178
|
"hasDynamicHelp": false,
|
|
167
179
|
"multiple": false,
|
|
@@ -189,21 +201,6 @@
|
|
|
189
201
|
"multiple": true,
|
|
190
202
|
"type": "option"
|
|
191
203
|
},
|
|
192
|
-
"as": {
|
|
193
|
-
"description": "Attribute the fire to this Sanity user id (default: a workflow-cli system actor).",
|
|
194
|
-
"name": "as",
|
|
195
|
-
"hasDynamicHelp": false,
|
|
196
|
-
"multiple": false,
|
|
197
|
-
"type": "option"
|
|
198
|
-
},
|
|
199
|
-
"as-role": {
|
|
200
|
-
"description": "Role to attribute to the --as user (repeatable), so role-gated filters pass.",
|
|
201
|
-
"name": "as-role",
|
|
202
|
-
"default": [],
|
|
203
|
-
"hasDynamicHelp": false,
|
|
204
|
-
"multiple": true,
|
|
205
|
-
"type": "option"
|
|
206
|
-
},
|
|
207
204
|
"json": {
|
|
208
205
|
"description": "Emit structured JSON instead of rendered output.",
|
|
209
206
|
"name": "json",
|
|
@@ -218,7 +215,6 @@
|
|
|
218
215
|
"pluginName": "@sanity/workflow-cli",
|
|
219
216
|
"pluginType": "core",
|
|
220
217
|
"strict": true,
|
|
221
|
-
"enableJsonFlag": false,
|
|
222
218
|
"isESM": true,
|
|
223
219
|
"relativePath": [
|
|
224
220
|
"dist",
|
|
@@ -233,12 +229,12 @@
|
|
|
233
229
|
"examples": [
|
|
234
230
|
"<%= config.bin %> list",
|
|
235
231
|
"<%= config.bin %> list --in-flight",
|
|
236
|
-
"<%= config.bin %> list --
|
|
232
|
+
"<%= config.bin %> list --definition productLaunch",
|
|
237
233
|
"<%= config.bin %> list --tag prod"
|
|
238
234
|
],
|
|
239
235
|
"flags": {
|
|
240
236
|
"tag": {
|
|
241
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
237
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
242
238
|
"name": "tag",
|
|
243
239
|
"hasDynamicHelp": false,
|
|
244
240
|
"multiple": false,
|
|
@@ -256,9 +252,9 @@
|
|
|
256
252
|
"allowNo": false,
|
|
257
253
|
"type": "boolean"
|
|
258
254
|
},
|
|
259
|
-
"
|
|
260
|
-
"description": "
|
|
261
|
-
"name": "
|
|
255
|
+
"definition": {
|
|
256
|
+
"description": "Only instances of this workflow definition (its `name`; the instance's `definition` field).",
|
|
257
|
+
"name": "definition",
|
|
262
258
|
"hasDynamicHelp": false,
|
|
263
259
|
"multiple": false,
|
|
264
260
|
"type": "option"
|
|
@@ -279,7 +275,6 @@
|
|
|
279
275
|
"pluginName": "@sanity/workflow-cli",
|
|
280
276
|
"pluginType": "core",
|
|
281
277
|
"strict": true,
|
|
282
|
-
"enableJsonFlag": false,
|
|
283
278
|
"isESM": true,
|
|
284
279
|
"relativePath": [
|
|
285
280
|
"dist",
|
|
@@ -287,60 +282,7 @@
|
|
|
287
282
|
"list.js"
|
|
288
283
|
]
|
|
289
284
|
},
|
|
290
|
-
"
|
|
291
|
-
"aliases": [],
|
|
292
|
-
"args": {
|
|
293
|
-
"instanceId": {
|
|
294
|
-
"description": "Workflow instance id to move.",
|
|
295
|
-
"name": "instanceId",
|
|
296
|
-
"required": true
|
|
297
|
-
}
|
|
298
|
-
},
|
|
299
|
-
"description": "Move an instance to a new stage. Guards + transition effects run as if the transition fired normally.",
|
|
300
|
-
"examples": [
|
|
301
|
-
"<%= config.bin %> move-stage wf-instance.abc123 --to ready",
|
|
302
|
-
"<%= config.bin %> move-stage wf-instance.abc123 --to ready --reason 'unblock for demo'"
|
|
303
|
-
],
|
|
304
|
-
"flags": {
|
|
305
|
-
"tag": {
|
|
306
|
-
"description": "Workflow environment tag (e.g. prod, test). Overrides WORKFLOW_TAG.",
|
|
307
|
-
"name": "tag",
|
|
308
|
-
"hasDynamicHelp": false,
|
|
309
|
-
"multiple": false,
|
|
310
|
-
"type": "option"
|
|
311
|
-
},
|
|
312
|
-
"to": {
|
|
313
|
-
"description": "Target stage name.",
|
|
314
|
-
"name": "to",
|
|
315
|
-
"required": true,
|
|
316
|
-
"hasDynamicHelp": false,
|
|
317
|
-
"multiple": false,
|
|
318
|
-
"type": "option"
|
|
319
|
-
},
|
|
320
|
-
"reason": {
|
|
321
|
-
"description": "Free-text reason — recorded on the history entry for audit.",
|
|
322
|
-
"name": "reason",
|
|
323
|
-
"hasDynamicHelp": false,
|
|
324
|
-
"multiple": false,
|
|
325
|
-
"type": "option"
|
|
326
|
-
}
|
|
327
|
-
},
|
|
328
|
-
"hasDynamicHelp": false,
|
|
329
|
-
"hiddenAliases": [],
|
|
330
|
-
"id": "move-stage",
|
|
331
|
-
"pluginAlias": "@sanity/workflow-cli",
|
|
332
|
-
"pluginName": "@sanity/workflow-cli",
|
|
333
|
-
"pluginType": "core",
|
|
334
|
-
"strict": true,
|
|
335
|
-
"enableJsonFlag": false,
|
|
336
|
-
"isESM": true,
|
|
337
|
-
"relativePath": [
|
|
338
|
-
"dist",
|
|
339
|
-
"commands",
|
|
340
|
-
"move-stage.js"
|
|
341
|
-
]
|
|
342
|
-
},
|
|
343
|
-
"retry-activity": {
|
|
285
|
+
"reset-activity": {
|
|
344
286
|
"aliases": [],
|
|
345
287
|
"args": {
|
|
346
288
|
"instanceId": {
|
|
@@ -354,12 +296,12 @@
|
|
|
354
296
|
"required": true
|
|
355
297
|
}
|
|
356
298
|
},
|
|
357
|
-
"description": "
|
|
299
|
+
"description": "Reset a failed activity on an in-flight instance — back to pending (re-run) or to skipped (bypass).",
|
|
358
300
|
"flags": {},
|
|
359
301
|
"hasDynamicHelp": false,
|
|
360
302
|
"hidden": true,
|
|
361
303
|
"hiddenAliases": [],
|
|
362
|
-
"id": "
|
|
304
|
+
"id": "reset-activity",
|
|
363
305
|
"pluginAlias": "@sanity/workflow-cli",
|
|
364
306
|
"pluginName": "@sanity/workflow-cli",
|
|
365
307
|
"pluginType": "core",
|
|
@@ -368,20 +310,31 @@
|
|
|
368
310
|
"relativePath": [
|
|
369
311
|
"dist",
|
|
370
312
|
"commands",
|
|
371
|
-
"
|
|
313
|
+
"reset-activity.js"
|
|
372
314
|
]
|
|
373
315
|
},
|
|
374
316
|
"set-stage": {
|
|
375
317
|
"aliases": [],
|
|
376
318
|
"args": {
|
|
377
319
|
"instanceId": {
|
|
378
|
-
"description": "Workflow instance id.",
|
|
320
|
+
"description": "Workflow instance id to move.",
|
|
379
321
|
"name": "instanceId",
|
|
380
322
|
"required": true
|
|
381
323
|
}
|
|
382
324
|
},
|
|
383
|
-
"description": "Force
|
|
325
|
+
"description": "Force an instance into a stage, regardless of its declared transitions and filters — the engine's setStage admin override. The target stage's enter lifecycle still runs (auto-activities start, stage guards reconcile), and the post-move cascade can immediately auto-transition the instance onward.",
|
|
326
|
+
"examples": [
|
|
327
|
+
"<%= config.bin %> set-stage wf-instance.abc123 --to ready",
|
|
328
|
+
"<%= config.bin %> set-stage wf-instance.abc123 --to ready --reason 'unblock for demo'"
|
|
329
|
+
],
|
|
384
330
|
"flags": {
|
|
331
|
+
"tag": {
|
|
332
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
333
|
+
"name": "tag",
|
|
334
|
+
"hasDynamicHelp": false,
|
|
335
|
+
"multiple": false,
|
|
336
|
+
"type": "option"
|
|
337
|
+
},
|
|
385
338
|
"to": {
|
|
386
339
|
"description": "Target stage name.",
|
|
387
340
|
"name": "to",
|
|
@@ -391,7 +344,7 @@
|
|
|
391
344
|
"type": "option"
|
|
392
345
|
},
|
|
393
346
|
"reason": {
|
|
394
|
-
"description": "
|
|
347
|
+
"description": "Free-text reason — recorded on the history entry for audit.",
|
|
395
348
|
"name": "reason",
|
|
396
349
|
"hasDynamicHelp": false,
|
|
397
350
|
"multiple": false,
|
|
@@ -399,7 +352,6 @@
|
|
|
399
352
|
}
|
|
400
353
|
},
|
|
401
354
|
"hasDynamicHelp": false,
|
|
402
|
-
"hidden": true,
|
|
403
355
|
"hiddenAliases": [],
|
|
404
356
|
"id": "set-stage",
|
|
405
357
|
"pluginAlias": "@sanity/workflow-cli",
|
|
@@ -428,6 +380,13 @@
|
|
|
428
380
|
"<%= config.bin %> show wf-instance.abc123 --include history"
|
|
429
381
|
],
|
|
430
382
|
"flags": {
|
|
383
|
+
"tag": {
|
|
384
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
385
|
+
"name": "tag",
|
|
386
|
+
"hasDynamicHelp": false,
|
|
387
|
+
"multiple": false,
|
|
388
|
+
"type": "option"
|
|
389
|
+
},
|
|
431
390
|
"include": {
|
|
432
391
|
"description": "Optional sections to include in output.",
|
|
433
392
|
"name": "include",
|
|
@@ -447,7 +406,6 @@
|
|
|
447
406
|
"pluginName": "@sanity/workflow-cli",
|
|
448
407
|
"pluginType": "core",
|
|
449
408
|
"strict": true,
|
|
450
|
-
"enableJsonFlag": false,
|
|
451
409
|
"isESM": true,
|
|
452
410
|
"relativePath": [
|
|
453
411
|
"dist",
|
|
@@ -455,6 +413,65 @@
|
|
|
455
413
|
"show.js"
|
|
456
414
|
]
|
|
457
415
|
},
|
|
416
|
+
"start": {
|
|
417
|
+
"aliases": [],
|
|
418
|
+
"args": {
|
|
419
|
+
"name": {
|
|
420
|
+
"description": "Workflow definition name.",
|
|
421
|
+
"name": "name",
|
|
422
|
+
"required": true
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
"description": "Start a workflow instance from a deployed definition. Supply values for the workflow's input-sourced fields with --field (e.g. the subject document ref).",
|
|
426
|
+
"examples": [
|
|
427
|
+
"<%= config.bin %> start productLaunch",
|
|
428
|
+
"<%= config.bin %> start article-review --field subject='{\"id\":\"dataset:proj:ds:article-1\",\"type\":\"article\"}'",
|
|
429
|
+
"<%= config.bin %> start productLaunch --version 2 --tag prod"
|
|
430
|
+
],
|
|
431
|
+
"flags": {
|
|
432
|
+
"tag": {
|
|
433
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
434
|
+
"name": "tag",
|
|
435
|
+
"hasDynamicHelp": false,
|
|
436
|
+
"multiple": false,
|
|
437
|
+
"type": "option"
|
|
438
|
+
},
|
|
439
|
+
"version": {
|
|
440
|
+
"description": "Definition version to start from (default: highest deployed).",
|
|
441
|
+
"name": "version",
|
|
442
|
+
"hasDynamicHelp": false,
|
|
443
|
+
"multiple": false,
|
|
444
|
+
"type": "option"
|
|
445
|
+
},
|
|
446
|
+
"field": {
|
|
447
|
+
"description": "Initial value for a declared input-sourced field, as name=value (repeatable). Values are JSON-parsed, falling back to a string; ref kinds take a JSON object with a GDR `id` and doc `type`.",
|
|
448
|
+
"name": "field",
|
|
449
|
+
"default": [],
|
|
450
|
+
"hasDynamicHelp": false,
|
|
451
|
+
"multiple": true,
|
|
452
|
+
"type": "option"
|
|
453
|
+
},
|
|
454
|
+
"json": {
|
|
455
|
+
"description": "Emit structured JSON instead of rendered output.",
|
|
456
|
+
"name": "json",
|
|
457
|
+
"allowNo": false,
|
|
458
|
+
"type": "boolean"
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
"hasDynamicHelp": false,
|
|
462
|
+
"hiddenAliases": [],
|
|
463
|
+
"id": "start",
|
|
464
|
+
"pluginAlias": "@sanity/workflow-cli",
|
|
465
|
+
"pluginName": "@sanity/workflow-cli",
|
|
466
|
+
"pluginType": "core",
|
|
467
|
+
"strict": true,
|
|
468
|
+
"isESM": true,
|
|
469
|
+
"relativePath": [
|
|
470
|
+
"dist",
|
|
471
|
+
"commands",
|
|
472
|
+
"start.js"
|
|
473
|
+
]
|
|
474
|
+
},
|
|
458
475
|
"tail": {
|
|
459
476
|
"aliases": [],
|
|
460
477
|
"args": {
|
|
@@ -468,7 +485,15 @@
|
|
|
468
485
|
"examples": [
|
|
469
486
|
"<%= config.bin %> tail wf-instance.abc123"
|
|
470
487
|
],
|
|
471
|
-
"flags": {
|
|
488
|
+
"flags": {
|
|
489
|
+
"tag": {
|
|
490
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
491
|
+
"name": "tag",
|
|
492
|
+
"hasDynamicHelp": false,
|
|
493
|
+
"multiple": false,
|
|
494
|
+
"type": "option"
|
|
495
|
+
}
|
|
496
|
+
},
|
|
472
497
|
"hasDynamicHelp": false,
|
|
473
498
|
"hiddenAliases": [],
|
|
474
499
|
"id": "tail",
|
|
@@ -476,7 +501,6 @@
|
|
|
476
501
|
"pluginName": "@sanity/workflow-cli",
|
|
477
502
|
"pluginType": "core",
|
|
478
503
|
"strict": true,
|
|
479
|
-
"enableJsonFlag": false,
|
|
480
504
|
"isESM": true,
|
|
481
505
|
"relativePath": [
|
|
482
506
|
"dist",
|
|
@@ -501,7 +525,7 @@
|
|
|
501
525
|
],
|
|
502
526
|
"flags": {
|
|
503
527
|
"tag": {
|
|
504
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
528
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
505
529
|
"name": "tag",
|
|
506
530
|
"hasDynamicHelp": false,
|
|
507
531
|
"multiple": false,
|
|
@@ -535,7 +559,6 @@
|
|
|
535
559
|
"pluginName": "@sanity/workflow-cli",
|
|
536
560
|
"pluginType": "core",
|
|
537
561
|
"strict": true,
|
|
538
|
-
"enableJsonFlag": false,
|
|
539
562
|
"isESM": true,
|
|
540
563
|
"relativePath": [
|
|
541
564
|
"dist",
|
|
@@ -547,9 +570,9 @@
|
|
|
547
570
|
"definition:diff": {
|
|
548
571
|
"aliases": [],
|
|
549
572
|
"args": {
|
|
550
|
-
"
|
|
573
|
+
"name": {
|
|
551
574
|
"description": "Workflow definition name.",
|
|
552
|
-
"name": "
|
|
575
|
+
"name": "name",
|
|
553
576
|
"required": true
|
|
554
577
|
}
|
|
555
578
|
},
|
|
@@ -560,7 +583,7 @@
|
|
|
560
583
|
],
|
|
561
584
|
"flags": {
|
|
562
585
|
"tag": {
|
|
563
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
586
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
564
587
|
"name": "tag",
|
|
565
588
|
"hasDynamicHelp": false,
|
|
566
589
|
"multiple": false,
|
|
@@ -581,7 +604,6 @@
|
|
|
581
604
|
"pluginName": "@sanity/workflow-cli",
|
|
582
605
|
"pluginType": "core",
|
|
583
606
|
"strict": true,
|
|
584
|
-
"enableJsonFlag": false,
|
|
585
607
|
"isESM": true,
|
|
586
608
|
"relativePath": [
|
|
587
609
|
"dist",
|
|
@@ -600,7 +622,7 @@
|
|
|
600
622
|
],
|
|
601
623
|
"flags": {
|
|
602
624
|
"tag": {
|
|
603
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
625
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
604
626
|
"name": "tag",
|
|
605
627
|
"hasDynamicHelp": false,
|
|
606
628
|
"multiple": false,
|
|
@@ -614,9 +636,9 @@
|
|
|
614
636
|
"multiple": false,
|
|
615
637
|
"type": "option"
|
|
616
638
|
},
|
|
617
|
-
"
|
|
618
|
-
"description": "Filter to a single workflow definition name (e.g. product-launch)",
|
|
619
|
-
"name": "
|
|
639
|
+
"name": {
|
|
640
|
+
"description": "Filter to a single workflow definition name (e.g. product-launch).",
|
|
641
|
+
"name": "name",
|
|
620
642
|
"hasDynamicHelp": false,
|
|
621
643
|
"multiple": false,
|
|
622
644
|
"type": "option"
|
|
@@ -629,7 +651,6 @@
|
|
|
629
651
|
"pluginName": "@sanity/workflow-cli",
|
|
630
652
|
"pluginType": "core",
|
|
631
653
|
"strict": true,
|
|
632
|
-
"enableJsonFlag": false,
|
|
633
654
|
"isESM": true,
|
|
634
655
|
"relativePath": [
|
|
635
656
|
"dist",
|
|
@@ -650,7 +671,7 @@
|
|
|
650
671
|
"description": "Show a deployed workflow definition.",
|
|
651
672
|
"flags": {
|
|
652
673
|
"tag": {
|
|
653
|
-
"description": "Workflow environment tag (e.g. prod, test)
|
|
674
|
+
"description": "Workflow environment tag (e.g. prod, test) — the deployment to target for writes; an optional filter for reads.",
|
|
654
675
|
"name": "tag",
|
|
655
676
|
"hasDynamicHelp": false,
|
|
656
677
|
"multiple": false,
|
|
@@ -671,7 +692,6 @@
|
|
|
671
692
|
"pluginName": "@sanity/workflow-cli",
|
|
672
693
|
"pluginType": "core",
|
|
673
694
|
"strict": true,
|
|
674
|
-
"enableJsonFlag": false,
|
|
675
695
|
"isESM": true,
|
|
676
696
|
"relativePath": [
|
|
677
697
|
"dist",
|
|
@@ -681,5 +701,5 @@
|
|
|
681
701
|
]
|
|
682
702
|
}
|
|
683
703
|
},
|
|
684
|
-
"version": "0.
|
|
704
|
+
"version": "0.10.0"
|
|
685
705
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/workflow-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Command-line tool for deploying, inspecting, and administering Sanity workflow definitions and instances.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"dist",
|
|
29
29
|
"bin/run.js",
|
|
30
|
-
"oclif.manifest.json"
|
|
30
|
+
"oclif.manifest.json",
|
|
31
|
+
"CHANGELOG.md"
|
|
31
32
|
],
|
|
32
33
|
"type": "module",
|
|
33
34
|
"sideEffects": false,
|
|
@@ -41,32 +42,38 @@
|
|
|
41
42
|
"./package.json": "./package.json"
|
|
42
43
|
},
|
|
43
44
|
"publishConfig": {
|
|
44
|
-
"access": "
|
|
45
|
+
"access": "public"
|
|
45
46
|
},
|
|
46
47
|
"dependencies": {
|
|
47
48
|
"@oclif/core": "^4.11.4",
|
|
48
49
|
"@oclif/plugin-help": "^6.2.50",
|
|
50
|
+
"@sanity/cli-core": "^2.1.1",
|
|
49
51
|
"@sanity/client": "^7.22.1",
|
|
52
|
+
"@sanity/telemetry": "^1.1.0",
|
|
50
53
|
"boxen": "^8.0.1",
|
|
51
|
-
"console-table-printer": "^2.16.0",
|
|
52
54
|
"date-fns": "^4.4.0",
|
|
53
55
|
"diff": "^9.0.0",
|
|
56
|
+
"jiti": "^2.7.0",
|
|
54
57
|
"log-symbols": "^7.0.1",
|
|
55
58
|
"ora": "^9.4.0",
|
|
56
|
-
"@sanity/workflow-engine": "0.
|
|
59
|
+
"@sanity/workflow-engine": "0.15.0"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
62
|
"@types/diff": "^8.0.0",
|
|
60
63
|
"@types/node": "^24.12.4",
|
|
61
64
|
"oclif": "^4.23.16",
|
|
62
65
|
"vitest": "^4.1.8",
|
|
63
|
-
"@sanity/workflow-engine-test": "0.
|
|
64
|
-
"@sanity/workflow-examples": "0.
|
|
66
|
+
"@sanity/workflow-engine-test": "0.10.0",
|
|
67
|
+
"@sanity/workflow-examples": "0.5.0"
|
|
65
68
|
},
|
|
66
69
|
"oclif": {
|
|
67
70
|
"bin": "sanity-workflows",
|
|
68
71
|
"commands": "./dist/commands",
|
|
69
72
|
"dirname": "sanity-workflows",
|
|
73
|
+
"hooks": {
|
|
74
|
+
"finally": "./dist/hooks/finally/telemetry",
|
|
75
|
+
"prerun": "./dist/hooks/prerun/telemetry"
|
|
76
|
+
},
|
|
70
77
|
"plugins": [
|
|
71
78
|
"@oclif/plugin-help"
|
|
72
79
|
],
|
|
@@ -84,9 +91,10 @@
|
|
|
84
91
|
"node": ">=20.12"
|
|
85
92
|
},
|
|
86
93
|
"scripts": {
|
|
87
|
-
"build": "tsc -p tsconfig.build.json",
|
|
94
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json && tsc -p tsconfig.declarations.json",
|
|
88
95
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
89
96
|
"test": "vitest run",
|
|
97
|
+
"test:packaging": "vitest run --config vitest.packaging.config.ts",
|
|
90
98
|
"test:watch": "vitest",
|
|
91
99
|
"dev": "NODE_OPTIONS='--conditions=development' tsx --env-file-if-exists=../../.env bin/dev.js",
|
|
92
100
|
"cli": "NODE_OPTIONS='--conditions=development' tsx --env-file-if-exists=../../.env bin/dev.js"
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
import { type SetStageArgs } from '@sanity/workflow-engine';
|
|
3
|
-
import { type WorkflowConfig } from '../lib/config.ts';
|
|
4
|
-
import { type RanOp } from '../lib/ops-report.ts';
|
|
5
|
-
export default class MoveStage extends Command {
|
|
6
|
-
static description: string;
|
|
7
|
-
static examples: string[];
|
|
8
|
-
static args: {
|
|
9
|
-
instanceId: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
10
|
-
};
|
|
11
|
-
static flags: {
|
|
12
|
-
to: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
-
reason: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
-
tag: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
-
};
|
|
16
|
-
run(): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
/** The shared operation args ({@link buildOperationArgs}) plus the
|
|
19
|
-
* setStage-specific target. */
|
|
20
|
-
export declare function buildSetStageArgs({ config, instanceId, targetStage, reason, }: {
|
|
21
|
-
config: WorkflowConfig;
|
|
22
|
-
instanceId: string;
|
|
23
|
-
targetStage: string;
|
|
24
|
-
reason: string | undefined;
|
|
25
|
-
}): Omit<SetStageArgs, 'client'>;
|
|
26
|
-
interface SetStageOutcome {
|
|
27
|
-
fired: boolean;
|
|
28
|
-
cascaded: number;
|
|
29
|
-
instance: {
|
|
30
|
-
currentStage: string;
|
|
31
|
-
};
|
|
32
|
-
ranOps?: RanOp[];
|
|
33
|
-
}
|
|
34
|
-
export interface MoveStageReport {
|
|
35
|
-
fired: boolean;
|
|
36
|
-
/** Spinner message — warn copy when not fired, success copy otherwise. */
|
|
37
|
-
message: string;
|
|
38
|
-
/**
|
|
39
|
-
* The full "ops applied" block to print after the spinner — a blank
|
|
40
|
-
* line, the header, and one line per op. Empty when nothing ran (or
|
|
41
|
-
* when the transition didn't fire), so the caller can print it
|
|
42
|
-
* unconditionally.
|
|
43
|
-
*/
|
|
44
|
-
opsLines: string[];
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Turn a `setStage` result into the spinner message + ops block. Pure so
|
|
48
|
-
* the fired / not-fired / cascaded / ops permutations can be asserted
|
|
49
|
-
* without driving a real transition.
|
|
50
|
-
*/
|
|
51
|
-
export declare function moveStageReport(result: SetStageOutcome, to: string): MoveStageReport;
|
|
52
|
-
export {};
|