@sanity/cli 8.4.2 → 8.6.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 (33) hide show
  1. package/README.md +1 -1
  2. package/dist/SanityHelp.js +37 -1
  3. package/dist/SanityHelp.js.map +1 -1
  4. package/dist/actions/auth/login/login.js +0 -1
  5. package/dist/actions/auth/login/login.js.map +1 -1
  6. package/dist/actions/deploy/deployApp.js +1 -0
  7. package/dist/actions/deploy/deployApp.js.map +1 -1
  8. package/dist/actions/deploy/deployStudio.js +3 -1
  9. package/dist/actions/deploy/deployStudio.js.map +1 -1
  10. package/dist/actions/deploy/deployStudioSchemasAndManifests.js +2 -1
  11. package/dist/actions/deploy/deployStudioSchemasAndManifests.js.map +1 -1
  12. package/dist/actions/deploy/deployStudioSchemasAndManifests.worker.js +2 -113
  13. package/dist/actions/deploy/deployStudioSchemasAndManifests.worker.js.map +1 -1
  14. package/dist/actions/deploy/deployStudioSchemasAndManifestsWorker.js +52 -0
  15. package/dist/actions/deploy/deployStudioSchemasAndManifestsWorker.js.map +1 -0
  16. package/dist/actions/deploy/types.js.map +1 -1
  17. package/dist/actions/manifest/extractManifest.js +2 -1
  18. package/dist/actions/manifest/extractManifest.js.map +1 -1
  19. package/dist/actions/manifest/extractStudioManifest.js +1 -0
  20. package/dist/actions/manifest/extractStudioManifest.js.map +1 -1
  21. package/dist/commands/init.js +1 -1
  22. package/dist/commands/init.js.map +1 -1
  23. package/dist/commands/media/delete-aspect.js +1 -3
  24. package/dist/commands/media/delete-aspect.js.map +1 -1
  25. package/dist/commands/tokens/delete.js +1 -3
  26. package/dist/commands/tokens/delete.js.map +1 -1
  27. package/dist/generated/apiRoutes.js +15 -1
  28. package/dist/generated/apiRoutes.js.map +1 -1
  29. package/dist/topicAliases.js +3 -0
  30. package/dist/topicAliases.js.map +1 -1
  31. package/oclif.config.js +2 -1
  32. package/oclif.manifest.json +360 -364
  33. package/package.json +15 -13
@@ -60,6 +60,9 @@
60
60
  ],
61
61
  users: [
62
62
  'user'
63
+ ],
64
+ workflows: [
65
+ 'workflow'
63
66
  ]
64
67
  };
65
68
  const canonicalTopicByAlias = new Map(Object.entries(topicAliases).flatMap(([canonical, aliases])=>aliases.map((alias)=>[
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/topicAliases.ts"],"sourcesContent":["/**\n * Topic Alias Configuration\n *\n * Maps canonical topic names to their aliases. Used by:\n * - The command_not_found hook (runtime alias resolution)\n * - Programmatic CLI invocation\n * - Help rendering\n * - The check-topic-aliases script (build-time validation)\n *\n * Every topic with aliases must be listed here. The key is the canonical\n * topic name (the actual directory under commands/), and values are\n * alternative names that should resolve to it.\n *\n * Convention: prefer plural canonical names with singular aliases.\n * datasets: ['dataset'] - \"sanity dataset create\" works\n * cors: [] - no alias needed (no natural singular/plural pair)\n *\n * While the config technically supports any direction, keeping it consistent\n * (plural to singular) makes the CLI predictable for users.\n */\nexport const topicAliases: Record<string, string[]> = {\n assets: ['asset'],\n backups: ['backup'],\n blueprints: ['blueprint'],\n datasets: ['dataset'],\n documents: ['document'],\n functions: ['function'],\n hooks: ['hook'],\n migrations: ['migration'],\n organizations: ['organization', 'organisations', 'organisation', 'org', 'orgs'],\n projects: ['project'],\n schemas: ['schema'],\n tokens: ['token'],\n users: ['user'],\n}\n\nconst canonicalTopicByAlias = new Map(\n Object.entries(topicAliases).flatMap(([canonical, aliases]) =>\n aliases.map((alias) => [alias, canonical]),\n ),\n)\n\n/**\n * Resolve the topic portion of a command ID from an alias to its canonical name.\n * Handles both bare topics (`hook`) and colon-separated command IDs (`hook:list`).\n *\n * @internal\n */\nexport function resolveTopicAlias(id: string): string | undefined {\n const separatorIndex = id.indexOf(':')\n const topic = separatorIndex === -1 ? id : id.slice(0, separatorIndex)\n const canonical = canonicalTopicByAlias.get(topic)\n if (!canonical) return undefined\n\n const suffix = separatorIndex === -1 ? '' : id.slice(separatorIndex)\n return `${canonical}${suffix}`\n}\n\n/**\n * Resolve the first positional topic in argv, preserving flags and arguments.\n *\n * @internal\n */\nexport function resolveTopicAliasInArgv(argv: string[]): string[] {\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i]\n if (arg === '--') break\n if (arg.startsWith('-')) continue\n\n const resolvedTopic = resolveTopicAlias(arg)\n if (resolvedTopic) {\n const resolved = [...argv]\n resolved[i] = resolvedTopic\n return resolved\n }\n break\n }\n return argv\n}\n"],"names":["topicAliases","assets","backups","blueprints","datasets","documents","functions","hooks","migrations","organizations","projects","schemas","tokens","users","canonicalTopicByAlias","Map","Object","entries","flatMap","canonical","aliases","map","alias","resolveTopicAlias","id","separatorIndex","indexOf","topic","slice","get","undefined","suffix","resolveTopicAliasInArgv","argv","i","length","arg","startsWith","resolvedTopic","resolved"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,MAAMA,eAAyC;IACpDC,QAAQ;QAAC;KAAQ;IACjBC,SAAS;QAAC;KAAS;IACnBC,YAAY;QAAC;KAAY;IACzBC,UAAU;QAAC;KAAU;IACrBC,WAAW;QAAC;KAAW;IACvBC,WAAW;QAAC;KAAW;IACvBC,OAAO;QAAC;KAAO;IACfC,YAAY;QAAC;KAAY;IACzBC,eAAe;QAAC;QAAgB;QAAiB;QAAgB;QAAO;KAAO;IAC/EC,UAAU;QAAC;KAAU;IACrBC,SAAS;QAAC;KAAS;IACnBC,QAAQ;QAAC;KAAQ;IACjBC,OAAO;QAAC;KAAO;AACjB,EAAC;AAED,MAAMC,wBAAwB,IAAIC,IAChCC,OAAOC,OAAO,CAACjB,cAAckB,OAAO,CAAC,CAAC,CAACC,WAAWC,QAAQ,GACxDA,QAAQC,GAAG,CAAC,CAACC,QAAU;YAACA;YAAOH;SAAU;AAI7C;;;;;CAKC,GACD,OAAO,SAASI,kBAAkBC,EAAU;IAC1C,MAAMC,iBAAiBD,GAAGE,OAAO,CAAC;IAClC,MAAMC,QAAQF,mBAAmB,CAAC,IAAID,KAAKA,GAAGI,KAAK,CAAC,GAAGH;IACvD,MAAMN,YAAYL,sBAAsBe,GAAG,CAACF;IAC5C,IAAI,CAACR,WAAW,OAAOW;IAEvB,MAAMC,SAASN,mBAAmB,CAAC,IAAI,KAAKD,GAAGI,KAAK,CAACH;IACrD,OAAO,GAAGN,YAAYY,QAAQ;AAChC;AAEA;;;;CAIC,GACD,OAAO,SAASC,wBAAwBC,IAAc;IACpD,IAAK,IAAIC,IAAI,GAAGA,IAAID,KAAKE,MAAM,EAAED,IAAK;QACpC,MAAME,MAAMH,IAAI,CAACC,EAAE;QACnB,IAAIE,QAAQ,MAAM;QAClB,IAAIA,IAAIC,UAAU,CAAC,MAAM;QAEzB,MAAMC,gBAAgBf,kBAAkBa;QACxC,IAAIE,eAAe;YACjB,MAAMC,WAAW;mBAAIN;aAAK;YAC1BM,QAAQ,CAACL,EAAE,GAAGI;YACd,OAAOC;QACT;QACA;IACF;IACA,OAAON;AACT"}
1
+ {"version":3,"sources":["../src/topicAliases.ts"],"sourcesContent":["/**\n * Topic Alias Configuration\n *\n * Maps canonical topic names to their aliases. Used by:\n * - The command_not_found hook (runtime alias resolution)\n * - Programmatic CLI invocation\n * - Help rendering\n * - The check-topic-aliases script (build-time validation)\n *\n * Every topic with aliases must be listed here. The key is the canonical\n * topic name (the actual directory under commands/), and values are\n * alternative names that should resolve to it.\n *\n * Convention: prefer plural canonical names with singular aliases.\n * datasets: ['dataset'] - \"sanity dataset create\" works\n * cors: [] - no alias needed (no natural singular/plural pair)\n *\n * While the config technically supports any direction, keeping it consistent\n * (plural to singular) makes the CLI predictable for users.\n */\nexport const topicAliases: Record<string, string[]> = {\n assets: ['asset'],\n backups: ['backup'],\n blueprints: ['blueprint'],\n datasets: ['dataset'],\n documents: ['document'],\n functions: ['function'],\n hooks: ['hook'],\n migrations: ['migration'],\n organizations: ['organization', 'organisations', 'organisation', 'org', 'orgs'],\n projects: ['project'],\n schemas: ['schema'],\n tokens: ['token'],\n users: ['user'],\n workflows: ['workflow'],\n}\n\nconst canonicalTopicByAlias = new Map(\n Object.entries(topicAliases).flatMap(([canonical, aliases]) =>\n aliases.map((alias) => [alias, canonical]),\n ),\n)\n\n/**\n * Resolve the topic portion of a command ID from an alias to its canonical name.\n * Handles both bare topics (`hook`) and colon-separated command IDs (`hook:list`).\n *\n * @internal\n */\nexport function resolveTopicAlias(id: string): string | undefined {\n const separatorIndex = id.indexOf(':')\n const topic = separatorIndex === -1 ? id : id.slice(0, separatorIndex)\n const canonical = canonicalTopicByAlias.get(topic)\n if (!canonical) return undefined\n\n const suffix = separatorIndex === -1 ? '' : id.slice(separatorIndex)\n return `${canonical}${suffix}`\n}\n\n/**\n * Resolve the first positional topic in argv, preserving flags and arguments.\n *\n * @internal\n */\nexport function resolveTopicAliasInArgv(argv: string[]): string[] {\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i]\n if (arg === '--') break\n if (arg.startsWith('-')) continue\n\n const resolvedTopic = resolveTopicAlias(arg)\n if (resolvedTopic) {\n const resolved = [...argv]\n resolved[i] = resolvedTopic\n return resolved\n }\n break\n }\n return argv\n}\n"],"names":["topicAliases","assets","backups","blueprints","datasets","documents","functions","hooks","migrations","organizations","projects","schemas","tokens","users","workflows","canonicalTopicByAlias","Map","Object","entries","flatMap","canonical","aliases","map","alias","resolveTopicAlias","id","separatorIndex","indexOf","topic","slice","get","undefined","suffix","resolveTopicAliasInArgv","argv","i","length","arg","startsWith","resolvedTopic","resolved"],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;CAmBC,GACD,OAAO,MAAMA,eAAyC;IACpDC,QAAQ;QAAC;KAAQ;IACjBC,SAAS;QAAC;KAAS;IACnBC,YAAY;QAAC;KAAY;IACzBC,UAAU;QAAC;KAAU;IACrBC,WAAW;QAAC;KAAW;IACvBC,WAAW;QAAC;KAAW;IACvBC,OAAO;QAAC;KAAO;IACfC,YAAY;QAAC;KAAY;IACzBC,eAAe;QAAC;QAAgB;QAAiB;QAAgB;QAAO;KAAO;IAC/EC,UAAU;QAAC;KAAU;IACrBC,SAAS;QAAC;KAAS;IACnBC,QAAQ;QAAC;KAAQ;IACjBC,OAAO;QAAC;KAAO;IACfC,WAAW;QAAC;KAAW;AACzB,EAAC;AAED,MAAMC,wBAAwB,IAAIC,IAChCC,OAAOC,OAAO,CAAClB,cAAcmB,OAAO,CAAC,CAAC,CAACC,WAAWC,QAAQ,GACxDA,QAAQC,GAAG,CAAC,CAACC,QAAU;YAACA;YAAOH;SAAU;AAI7C;;;;;CAKC,GACD,OAAO,SAASI,kBAAkBC,EAAU;IAC1C,MAAMC,iBAAiBD,GAAGE,OAAO,CAAC;IAClC,MAAMC,QAAQF,mBAAmB,CAAC,IAAID,KAAKA,GAAGI,KAAK,CAAC,GAAGH;IACvD,MAAMN,YAAYL,sBAAsBe,GAAG,CAACF;IAC5C,IAAI,CAACR,WAAW,OAAOW;IAEvB,MAAMC,SAASN,mBAAmB,CAAC,IAAI,KAAKD,GAAGI,KAAK,CAACH;IACrD,OAAO,GAAGN,YAAYY,QAAQ;AAChC;AAEA;;;;CAIC,GACD,OAAO,SAASC,wBAAwBC,IAAc;IACpD,IAAK,IAAIC,IAAI,GAAGA,IAAID,KAAKE,MAAM,EAAED,IAAK;QACpC,MAAME,MAAMH,IAAI,CAACC,EAAE;QACnB,IAAIE,QAAQ,MAAM;QAClB,IAAIA,IAAIC,UAAU,CAAC,MAAM;QAEzB,MAAMC,gBAAgBf,kBAAkBa;QACxC,IAAIE,eAAe;YACjB,MAAMC,WAAW;mBAAIN;aAAK;YAC1BM,QAAQ,CAACL,EAAE,GAAGI;YACd,OAAOC;QACT;QACA;IACF;IACA,OAAON;AACT"}
package/oclif.config.js CHANGED
@@ -13,7 +13,7 @@ export default {
13
13
  './dist/hooks/prerun/warnings.js',
14
14
  ],
15
15
  },
16
- plugins: ['@oclif/plugin-help', '@sanity/runtime-cli'],
16
+ plugins: ['@oclif/plugin-help', '@sanity/runtime-cli', '@sanity/workflow-cli'],
17
17
  topics: {
18
18
  backups: {description: 'Manage dataset backups'},
19
19
  cors: {description: 'Manage CORS origins for your project'},
@@ -35,6 +35,7 @@ export default {
35
35
  tokens: {description: 'Manage API tokens for your project'},
36
36
  typegen: {description: 'Generate TypeScript types for schema and GROQ'},
37
37
  users: {description: 'Manage project users and invitations'},
38
+ workflows: {hidden: true},
38
39
  },
39
40
  topicSeparator: ' ',
40
41
  }