mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 21:37:46 +00:00
feat(operations): add create_project operation across agent, mcp, and cli (#529)
* feat(operations): add create_project operation across agent, mcp, and cli * fix(api): remove legacy team creation endpoint * fix(api): preserve ProjectInfo response on POST /teams/:teamId/projects
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
||||
copyAssets,
|
||||
createComment,
|
||||
createFolder,
|
||||
createProject,
|
||||
createVersionStack,
|
||||
deleteAsset,
|
||||
downloadAsset,
|
||||
@@ -118,6 +119,31 @@ describe('shumai-cli', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('project create', () => {
|
||||
it('creates a project with positional name and optional --team', async () => {
|
||||
const cli = setup()
|
||||
cli.callOperation.mockResolvedValue({
|
||||
id: 'p-new',
|
||||
name: 'Summer Shoot',
|
||||
teamId: 't1',
|
||||
rootFolderId: 'root-new',
|
||||
})
|
||||
|
||||
await cli.run('project', 'create', 'Summer Shoot')
|
||||
|
||||
expect(cli.callOperation).toHaveBeenCalledWith(createProject, { name: 'Summer Shoot' })
|
||||
expect(cli.stdout()).toBe(
|
||||
'Created project "Summer Shoot" (ID: p-new, rootFolderId: root-new)\n',
|
||||
)
|
||||
|
||||
await cli.run('project', 'create', 'Team Shoot', '-t', 't2', '--json')
|
||||
expect(cli.callOperation).toHaveBeenLastCalledWith(createProject, {
|
||||
name: 'Team Shoot',
|
||||
teamId: 't2',
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('ls', () => {
|
||||
it('lists a folder with the maximum page size, folders first', async () => {
|
||||
const cli = setup()
|
||||
|
||||
Reference in New Issue
Block a user