Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@oclif/config": "^1.18.9",
"@oclif/plugin-help": "^3.3.1",
"@vertexvis/api-client-node": "^0.33.2",
"archiver": "^7.0.1",
"cli-ux": "^5.6.7",
"fast-xml-parser": "^3.21",
"fs-extra": "^10.1.0",
Expand All @@ -37,10 +38,11 @@
"@oclif/dev-cli": "^1",
"@oclif/parser": "^3.8",
"@oclif/test": "^1.2",
"@types/archiver": "^7.0.0",
"@types/chai": "^4.3",
"@types/fs-extra": "^9.0",
"@types/mocha": "^9",
"@types/node": "^16",
"@types/node": "~16.11.26",
"@vertexvis/eslint-config-vertexvis-typescript": "0.4",
"chai": "^4.3",
"eslint": "^7",
Expand Down Expand Up @@ -93,6 +95,9 @@
"scene-views": {
"description": "Scene view CRUD operations."
},
"scene-trees": {
"description": "Scene item tree operations."
},
"scenes": {
"description": "Scene CRUD operations."
},
Expand All @@ -117,5 +122,6 @@
"setup": "yarn && yarn link",
"test": "nyc mocha",
"version": "oclif-dev readme && git add README.md"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
6 changes: 3 additions & 3 deletions src/commands/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { deleteFile, fileExists } from '../lib/fs';
const UserRw = 0o600; // rw- --- ---

export default class Configure extends BaseCommand {
public static description = `Configure Vertex credentials.`;
public static readonly description = `Configure Vertex credentials.`;

public static examples = [
public static readonly examples = [
`$ vertex configure
Saved 'https://platform.vertexvis.com' configuration to '~/.config/@vertexvis/cli/config.json'.
`,
];

public static flags = { ...BaseCommand.flags };
public static readonly flags = { ...BaseCommand.flags };

public async run(): Promise<void> {
const basePath = this.parsedFlags?.basePath;
Expand Down
8 changes: 4 additions & 4 deletions src/commands/create-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ import BaseCommand from '../lib/base';
import { fileExists } from '../lib/fs';

export default class CreateItems extends BaseCommand {
public static description = `Calculate path IDs and transforms for each instance in file and output JSON file containing SceneItems (as defined in src/create-items/index.d.ts).`;
public static readonly description = `Calculate path IDs and transforms for each instance in file and output JSON file containing SceneItems (as defined in src/create-items/index.d.ts).`;

public static examples = [
public static readonly examples = [
`$ vertex create-items --format pvs [YOUR_PATH_TO_XML_FILE]
Wrote 5 pvs item(s) from '[YOUR_PATH_TO_XML_FILE]' to 'items.json'.
`,
];

public static args = [{ name: 'path' }];
public static readonly args = [{ name: 'path' }];

public static flags = {
public static readonly flags = {
...BaseCommand.flags,
format: flags.string({
char: 'f',
Expand Down
8 changes: 4 additions & 4 deletions src/commands/create-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,17 @@ interface Args extends BaseReq {
}

export default class CreateParts extends BaseCommand {
public static description = `Given JSON file containing SceneItems (as defined in src/create-items/index.d.ts), upload geometry files and create parts in Vertex Part Library.`;
public static readonly description = `Given JSON file containing SceneItems (as defined in src/create-items/index.d.ts), upload geometry files and create parts in Vertex Part Library.`;

public static examples = [
public static readonly examples = [
`$ vertex create-parts --directory [YOUR_PATH_TO_GEOMETRY_DIRECTORY] [YOUR_PATH_TO_JSON_FILE]
████████████████████████████████████████ 100% | 10/10
`,
];

public static args = [{ name: 'path' }];
public static readonly args = [{ name: 'path' }];

public static flags = {
public static readonly flags = {
...BaseCommand.flags,
directory: flags.string({
char: 'd',
Expand Down
8 changes: 4 additions & 4 deletions src/commands/create-scene.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ type CreateSceneFn = (
) => Promise<CreateSceneAndSceneItemsRes>;

export default class CreateScene extends BaseCommand {
public static description = `Given JSON file containing SceneItems (as defined in src/create-items/index.d.ts), create scene in Vertex.`;
public static readonly description = `Given JSON file containing SceneItems (as defined in src/create-items/index.d.ts), create scene in Vertex.`;

public static examples = [
public static readonly examples = [
`$ vertex create-scene --name my-scene [YOUR_PATH_TO_JSON_FILE]
████████████████████████████████████████ 100% | 10/10
f79d4760-0b71-44e4-ad0b-22743fdd4ca3
`,
];

public static args = [{ name: 'path' }];
public static readonly args = [{ name: 'path' }];

public static flags = {
public static readonly flags = {
...BaseCommand.flags,
validate: flags.boolean({
description:
Expand Down
6 changes: 3 additions & 3 deletions src/commands/exports/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ import { vertexClient } from '../../lib/client';
type CreateExportFn = (args: CreateExportReq) => Promise<Export>;

export default class Create extends BaseCommand {
public static description = `Create an export for a scene.`;
public static readonly description = `Create an export for a scene.`;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I resolved a sonar finding on all these static values. It's a widespread pattern in this repo, so it resulted in a lot of files being changed. But there should be no effective functional change with all these.


public static examples = [
public static readonly examples = [
`$ vertex exports:create --sceneId f79d4760-0b71-44e4-ad0b-22743fdd4ca3 --format jt
bf0c4343-96eb-4aa9-8dee-e79c6458dedf
`,
];

public static flags = {
public static readonly flags = {
...BaseCommand.flags,
sceneId: flags.string({
description: `Scene to export.`,
Expand Down
8 changes: 4 additions & 4 deletions src/commands/exports/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { vertexClient } from '../../lib/client';
import { exportGetter } from '../../lib/getter';

export default class Get extends BaseGetCommand {
public static description = `Download an export.`;
public static readonly description = `Download an export.`;

public static examples = [
public static readonly examples = [
`$ vertex exports:download 54964c61-05d8-4f37-9638-18f7c4960c80
Export saved as: 54964c61-05d8-4f37-9638-18f7c4960c80
`,
];

public static args = [{ name: 'id', required: true }];
public static readonly args = [{ name: 'id', required: true }];

public static flags = BaseGetCommand.flags;
public static readonly flags = BaseGetCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/exports/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { vertexClient } from '../../lib/client';
import { exportGetter, getterFn } from '../../lib/getter';

export default class Get extends BaseGetCommand {
public static description = `Get an export.`;
public static readonly description = `Get an export.`;

public static examples = [
public static readonly examples = [
`$ vertex exports:get 54964c61-05d8-4f37-9638-18f7c4960c80
Id DownloadUrl
54964c61-05d8-4f37-9638-18f7c4960c80 https://some-url.com/some-file
`,
];

public static args = [{ name: 'id', required: true }];
public static readonly args = [{ name: 'id', required: true }];

public static flags = BaseGetCommand.flags;
public static readonly flags = BaseGetCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/files/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { vertexClient } from '../../lib/client';
import { deleter, fileDeleter, validate } from '../../lib/deleter';

export default class Delete extends BaseDeleteCommand {
public static description = `Delete files.`;
public static readonly description = `Delete files.`;

public static examples = [
public static readonly examples = [
`$ vertex files:delete 54964c61-05d8-4f37-9638-18f7c4960c80
Deleted file 54964c61-05d8-4f37-9638-18f7c4960c80.
Deleting file(s)...... done
`,
];

public static args = [{ name: 'id' }];
public static readonly args = [{ name: 'id' }];

public static flags = BaseDeleteCommand.flags;
public static readonly flags = BaseDeleteCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/files/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { vertexClient } from '../../lib/client';
import { fileGetter, getterFn } from '../../lib/getter';

export default class Get extends BaseGetCommand {
public static description = `Get a file.`;
public static readonly description = `Get a file.`;

public static examples = [
public static readonly examples = [
`$ vertex files:get 54964c61-05d8-4f37-9638-18f7c4960c80
Id Name
54964c61-05d8-4f37-9638-18f7c4960c80 my-file
`,
];

public static args = [{ name: 'id', required: true }];
public static readonly args = [{ name: 'id', required: true }];

public static flags = BaseGetCommand.flags;
public static readonly flags = BaseGetCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/files/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { vertexClient } from '../../lib/client';
import { fileGetter, getterFn } from '../../lib/getter';

export default class List extends BaseListCommand {
public static description = `Get files.`;
public static readonly description = `Get files.`;

public static examples = [
public static readonly examples = [
`$ vertex files:list
Id Name
54964c61-05d8-4f37-9638-18f7c4960c80 my-file-1
a8070713-e48e-466b-b4bb-b3132895d5ce my-file-2
`,
];

public static flags = BaseListCommand.flags;
public static readonly flags = BaseListCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/part-revisions/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ import { vertexClient } from '../../lib/client';
import { createFile, validate, validateImage } from '../../lib/renderer';

export default class Render extends BaseRenderCommand {
public static description = `Render a part revision.`;
public static readonly description = `Render a part revision.`;

public static examples = [
public static readonly examples = [
`$ vertex part-revisions:render 54964c61-05d8-4f37-9638-18f7c4960c80
54964c61-05d8-4f37-9638-18f7c4960c80.jpg
`,
];

public static args = [{ name: 'id', required: true }];
public static readonly args = [{ name: 'id', required: true }];

public static flags = BaseRenderCommand.flags;
public static readonly flags = BaseRenderCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/parts/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import { vertexClient } from '../../lib/client';
import { deleter, partDeleter, validate } from '../../lib/deleter';

export default class Delete extends BaseDeleteCommand {
public static description = `Delete parts.`;
public static readonly description = `Delete parts.`;

public static examples = [
public static readonly examples = [
`$ vertex parts:delete 54964c61-05d8-4f37-9638-18f7c4960c80
Deleted part 54964c61-05d8-4f37-9638-18f7c4960c80.
Deleting part(s)...... done
`,
];

public static args = [{ name: 'id' }];
public static readonly args = [{ name: 'id' }];

public static flags = BaseDeleteCommand.flags;
public static readonly flags = BaseDeleteCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/parts/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { vertexClient } from '../../lib/client';
import { getterFn, partGetter } from '../../lib/getter';

export default class Get extends BaseGetCommand {
public static description = `Get a part.`;
public static readonly description = `Get a part.`;

public static examples = [
public static readonly examples = [
`$ vertex parts:get 54964c61-05d8-4f37-9638-18f7c4960c80
Id Name
54964c61-05d8-4f37-9638-18f7c4960c80 my-part
`,
];

public static args = [{ name: 'id', required: true }];
public static readonly args = [{ name: 'id', required: true }];

public static flags = BaseGetCommand.flags;
public static readonly flags = BaseGetCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/parts/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { vertexClient } from '../../lib/client';
import { getterFn, partGetter } from '../../lib/getter';

export default class List extends BaseListCommand {
public static description = `Get parts.`;
public static readonly description = `Get parts.`;

public static examples = [
public static readonly examples = [
`$ vertex parts:list
Id Name
54964c61-05d8-4f37-9638-18f7c4960c80 my-part-1
a8070713-e48e-466b-b4bb-b3132895d5ce my-part-2
`,
];

public static flags = BaseListCommand.flags;
public static readonly flags = BaseListCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
8 changes: 4 additions & 4 deletions src/commands/scene-items/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import { vertexClient } from '../../lib/client';
import { getterFn, sceneItemGetter } from '../../lib/getter';

export default class Get extends BaseGetCommand {
public static description = `Get a scene item.`;
public static readonly description = `Get a scene item.`;

public static examples = [
public static readonly examples = [
`$ vertex scene-items:get 54964c61-05d8-4f37-9638-18f7c4960c80
Id Name
54964c61-05d8-4f37-9638-18f7c4960c80 my-scene-item
`,
];

public static args = [{ name: 'id', required: true }];
public static readonly args = [{ name: 'id', required: true }];

public static flags = BaseGetCommand.flags;
public static readonly flags = BaseGetCommand.flags;

public async run(): Promise<void> {
const {
Expand Down
6 changes: 3 additions & 3 deletions src/commands/scene-items/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import { vertexClient } from '../../lib/client';
import { getterFn, sceneItemGetter } from '../../lib/getter';

export default class List extends BaseListCommand {
public static description = `Get scene items.`;
public static readonly description = `Get scene items.`;

public static examples = [
public static readonly examples = [
`$ vertex scene-items:list
Id Name
54964c61-05d8-4f37-9638-18f7c4960c80 my-scene-item-1
a8070713-e48e-466b-b4bb-b3132895d5ce my-scene-item-2
`,
];

public static flags = {
public static readonly flags = {
...BaseListCommand.flags,
sceneId: flags.string({
description: `Scene to list scene items.`,
Expand Down
Loading