94b0b5f5e0
* fix(server): cross server sync not respecting token * minor adjustment * getting rid of token positional arg
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import { CommandModule } from 'yargs'
|
|
import { cliLogger } from '@/logging/logging'
|
|
import { downloadProject } from '@/modules/cross-server-sync/services/project'
|
|
|
|
const command: CommandModule<
|
|
unknown,
|
|
{
|
|
projectUrl: string
|
|
authorId: string
|
|
syncComments: boolean
|
|
token?: string
|
|
}
|
|
> = {
|
|
command: 'project <projectUrl> <authorId> [syncComments]',
|
|
describe: 'Download a project from an external Speckle server instance',
|
|
builder: {
|
|
projectUrl: {
|
|
describe:
|
|
'Public Project URL (e.g. https://latest.speckle.systems/projects/594d657cdd)',
|
|
type: 'string'
|
|
},
|
|
authorId: {
|
|
describe: 'ID of the local user that will own the project',
|
|
type: 'string'
|
|
},
|
|
syncComments: {
|
|
describe: 'Whether or not to sync comments as well',
|
|
type: 'boolean',
|
|
default: true
|
|
},
|
|
token: {
|
|
describe: 'Target server auth token, in case the stream is private',
|
|
type: 'string'
|
|
}
|
|
},
|
|
handler: async (argv) => {
|
|
await downloadProject(argv, { logger: cliLogger })
|
|
}
|
|
}
|
|
|
|
export = command
|